Class: AttrMasker::Performer::ActiveRecord
- Defined in:
- lib/attr_masker/performer.rb
Instance Method Summary collapse
- #all_models ⇒ Object
- #dependencies_available? ⇒ Boolean
-
#make_update(instance, updates) ⇒ Object
– rubocop:disable Rails/SkipsModelValidations.
Methods inherited from Base
Instance Method Details
#all_models ⇒ Object
80 81 82 |
# File 'lib/attr_masker/performer.rb', line 80 def all_models ::ActiveRecord::Base.descendants.select(&:table_exists?) end |
#dependencies_available? ⇒ Boolean
76 77 78 |
# File 'lib/attr_masker/performer.rb', line 76 def dependencies_available? defined? ::ActiveRecord end |
#make_update(instance, updates) ⇒ Object
– rubocop:disable Rails/SkipsModelValidations
86 87 88 |
# File 'lib/attr_masker/performer.rb', line 86 def make_update(instance, updates) instance.class.all.unscoped.where(id: instance.id).update_all(updates) end |