Module: Octopus::Rails2::Persistence
- Defined in:
- lib/octopus/rails2/persistence.rb
Class Method Summary collapse
Instance Method Summary collapse
- #delete_with_octopus ⇒ Object
- #destroy_with_octopus ⇒ Object
- #reload_with_octopus(options = nil) ⇒ Object
Class Method Details
.included(base) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/octopus/rails2/persistence.rb', line 4 def self.included(base) base.instance_eval do alias_method_chain :destroy, :octopus alias_method_chain :delete, :octopus alias_method_chain :reload, :octopus end end |
Instance Method Details
#delete_with_octopus ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/octopus/rails2/persistence.rb', line 12 def delete_with_octopus() if should_set_current_shard? Octopus.using(self.current_shard) { delete_without_octopus() } else delete_without_octopus() end end |