Module: Lyra::StrictDataAccessRelation

Defined in:
lib/lyra/strict_data_access.rb

Overview

Extension for ActiveRecord::Relation to intercept update_all/delete_all on scoped queries. This is needed because Model.where(...).update_all is called on a Relation, not the model class.

Instance Method Summary collapse

Instance Method Details

#delete_all ⇒ Object



209
210
211
212
# File 'lib/lyra/strict_data_access.rb', line 209

def delete_all
  check_strict_mode!(:delete_all)
  super
end

#update_all(updates) ⇒ Object



204
205
206
207
# File 'lib/lyra/strict_data_access.rb', line 204

def update_all(updates)
  check_strict_mode!(:update_all, updates)
  super
end