Skip to content

Commit a1a4c61

Browse files
committed
fix(ci): the domain property of a site doesn't exist in the open source version
1 parent 57294e7 commit a1a4c61

File tree

19 files changed

+173
-227
lines changed

19 files changed

+173
-227
lines changed

.annotaterb.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
:position: before
3+
:position_in_additional_file_patterns: before
4+
:position_in_class: before
5+
:position_in_factory: before
6+
:position_in_fixture: before
7+
:position_in_routes: before
8+
:position_in_serializer: before
9+
:position_in_test: before
10+
:classified_sort: true
11+
:exclude_controllers: true
12+
:exclude_factories: false
13+
:exclude_fixtures: false
14+
:exclude_helpers: true
15+
:exclude_scaffolds: true
16+
:exclude_serializers: false
17+
:exclude_sti_subclasses: false
18+
:exclude_tests: false
19+
:force: false
20+
:format_markdown: false
21+
:format_rdoc: false
22+
:format_yard: false
23+
:frozen: false
24+
:ignore_model_sub_dir: false
25+
:ignore_unknown_models: false
26+
:include_version: false
27+
:show_check_constraints: false
28+
:show_complete_foreign_keys: false
29+
:show_foreign_keys: true
30+
:show_indexes: true
31+
:simple_indexes: false
32+
:sort: false
33+
:timestamp: false
34+
:trace: false
35+
:with_comment: true
36+
:with_column_comments: true
37+
:with_table_comments: true
38+
:active_admin: false
39+
:command:
40+
:debug: false
41+
:hide_default_column_types: ''
42+
:hide_limit_column_types: ''
43+
:ignore_columns:
44+
:ignore_routes:
45+
:models: true
46+
:routes: false
47+
:skip_on_db_migrate: false
48+
:target_action: :do_annotations
49+
:wrapper:
50+
:wrapper_close:
51+
:wrapper_open:
52+
:classes_default_to_s: []
53+
:additional_file_patterns: []
54+
:model_dir:
55+
- app/models
56+
:require: []
57+
:root_dir:
58+
- ''

Gemfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ group :development, :test do
5252

5353
gem 'nokogiri', '>= 1.15.6'
5454

55-
gem 'annotate'
55+
gem 'annotaterb'
5656

5757
gem 'rdoc', '>= 6.6.3.1'
5858
end

Gemfile.lock

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,22 +83,20 @@ GEM
8383
securerandom (>= 0.3)
8484
tzinfo (~> 2.0, >= 2.0.5)
8585
uri (>= 0.13.1)
86-
annotate (2.6.5)
87-
activerecord (>= 2.3.0)
88-
rake (>= 0.8.7)
86+
annotaterb (4.14.0)
8987
ast (2.4.2)
9088
base64 (0.2.0)
9189
bcrypt (3.1.20)
9290
benchmark (0.4.0)
93-
bigdecimal (3.1.8)
91+
bigdecimal (3.1.9)
9492
builder (3.3.0)
95-
concurrent-ruby (1.3.4)
96-
connection_pool (2.4.1)
93+
concurrent-ruby (1.3.5)
94+
connection_pool (2.5.3)
9795
crass (1.0.6)
9896
date (3.4.1)
9997
diff-lcs (1.5.1)
10098
docile (1.4.1)
101-
drb (2.2.1)
99+
drb (2.2.3)
102100
dry-cli (1.2.0)
103101
erubi (1.13.0)
104102
factory_bot (6.2.1)
@@ -121,7 +119,7 @@ GEM
121119
railties (>= 3.0.0)
122120
globalid (1.2.1)
123121
activesupport (>= 6.1)
124-
i18n (1.14.6)
122+
i18n (1.14.7)
125123
concurrent-ruby (~> 1.0)
126124
image_processing (1.12.2)
127125
mini_magick (>= 4.9.5, < 5)
@@ -147,7 +145,7 @@ GEM
147145
kaminari-core (= 1.2.2)
148146
kaminari-core (1.2.2)
149147
language_server-protocol (3.17.0.3)
150-
logger (1.6.1)
148+
logger (1.7.0)
151149
loofah (2.23.1)
152150
crass (~> 1.0.2)
153151
nokogiri (>= 1.12.0)
@@ -160,7 +158,7 @@ GEM
160158
marcel (1.0.4)
161159
mini_magick (4.13.2)
162160
mini_mime (1.1.5)
163-
minitest (5.25.2)
161+
minitest (5.25.5)
164162
mutex_m (0.3.0)
165163
net-imap (0.5.8)
166164
date
@@ -304,7 +302,7 @@ GEM
304302
ruby-vips (2.2.2)
305303
ffi (~> 1.12)
306304
logger
307-
securerandom (0.3.2)
305+
securerandom (0.4.1)
308306
simplecov (0.22.0)
309307
docile (~> 1.1)
310308
simplecov-html (~> 0.11)
@@ -323,11 +321,11 @@ GEM
323321
sqlite3 (2.6.0-x86_64-linux-musl)
324322
stringio (3.1.2)
325323
thor (1.3.2)
326-
timeout (0.4.2)
324+
timeout (0.4.3)
327325
tzinfo (2.0.6)
328326
concurrent-ruby (~> 1.0)
329327
unicode-display_width (2.6.0)
330-
uri (1.0.2)
328+
uri (1.0.3)
331329
useragent (0.16.10)
332330
vite_rails (3.0.19)
333331
railties (>= 5.1, < 9)
@@ -361,7 +359,7 @@ PLATFORMS
361359
x86_64-linux-musl
362360

