Module: Scorpion::Rails::ActiveRecord::Relation
Overview
Make sure that all models return by the relation inherit the relation’s scorpion.
Instance Method Summary collapse
-
#spawn ⇒ Object
from ActiveRecord::SpawnMethods.
-
#with_scorpion(scorpion) ⇒ Object
Elect to use a specific scorpion for all further operations in the chain.
Methods included from Method
Methods included from Stinger
Instance Method Details
#spawn ⇒ Object
from ActiveRecord::SpawnMethods
46 47 48 |
# File 'lib/scorpion/rails/active_record/relation.rb', line 46 def spawn sting!( super ) end |
#with_scorpion(scorpion) ⇒ Object
Elect to use a specific scorpion for all further operations in the chain.
26 27 28 29 30 |
# File 'lib/scorpion/rails/active_record/relation.rb', line 26 def with_scorpion( scorpion ) spawn.tap do |other| other.send :scorpion=, scorpion end end |