active_model_serializers/lib/generators/serializer/templates/serializer.rb
Benjamin Fleischer 81935c8114 Restore has_one to generator
per #822 since it was readded in #725
2015-06-25 14:00:27 -05:00

9 lines
252 B
Ruby

<% module_namespacing do -%>
class <%= class_name %>Serializer < <%= parent_class_name %>
attributes <%= attributes_names.map(&:inspect).join(", ") %>
end
<% association_names.each do |attribute| -%>
has_one :<%= attribute %>
<% end -%>
<% end -%>