Method: Versioned::ClassMethods#locking!

Defined in:
lib/versioned.rb

#locking!(options = {}) ⇒ Object



50
51
52
53
54
55
56
57
58
59
60
# File 'lib/versioned.rb', line 50

def locking!(options = {})
  include(LockingInstanceMethods)
  class_inheritable_accessor :version_lock_key
  self.version_lock_key = options[:key] || :lock_version
  key self.version_lock_key, Integer

  if self.respond_to?(:version_use_key)
    self.version_use_key = self.version_lock_key
    (self.version_except_columns ||= []) << self.version_lock_key.to_s #don't version the lock key 
  end
end