Module: ActiveRecord::DatabaseMutex::ClassMethods
- Defined in:
- lib/active_record/database_mutex.rb
Instance Method Summary collapse
-
#mutex ⇒ ActiveRecord::DatabaseMutex::Implementation
The mutex method returns an instance of ActiveRecord::DatabaseMutex::Implementation that is initialized with the name given by the class and environment variables.
- #mutex_name ⇒ Object
Instance Method Details
#mutex ⇒ ActiveRecord::DatabaseMutex::Implementation
The mutex method returns an instance of ActiveRecord::DatabaseMutex::Implementation that is initialized with the name given by the class and environment variables.
59 60 61 |
# File 'lib/active_record/database_mutex.rb', line 59 def mutex @mutex ||= Implementation.new(name: mutex_name) end |
#mutex_name ⇒ Object
50 51 52 |
# File 'lib/active_record/database_mutex.rb', line 50 def mutex_name @mutex_name ||= [ name, defined?(Rails) ? Rails.env : ENV['RAILS_ENV'] ].compact * ?@ end |