Skip to content

Commit

Permalink
Merge pull request #822 from bf4/fix_has_one
Browse files Browse the repository at this point in the history
Replace has_one with attribute in template
  • Loading branch information
kurko committed Mar 3, 2015
2 parents 77fb050 + 79653ac commit 32343d4
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| -%>
has_one :<%= attribute %>
attribute :<%= attribute %>
<% end -%>
<% end -%>
2 changes: 1 addition & 1 deletion test/serializers/generators_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,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(/^ has_one :business$/, serializer)
assert_match(/^ attribute :business$/, serializer)
end
end

Expand Down

0 comments on commit 32343d4

Please sign in to comment.