363361
DEPENDENCIES
364-
annotate
362+
annotaterb
365363
bcrypt
366364
factory_bot_rails (~> 6.2.0)
367365
generator_spec

Gemfile.rails_7_2

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,6 @@ group :development, :test do
5959

6060
gem 'nokogiri', '>= 1.15.6'
6161

62-
gem 'annotate'
63-
6462
gem 'rdoc', '>= 6.6.3.1'
6563
end
6664

Gemfile.rails_7_2.lock

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,6 @@ GEM
8383
minitest (>= 5.1)
8484
securerandom (>= 0.3)
8585
tzinfo (~> 2.0, >= 2.0.5)
86-
annotate (3.2.0)
87-
activerecord (>= 3.2, < 8.0)
88-
rake (>= 10.4, < 14.0)
8986
ast (2.4.2)
9087
base64 (0.2.0)
9188
bcrypt (3.1.20)
@@ -362,7 +359,6 @@ PLATFORMS
362359
x86_64-linux-musl
363360

364361
DEPENDENCIES
365-
annotate
366362
bcrypt
367363
factory_bot_rails (~> 6.2.0)
368364
generator_spec

Rakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@ require 'vite_ruby'
2020
ViteRuby.install_tasks
2121
ViteRuby.config.root # Ensure the engine is set as the root.
2222

23-
rakefile_path = Rails::VERSION::MAJOR >= 8 ? 'spec/dummy/Rakefile' : 'spec/legacy_dummy/Rakefile'
23+
rakefile_path = !defined?(Rails) || Rails::VERSION::MAJOR >= 8 ? 'spec/dummy/Rakefile' : 'spec/legacy_dummy/Rakefile'
2424
APP_RAKEFILE = File.expand_path(rakefile_path, __dir__)
25+
2526
load 'rails/tasks/engine.rake'
2627
load 'rails/tasks/statistics.rake'
2728

app/models/maglev/asset.rb

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: maglev_assets
6+
#
7+
# id :bigint not null, primary key
8+
# byte_size :integer
9+
# content_type :string
10+
# filename :string
11+
# height :integer
12+
# width :integer
13+
# created_at :datetime not null
14+
# updated_at :datetime not null
15+
#
316
module Maglev
417
class Asset < ApplicationRecord
518
include ::Maglev.uploader
@@ -26,17 +39,3 @@ def self.search(keyword, type, page = nil, per_page = nil)
2639
end
2740
end
2841
end
29-
30-
# == Schema Information
31-
#
32-
# Table name: maglev_assets
33-
#
34-
# id :bigint not null, primary key
35-
# byte_size :integer
36-
# content_type :string
37-
# filename :string
38-
# height :integer
39-
# width :integer
40-
# created_at :datetime not null
41-
# updated_at :datetime not null
42-
#

