Multiple scope in rails 3.0
问题 I am a beginner in Rails and i have a problem with scope. I have my class with 2 scopes : class Event < ActiveRecord::Base belongs_to :continent belongs_to :event_type scope :continent, lambda { |continent| return if continent.blank? composed_scope = self.scoped composed_scope = composed_scope.where('continent_id IN ( ? )', continent).all return composed_scope } scope :event_type, lambda { |eventType| return if eventType.blank? composed_scope = self.scoped composed_scope = composed_scope