test/dummy/app/models/category.rb in thermos-0.5.1 vs test/dummy/app/models/category.rb in thermos-0.5.2
- old
+ new
@@ -1,9 +1,13 @@
class Category < ActiveRecord::Base
has_many :category_items
has_many :products, through: :category_items
belongs_to :store
+ def ball?
+ name.match("ball")
+ end
+
def as_json(*args)
{
name: name,
store_name: store.name,
category_items: category_items.map do |item|