aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/generators/rails/serializer/templates/serializer.rb
blob: 30c058c7e96e42c02f3ceb19415d7dd2c4685473 (plain) (blame)
1
2
3
4
5
6
7
8
9
<% module_namespacing do -%>
class <%= class_name %>Serializer < <%= parent_class_name %>
<% if attributes.any? -%>  attributes <%= attributes_names.map(&:inspect).join(", ") %>
<% end -%>
<% association_names.each do |attribute| -%>
  has_one :<%= attribute %>
<% end -%>
end
<% end -%>