Sha256: b3d533be4bb11c10e976b213894b74cee7ab1a244dd10fe6bf06742508911ac0

Contents?: true

Size: 663 Bytes

Versions: 39

Compression:

Stored size: 663 Bytes

Contents

<%- unless omit_comments? -%>
# Serializers define the rendered JSON for a model instance.
# We use jsonapi-rb, which is similar to active_model_serializers.
<%- end -%>
<% module_namespacing do -%>
class Serializable<%= class_name %> < JSONAPI::Serializable::Resource
  type :<%= type %>

  <%- unless omit_comments? -%>
  # Add attributes here to ensure they get rendered, .e.g.
  #
  # attribute :name
  #
  # To customize, pass a block and reference the underlying @object
  # being serialized:
  #
  # attribute :name do
  #   @object.name.upcase
  # end
  <%- end -%>
  <%- attributes.each do |a| -%>
  attribute :<%= a.name %>
  <%- end -%>
end
<% end -%>

Version data entries

39 entries across 39 versions & 1 rubygems

Version Path
jsonapi_compliable-0.11.34 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.33 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.32 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.31 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.30 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.29 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.28 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.27 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.26 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.25 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.24 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.23 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.22 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.21 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.20 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.19 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.18 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.17 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.16 lib/generators/jsonapi/templates/serializer.rb.erb
jsonapi_compliable-0.11.15 lib/generators/jsonapi/templates/serializer.rb.erb