aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-12-16 21:05:03 -0200
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-12-16 21:05:03 -0200
commit7ed68b1611cba1de40d9da02c2325961f28aaeb1 (patch)
treeef2f3341bf9917004c2a5f864e746cc94e5aaaf6 /activerecord
parentdee0053815fccb85b1b8b17ab66c26c9fda6723f (diff)
downloadrails-7ed68b1611cba1de40d9da02c2325961f28aaeb1.tar.gz
rails-7ed68b1611cba1de40d9da02c2325961f28aaeb1.tar.bz2
rails-7ed68b1611cba1de40d9da02c2325961f28aaeb1.zip
Do not define attributes_with_index as a Thor task
All public methods are tasks, so we need to move it to protected visibility.
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/rails/generators/active_record/model/model_generator.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/rails/generators/active_record/model/model_generator.rb b/activerecord/lib/rails/generators/active_record/model/model_generator.rb
index 8cd994ff21..e07f6645f5 100644
--- a/activerecord/lib/rails/generators/active_record/model/model_generator.rb
+++ b/activerecord/lib/rails/generators/active_record/model/model_generator.rb
@@ -29,14 +29,14 @@ module ActiveRecord
template 'module.rb', File.join('app/models', "#{class_path.join('/')}.rb") if behavior == :invoke
end
- def attributes_with_index
- attributes.select { |a| !a.reference? && a.has_index? }
- end
-
hook_for :test_framework
protected
+ def attributes_with_index
+ attributes.select { |a| !a.reference? && a.has_index? }
+ end
+
# Used by the migration template to determine the parent name of the model
def parent_class_name
options[:parent] || determine_default_parent_class