Module: ScopeBuilder::ModelAdditions

Included in:
ActiveRecord::Associations::AssociationProxy, ActiveRecord::Base, ActiveRecord::NamedScope::Scope
Defined in:
lib/scope_builder/model_additions.rb

Instance Method Summary collapse

Instance Method Details

#scope_builder {|builder| ... } ⇒ Object

Yields:

  • (builder)


3
4
5
6
7
# File 'lib/scope_builder/model_additions.rb', line 3

def scope_builder
  builder = Builder.new(scoped({}))
  yield(builder) if block_given?
  builder
end