Module: ActsAsRankedList::ActiveRecord::SkipPersistence::ClassMethods
- Defined in:
- lib/acts_as_ranked_list/active_record/skip_persistence.rb
Class Method Summary collapse
-
.with_skip_persistence(klasses = []) { ... } ⇒ void
Pass a block to this method to prevent persisting
::ActiveRecordupdates and callbacks.
Class Method Details
.with_skip_persistence(klasses = []) { ... } ⇒ void
This method returns an undefined value.
Pass a block to this method to prevent persisting ::ActiveRecord updates and
callbacks. You may pass an array of classes to prevent persisting. These
::ActiveRecord models must include the acts_as_ranked_list concern.
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/acts_as_ranked_list/active_record/skip_persistence.rb', line 25 def with_skip_persistence(klasses = [], &blk) raise ::ArgumentError unless klasses.is_a?(Array) klasses << self raise ::ArgumentError unless active_record_objects?(klasses) SkipPersistence.with_applied_klasses(klasses) do yield end end |