Module: ActiveRecord::NoTouching::ClassMethods
- Defined in:
- lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/no_touching.rb
Instance Method Summary collapse
-
#no_touching(&block) ⇒ Object
Lets you selectively disable calls to
touch
for the duration of a block.
Instance Method Details
#no_touching(&block) ⇒ Object
Lets you selectively disable calls to touch
for the duration of a block.
Examples
ActiveRecord::Base.no_touching do
Project.first.touch # does nothing
Message.first.touch # does nothing
end
Project.no_touching do
Project.first.touch # does nothing
Message.first.touch # works, but does not touch the associated project
end
23 24 25 |
# File 'lib/rubypitaya/app-template/vendor/bundle/ruby/3.1.0/gems/activerecord-7.0.4/lib/active_record/no_touching.rb', line 23 def no_touching(&block) NoTouching.apply_to(self, &block) end |