diff options
Diffstat (limited to 'railties/lib/rails_generator/generators/components/model/templates/model.rb')
-rw-r--r-- | railties/lib/rails_generator/generators/components/model/templates/model.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/railties/lib/rails_generator/generators/components/model/templates/model.rb b/railties/lib/rails_generator/generators/components/model/templates/model.rb index 8bf93b9e8b..6fcf393bdf 100644 --- a/railties/lib/rails_generator/generators/components/model/templates/model.rb +++ b/railties/lib/rails_generator/generators/components/model/templates/model.rb @@ -1,5 +1,5 @@ class <%= class_name %> < ActiveRecord::Base -<% attributes.select { |a| a.type.to_s == 'references' }.each do |attribute| -%> +<% attributes.select(&:reference?).each do |attribute| -%> belongs_to :<%= attribute.name %> <% end -%> end |