active_model_serializers/lib/generators/serializer/templates/serializer.rb
Steve Klabnik 4fc0f679df Add generators.
This seemed like the easiest place to start.
2014-07-05 12:35:29 -04: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 -%>