Merge pull request #822 from bf4/fix_has_one

Replace has_one with attribute in template
This commit is contained in:
Alexandre de Oliveira 2015-03-03 11:13:29 -08:00
commit 32343d4575
2 changed files with 2 additions and 2 deletions

View File

@ -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 -%>

View File

@ -46,7 +46,7 @@ class SerializerGeneratorTest < Rails::Generators::TestCase
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