Skip to content

Commit

Permalink
Restore has_one to generator
Browse files Browse the repository at this point in the history
per rails-api#822 since it was readded in rails-api#725
  • Loading branch information
bf4 committed Jun 25, 2015
1 parent f67fd97 commit 81935c8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/generators/serializer/templates/serializer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ class <%= class_name %>Serializer < <%= parent_class_name %>
attributes <%= attributes_names.map(&:inspect).join(", ") %>
end
<% association_names.each do |attribute| -%>
attribute :<%= attribute %>
has_one :<%= attribute %>
<% end -%>
<% end -%>
2 changes: 1 addition & 1 deletion test/generators/serializer_generator_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ def test_generates_attributes_and_associations
run_generator
assert_file "app/serializers/account_serializer.rb" do |serializer|
assert_match(/^ attributes :id, :name, :description$/, serializer)
assert_match(/^ attribute :business$/, serializer)
assert_match(/^ has_one :business$/, serializer)
end
end

Expand Down

0 comments on commit 81935c8

Please sign in to comment.