Skip to content

Commit

Permalink
MONGOID-4885 Use belongs_to instead of embedded_in in model generator
Browse files Browse the repository at this point in the history
  • Loading branch information
p committed May 18, 2020
1 parent 403fff2 commit c674b53
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rails/generators/mongoid/model/templates/model.rb.tt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class <%= class_name %><%= " < #{options[:parent].classify}" if options[:parent]
field :<%= attribute.name %>, type: <%= attribute.type_class %>
<% end -%>
<% attributes.select{|attr| attr.reference? }.each do |attribute| -%>
embedded_in :<%= attribute.name%>
belongs_to :<%= attribute.name%>
<% end -%>
end
<% end -%>

0 comments on commit c674b53

Please sign in to comment.