Sha256: 42b44f0f661d5c30f5df36db9cd55621b7d67d439d4c7f28945b787da109e203
Contents?: true
Size: 654 Bytes
Versions: 56
Compression:
Stored size: 654 Bytes
Contents
module Avo module Concerns module CanReplaceItems extend ActiveSupport::Concern included do class_attribute :temporary_items end class_methods do def with_temporary_items(&block) # back-up the previous items self.temporary_items = block end def restore_items_from_backup self.temporary_items = nil end def with_new_items(&block) self.items_holder = Avo::Resources::Items::Holder.new instance_eval(&block) end end def with_new_items(&) self.class.with_new_items(&) end end end end
Version data entries
56 entries across 56 versions & 1 rubygems