Module: ActiveRecord::Blockwhere
- Defined in:
- lib/active_record/blockwhere.rb,
lib/active_record/blockwhere/version.rb,
lib/active_record/blockwhere/where_proxy.rb,
lib/active_record/blockwhere/arel_node_operations.rb
Defined Under Namespace
Modules: ArelNodeOperations Classes: WhereProxy
Constant Summary collapse
- VERSION =
"1.0.1"
Instance Method Summary collapse
Instance Method Details
#where(*args) ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/active_record/blockwhere.rb', line 6 def where(*args) relation = args.empty? ? self : super(*args) if block_given? block = Proc.new relation = WhereProxy.where(relation, block.binding.eval('self'), &block) end relation end |