Class: Rails::DataMapper::Configuration
- Inherits:
-
Object
- Object
- Rails::DataMapper::Configuration
- Defined in:
- lib/dm-rails/configuration.rb
Instance Attribute Summary collapse
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#root ⇒ Object
Returns the value of attribute root.
Class Method Summary collapse
Instance Method Summary collapse
- #environments ⇒ Object
- #field_naming_convention ⇒ Object
- #repositories ⇒ Object
- #resource_naming_convention ⇒ Object
Instance Attribute Details
#raw ⇒ Object
Returns the value of attribute raw.
11 12 13 |
# File 'lib/dm-rails/configuration.rb', line 11 def raw @raw end |
#root ⇒ Object
Returns the value of attribute root.
12 13 14 |
# File 'lib/dm-rails/configuration.rb', line 12 def root @root end |
Class Method Details
.create ⇒ Object
14 15 16 |
# File 'lib/dm-rails/configuration.rb', line 14 def self.create Rails::DataMapper.configuration ||= new end |
Instance Method Details
#environments ⇒ Object
18 19 20 |
# File 'lib/dm-rails/configuration.rb', line 18 def environments raw.keys end |
#field_naming_convention ⇒ Object
38 39 40 |
# File 'lib/dm-rails/configuration.rb', line 38 def field_naming_convention @field_naming_convention ||= {} end |
#repositories ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/dm-rails/configuration.rb', line 22 def repositories @repositories ||= raw.reject { |k,v| k =~ /defaults/ }.inject({}) do |repositories, pair| environment, config = pair.first, pair.last repositories[environment] = begin c = config['repositories'] || {} c['default'] = config.except('repositories') if config.except('repositories') normalize_repository_config(c) end repositories end end |
#resource_naming_convention ⇒ Object
34 35 36 |
# File 'lib/dm-rails/configuration.rb', line 34 def resource_naming_convention @resource_naming_convention ||= {} end |