Class: ActiveRecord::ConnectionAdapters::ConnectionHandler::ConnectionDescriptor
- Inherits:
-
Object
- Object
- ActiveRecord::ConnectionAdapters::ConnectionHandler::ConnectionDescriptor
- Defined in:
- lib/active_record/connection_adapters/abstract/connection_handler.rb
Overview
:nodoc:
Instance Method Summary collapse
- #current_preventing_writes ⇒ Object
-
#initialize(name, primary = false) ⇒ ConnectionDescriptor
constructor
A new instance of ConnectionDescriptor.
- #name ⇒ Object
- #primary_class? ⇒ Boolean
Constructor Details
#initialize(name, primary = false) ⇒ ConnectionDescriptor
Returns a new instance of ConnectionDescriptor.
58 59 60 61 |
# File 'lib/active_record/connection_adapters/abstract/connection_handler.rb', line 58 def initialize(name, primary = false) @name = name @primary = primary end |
Instance Method Details
#current_preventing_writes ⇒ Object
71 72 73 |
# File 'lib/active_record/connection_adapters/abstract/connection_handler.rb', line 71 def current_preventing_writes ActiveRecord::Base.preventing_writes?(@name) end |
#name ⇒ Object
63 64 65 |
# File 'lib/active_record/connection_adapters/abstract/connection_handler.rb', line 63 def name primary_class? ? "ActiveRecord::Base" : @name end |
#primary_class? ⇒ Boolean
67 68 69 |
# File 'lib/active_record/connection_adapters/abstract/connection_handler.rb', line 67 def primary_class? @primary end |