Module: Switchman::ActiveRecord::Persistence
- Defined in:
- lib/switchman/active_record/persistence.rb
Instance Method Summary collapse
- #delete ⇒ Object
-
#touch ⇒ Object
touch reads the id attribute directly, so it’s not relative to the current shard.
- #update_columns ⇒ Object
Instance Method Details
#delete ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/switchman/active_record/persistence.rb', line 17 def delete db = shard.database_server if ::GuardRail.environment != db.guard_rail_environment return db.unguard { super } else super end end |
#touch ⇒ Object
touch reads the id attribute directly, so it’s not relative to the current shard
7 8 9 |
# File 'lib/switchman/active_record/persistence.rb', line 7 def touch(*, **) shard.activate(self.class.shard_category) { super } end |
#update_columns ⇒ Object
12 13 14 |
# File 'lib/switchman/active_record/persistence.rb', line 12 def update_columns(*) shard.activate(self.class.shard_category) { super } end |