Sha256: a7c2f343f8460600873adcc0c17f23dd556cea676b9b3029be5eead4c5fb4245

Contents?: true

Size: 193 Bytes

Versions: 2

Compression:

Stored size: 193 Bytes

Contents

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

  def slug
    object.name.parameterize('-')
  end

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

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
trax_controller-1.0.0 spec/internal/app/serializers/category_serializer.rb
trax_controller-0.1.4 spec/internal/app/serializers/category_serializer.rb