I need to combine name scope with or operator...
Something like:
class Product < ActiveRecord::Base
belongs_to :client
scope :name_a, where("products.name = 'a'")
scope :client_b, joins(:client).where("clients.name = 'b'")
scope :name_a_or_b, name_a.or(client_b)
end
Thx
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…