Module: BabySqueel::ActiveRecord::WhereChain

Defined in:
lib/baby_squeel/active_record/where_chain.rb

Instance Method Summary collapse

Instance Method Details

#has(&block) ⇒ Object

Constructs Arel for ActiveRecord::Base#where using the DSL.



7
8
9
10
11
# File 'lib/baby_squeel/active_record/where_chain.rb', line 7

def has(&block)
  arel = DSL.evaluate(@scope, &block)
  @scope.where!(arel) unless arel.blank?
  @scope
end