Sha256: 14ff6a69975ca8ec5113be0d7b4f3bc35e7538d624224ac64e96012dd4e9fe82
Contents?: true
Size: 372 Bytes
Versions: 16
Compression:
Stored size: 372 Bytes
Contents
class Category < ActiveRecord::Base has_many :category_items has_many :products, through: :category_items belongs_to :store def as_json(*args) { name: name, store_name: store.name, category_items: category_items.map do |item| { name: item.name, product_name: item.product.name } end } end end
Version data entries
16 entries across 16 versions & 1 rubygems