aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRafael França <rafaelmfranca@gmail.com>2019-04-15 18:11:55 -0400
committerGitHub <noreply@github.com>2019-04-15 18:11:55 -0400
commitfbb8b68403ff8663a561b20746e9da7719eeb83e (patch)
tree37dbbe6f90573b0b1b443a228b70abcdb2b7eea1 /activerecord
parentddf471a163e96e52e1a1cc507bde5a0cfe9f643f (diff)
parent76c1528c5fd372af080081873b1ba02582c51f25 (diff)
downloadrails-fbb8b68403ff8663a561b20746e9da7719eeb83e.tar.gz
rails-fbb8b68403ff8663a561b20746e9da7719eeb83e.tar.bz2
rails-fbb8b68403ff8663a561b20746e9da7719eeb83e.zip
Merge pull request #35977 from prathamesh-sonpatki/rm-required-in-generators
Remove `required: true` from the model generator template
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/lib/rails/generators/active_record/model/templates/model.rb.tt2
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/rails/generators/active_record/model/templates/model.rb.tt b/activerecord/lib/rails/generators/active_record/model/templates/model.rb.tt
index c1c03e2762..77b9ea1c86 100644
--- a/activerecord/lib/rails/generators/active_record/model/templates/model.rb.tt
+++ b/activerecord/lib/rails/generators/active_record/model/templates/model.rb.tt
@@ -1,7 +1,7 @@
<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
<% attributes.select(&:reference?).each do |attribute| -%>
- belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %><%= ', required: true' if attribute.required? %>
+ belongs_to :<%= attribute.name %><%= ', polymorphic: true' if attribute.polymorphic? %>
<% end -%>
<% attributes.select(&:rich_text?).each do |attribute| -%>
has_rich_text :<%= attribute.name %>