summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorblackst0ne <blackst0ne.ru@gmail.com>2018-11-10 13:26:08 +1100
committerblackst0ne <blackst0ne.ru@gmail.com>2018-11-10 13:26:08 +1100
commit9a27d6221bc51c486bc4104f3f813c4c905a7e4a (patch)
treedf31ff39d4082fa12601a031fde39b065989b6f2
parent84797ca06db9b38d24d41771a895630fbebac4d5 (diff)
downloadgitlab-ce-blackst0ne-rails5-update-models-inheritance.tar.gz
[Rails5] Updated docs [ci skip]blackst0ne-rails5-update-models-inheritance
-rw-r--r--doc/development/background_migrations.md8
-rw-r--r--doc/development/feature_flags.md2
-rw-r--r--doc/development/file_storage.md4
-rw-r--r--doc/development/foreign_keys.md4
-rw-r--r--doc/development/instrumentation.md2
-rw-r--r--doc/development/iterating_tables_in_batches.md2
-rw-r--r--doc/development/migration_style_guide.md2
-rw-r--r--doc/development/sha1_as_binary.md2
-rw-r--r--doc/development/what_requires_downtime.md6
-rw-r--r--doc/update/restore_after_failure.md2
10 files changed, 17 insertions, 17 deletions
diff --git a/doc/development/background_migrations.md b/doc/development/background_migrations.md
index bb9a296ef12..8f4a1cd5dd0 100644
--- a/doc/development/background_migrations.md
+++ b/doc/development/background_migrations.md
@@ -162,7 +162,7 @@ class:
```ruby
class Gitlab::BackgroundMigration::ExtractServicesUrl
- class Service < ActiveRecord::Base
+ class Service < ApplicationRecord
self.table_name = 'services'
end
@@ -192,7 +192,7 @@ created and updated services. We can do this using something along the lines of
the following:
```ruby
-class Service < ActiveRecord::Base
+class Service < ApplicationRecord
after_commit :schedule_service_migration, on: :update
after_commit :schedule_service_migration, on: :create
@@ -214,7 +214,7 @@ batches instead of doing this one by one:
class ScheduleExtractServicesUrl < ActiveRecord::Migration
disable_ddl_transaction!
- class Service < ActiveRecord::Base
+ class Service < ApplicationRecord
self.table_name = 'services'
end
@@ -245,7 +245,7 @@ this:
class ConsumeRemainingExtractServicesUrlJobs < ActiveRecord::Migration
disable_ddl_transaction!
- class Service < ActiveRecord::Base
+ class Service < ApplicationRecord
include ::EachBatch
self.table_name = 'services'
diff --git a/doc/development/feature_flags.md b/doc/development/feature_flags.md
index 350593cc813..6e13c1a307f 100644
--- a/doc/development/feature_flags.md
+++ b/doc/development/feature_flags.md
@@ -49,7 +49,7 @@ To use feature gates based on actors, the model needs to respond to
`flipper_id`. For example, to enable for the Foo model:
```ruby
-class Foo < ActiveRecord::Base
+class Foo < ApplicationRecord
include FeatureGate
end
```
diff --git a/doc/development/file_storage.md b/doc/development/file_storage.md
index 6e014e8c751..c05828e54cb 100644
--- a/doc/development/file_storage.md
+++ b/doc/development/file_storage.md
@@ -109,7 +109,7 @@ class SongUploader < GitlabUploader
...
end
-class Thing < ActiveRecord::Base
+class Thing < ApplicationRecord
mount :theme, SongUploader # we have a great theme song!
...
@@ -128,7 +128,7 @@ class SongUploader < GitlabUploader
...
end
-class Thing < ActiveRecord::Base
+class Thing < ApplicationRecord
attr_reader :theme_store # this is an ActiveRecord attribute
mount :theme, SongUploader # we have a great theme song!
diff --git a/doc/development/foreign_keys.md b/doc/development/foreign_keys.md
index 0ab0deb156f..f4af0bb4c75 100644
--- a/doc/development/foreign_keys.md
+++ b/doc/development/foreign_keys.md
@@ -4,7 +4,7 @@ When adding an association to a model you must also add a foreign key. For
example, say you have the following model:
```ruby
-class User < ActiveRecord::Base
+class User < ApplicationRecord
has_many :posts
end
```
@@ -45,7 +45,7 @@ efficient way possible.
In other words, this is bad and should be avoided at all costs:
```ruby
-class User < ActiveRecord::Base
+class User < ApplicationRecord
has_many :posts, dependent: :destroy
end
```
diff --git a/doc/development/instrumentation.md b/doc/development/instrumentation.md
index 7761f65d78a..014fd4583cf 100644
--- a/doc/development/instrumentation.md
+++ b/doc/development/instrumentation.md
@@ -51,7 +51,7 @@ Instrumenting an entire class hierarchy:
```ruby
Gitlab::Metrics::Instrumentation.configure do |conf|
- conf.instrument_class_hierarchy(ActiveRecord::Base)
+ conf.instrument_class_hierarchy(ApplicationRecord)
end
```
diff --git a/doc/development/iterating_tables_in_batches.md b/doc/development/iterating_tables_in_batches.md
index 590c8cbba2d..97460726b6c 100644
--- a/doc/development/iterating_tables_in_batches.md
+++ b/doc/development/iterating_tables_in_batches.md
@@ -16,7 +16,7 @@ To work around this you can include the `EachBatch` module into your models,
then use the `each_batch` class method. For example:
```ruby
-class User < ActiveRecord::Base
+class User < ApplicationRecord
include EachBatch
end
diff --git a/doc/development/migration_style_guide.md b/doc/development/migration_style_guide.md
index 6f31e5b82e5..83f3488cdfb 100644
--- a/doc/development/migration_style_guide.md
+++ b/doc/development/migration_style_guide.md
@@ -371,7 +371,7 @@ migration. For example:
```ruby
class MyMigration < ActiveRecord::Migration
- class Project < ActiveRecord::Base
+ class Project < ApplicationRecord
self.table_name = 'projects'
end
end
diff --git a/doc/development/sha1_as_binary.md b/doc/development/sha1_as_binary.md
index 3151cc29bbc..c3a344355b5 100644
--- a/doc/development/sha1_as_binary.md
+++ b/doc/development/sha1_as_binary.md
@@ -14,7 +14,7 @@ a model and define a SHA attribute using the `sha_attribute` class method. For
example:
```ruby
-class Commit < ActiveRecord::Base
+class Commit < ApplicationRecord
include ShaAttribute
sha_attribute :sha
diff --git a/doc/development/what_requires_downtime.md b/doc/development/what_requires_downtime.md
index b668c9de6a0..5a53890e29a 100644
--- a/doc/development/what_requires_downtime.md
+++ b/doc/development/what_requires_downtime.md
@@ -56,7 +56,7 @@ model, followed by defining the columns to ignore. For example, to ignore
`updated_at` in the User model you'd use the following:
```ruby
-class User < ActiveRecord::Base
+class User < ApplicationRecord
include IgnorableColumn
ignore_column :updated_at
@@ -218,7 +218,7 @@ class ExampleMigration < ActiveRecord::Migration
disable_ddl_transaction!
- class Issue < ActiveRecord::Base
+ class Issue < ApplicationRecord
self.table_name = 'issues'
include EachBatch
@@ -264,7 +264,7 @@ class MigrateRemainingIssuesClosedAt < ActiveRecord::Migration
disable_ddl_transaction!
- class Issue < ActiveRecord::Base
+ class Issue < ApplicationRecord
self.table_name = 'issues'
include EachBatch
end
diff --git a/doc/update/restore_after_failure.md b/doc/update/restore_after_failure.md
index 01c52aae7f5..3d1cf4291a9 100644
--- a/doc/update/restore_after_failure.md
+++ b/doc/update/restore_after_failure.md
@@ -73,7 +73,7 @@ sudo gitlab-rails console
At the Rails console, type the following commands:
```
-ActiveRecord::Base.connection.execute("INSERT INTO schema_migrations (version) VALUES('20151103134857')")
+ApplicationRecord.connection.execute("INSERT INTO schema_migrations (version) VALUES('20151103134857')")
exit
```