Module: EmptyEye::Relation::ClassMethods

Defined in:
lib/empty_eye/relation.rb

Instance Method Summary collapse

Instance Method Details

#delete_all(conditions = nil) ⇒ Object



10
11
12
13
# File 'lib/empty_eye/relation.rb', line 10

def delete_all(conditions = nil)
  return super unless mti_class?
  shard_wrangler.cascade_delete_all(conditions)
end

#update_all(updates, conditions = nil, options = {}) ⇒ Object



15
16
17
18
19
# File 'lib/empty_eye/relation.rb', line 15

def update_all(updates, conditions = nil, options = {})
  return super unless mti_class?
  raise(EmptyEye::InvalidUpdate, "update values for a MTI class must be a hash") unless updates.is_a?(Hash)
  shard_wrangler.cascade_update_all(updates, conditions, options)
end