Sha256: 4aa4f09d4009c7dc6cf7b0902a3cae5beb7b35ee6ba130582a5966d49c2880ff

Contents?: true

Size: 186 Bytes

Versions: 6

Compression:

Stored size: 186 Bytes

Contents

class CategorySerializer < ::ActiveModel::Serializer
  attributes :name, :slug

  def slug
    name.parameterize('-')
  end

  has_many :products, :serializer => ::ProductSerializer
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
trax_controller-0.1.3 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.1.2 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.1.1 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.1.0 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.0.4 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.0.3 spec/internal/app/serializers/category_serializer.rb