aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYoshiyuki Hirano <yhirano@me.com>2017-12-07 14:46:59 +0900
committerYoshiyuki Hirano <yhirano@me.com>2017-12-07 14:53:53 +0900
commit2fa29037678874b25ad257dff8974055e25c9384 (patch)
treed8cbb415ea474012425c24d2335765471bbd43fa
parent0f8568f58d36a543f9eb423171f42731784b34af (diff)
downloadrails-2fa29037678874b25ad257dff8974055e25c9384.tar.gz
rails-2fa29037678874b25ad257dff8974055e25c9384.tar.bz2
rails-2fa29037678874b25ad257dff8974055e25c9384.zip
[ci skip] Make Todo classes inherit ApplicationRecord
Example codes that use `has_many` or `before_create` in `Module::Concerning` look like active record models. So I've made them inherit `ApplicationRecord`.
-rw-r--r--activesupport/lib/active_support/core_ext/module/concerning.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/concerning.rb b/activesupport/lib/active_support/core_ext/module/concerning.rb
index 370a948eea..800bf213cc 100644
--- a/activesupport/lib/active_support/core_ext/module/concerning.rb
+++ b/activesupport/lib/active_support/core_ext/module/concerning.rb
@@ -22,7 +22,7 @@ class Module
#
# == Using comments:
#
- # class Todo
+ # class Todo < ApplicationRecord
# # Other todo implementation
# # ...
#
@@ -42,7 +42,7 @@ class Module
#
# Noisy syntax.
#
- # class Todo
+ # class Todo < ApplicationRecord
# # Other todo implementation
# # ...
#
@@ -70,7 +70,7 @@ class Module
# increased overhead can be a reasonable tradeoff even if it reduces our
# at-a-glance perception of how things work.
#
- # class Todo
+ # class Todo < ApplicationRecord
# # Other todo implementation
# # ...
#
@@ -82,7 +82,7 @@ class Module
# By quieting the mix-in noise, we arrive at a natural, low-ceremony way to
# separate bite-sized concerns.
#
- # class Todo
+ # class Todo < ApplicationRecord
# # Other todo implementation
# # ...
#
@@ -101,7 +101,7 @@ class Module
# end
#
# Todo.ancestors
- # # => [Todo, Todo::EventTracking, Object]
+ # # => [Todo, Todo::EventTracking, ApplicationRecord, Object]
#
# This small step has some wonderful ripple effects. We can
# * grok the behavior of our class in one glance,