Sha256: e83f2ccde0db6308d103787f2111b4982407f45a7aa07b90fc87762842640b89

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

<%- module_namespacing do -%>
<%- module_name = class_name.split('::')[0..-2] -%>
<%- if module_name.any? -%>
module <%= class_name.split('::')[0..-2].join('::') %>
<%- end -%>
  class <%= class_name.split('::').last %>Serializer < BaseSerializer
    attributes <%= attributes_names.map(&:inspect).join(", ") %>
  <%- association_names.each do |attribute| -%>
    has_one :<%= attribute %>
  <%- end -%>
  end
<%- if module_name.any? -%>
end
<%- end -%>
<%- end -%>

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
agi_active_model_serializers-0.10.9 lib/generators/rails/templates/serializer.rb.erb
agi_active_model_serializers-0.10.8 lib/generators/rails/templates/serializer.rb.erb
agi_active_model_serializers-0.10.7 lib/generators/rails/templates/serializer.rb.erb