app/models/maglev/page.rb

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: maglev_pages
6+
#
7+
# id :bigint not null, primary key
8+
# lock_version :integer
9+
# meta_description_translations :jsonb
10+
# og_description_translations :jsonb
11+
# og_image_url_translations :jsonb
12+
# og_title_translations :jsonb
13+
# sections_translations :jsonb
14+
# seo_title_translations :jsonb
15+
# title_translations :jsonb
16+
# visible :boolean default(TRUE)
17+
# created_at :datetime not null
18+
# updated_at :datetime not null
19+
#
320
module Maglev
421
class Page < ApplicationRecord
522
## concerns ##
@@ -42,21 +59,3 @@ def translate_in(locale, source_locale)
4259
end
4360
end
4461
end
45-
46-
# == Schema Information
47-
#
48-
# Table name: maglev_pages
49-
#
50-
# id :bigint not null, primary key
51-
# lock_version :integer
52-
# meta_description_translations :jsonb
53-
# og_description_translations :jsonb
54-
# og_image_url_translations :jsonb
55-
# og_title_translations :jsonb
56-
# sections_translations :jsonb
57-
# seo_title_translations :jsonb
58-
# title_translations :jsonb
59-
# visible :boolean default(TRUE)
60-
# created_at :datetime not null
61-
# updated_at :datetime not null
62-
#

app/models/maglev/page_path.rb

Lines changed: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: maglev_page_paths
6+
#
7+
# id :bigint not null, primary key
8+
# canonical :boolean default(TRUE)
9+
# locale :string not null
10+
# value :string not null
11+
# maglev_page_id :bigint
12+
#
13+
# Indexes
14+
#
15+
# canonical_speed (canonical,locale,value)
16+
# index_maglev_page_paths_on_maglev_page_id (maglev_page_id)
17+
# scoped_canonical_speed (canonical,maglev_page_id,locale)
18+
#
319
module Maglev
420
class PagePath < ApplicationRecord
521
## associations ##
@@ -44,20 +60,3 @@ def clean_value
4460
end
4561
end
4662
end
47-
48-
# == Schema Information
49-
#
50-
# Table name: maglev_page_paths
51-
#
52-
# id :bigint not null, primary key
53-
# canonical :boolean default(TRUE)
54-
# locale :string not null
55-
# value :string not null
56-
# maglev_page_id :bigint
57-
#
58-
# Indexes
59-
#
60-
# canonical_speed (canonical,locale,value)
61-
# index_maglev_page_paths_on_maglev_page_id (maglev_page_id)
62-
# scoped_canonical_speed (canonical,maglev_page_id,locale)
63-
#

app/models/maglev/site.rb

Lines changed: 13 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,18 @@
11
# frozen_string_literal: true
22

3+
# == Schema Information
4+
#
5+
# Table name: maglev_sites
6+
#
7+
# id :bigint not null, primary key
8+
# locales :jsonb
9+
# lock_version :integer
10+
# name :string
11+
# sections_translations :jsonb
12+
# style :jsonb
13+
# created_at :datetime not null
14+
# updated_at :datetime not null
15+
#
316
module Maglev
417
class Site < ApplicationRecord
518
## concerns ##
@@ -27,27 +40,3 @@ def translate_in(locale, source_locale)
2740
end
2841
end
2942
end
30-
31-
# == Schema Information
32-
#
33-
# Table name: maglev_sites
34-
#
35-
# id :bigint not null, primary key
36-
# domain :string
37-
# handle :string
38-
# locales :jsonb
39-
# lock_version :integer
40-
# name :string
41-
# navigation :jsonb
42-
# sections_translations :jsonb
43-
# siteable_type :string
44-
# style :jsonb
45-
# created_at :datetime not null
46-
# updated_at :datetime not null
47-
# siteable_id :bigint
48-
# theme_id :string
49-
#
50-
# Indexes
51-
#
52-
# index_maglev_sites_on_siteable (siteable_type,siteable_id)
53-
#

app/views/maglev/api/sites/_show.json.jbuilder

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,4 @@ json.locales site.locales
1212
json.call(site, *site.api_attributes)
1313
json.home_page_id home_page_id
1414

15-
json.base_url site.domain ? URI::Generic.build(
16-
scheme: request.protocol.delete('://'),
17-
host: site.domain,
18-
port: request.optional_port
19-
) : nil
20-
2115
json.lock_version site.lock_version

lib/tasks/annotate_rb.rake

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# frozen_string_literal: true
2+
3+
# This rake task was added by annotate_rb gem.
4+
5+
# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
6+
if Rails.env.development? && ENV['ANNOTATERB_SKIP_ON_DB_TASKS'].nil? && Rails::VERSION::MAJOR >= 8
7+
require 'annotate_rb'
8+
9+
AnnotateRb::Core.load_rake_tasks
10+
end

0 commit comments

Comments
 (0)