Class: Rails::DataMapper::Railtie
- Inherits:
-
Railtie
- Object
- Railtie
- Rails::DataMapper::Railtie
- Defined in:
- lib/dm-rails/railtie.rb
Instance Method Summary collapse
-
#configure_data_mapper(app) ⇒ Object
Support overwriting crucial steps in subclasses.
- #setup_controller_runtime(app) ⇒ Object
- #setup_i18n_support(app) ⇒ Object
- #setup_logger(app, logger) ⇒ Object
Instance Method Details
#configure_data_mapper(app) ⇒ Object
Support overwriting crucial steps in subclasses
37 38 39 40 |
# File 'lib/dm-rails/railtie.rb', line 37 def configure_data_mapper(app) app.config.data_mapper.root = Rails.root app.config.data_mapper.raw = app.config.database_configuration end |
#setup_controller_runtime(app) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/dm-rails/railtie.rb', line 47 def setup_controller_runtime(app) require "dm-rails/railties/controller_runtime" ActiveSupport.on_load(:action_controller) do include Rails::DataMapper::Railties::ControllerRuntime end end |
#setup_i18n_support(app) ⇒ Object
42 43 44 45 |
# File 'lib/dm-rails/railtie.rb', line 42 def setup_i18n_support(app) ::DataMapper::Model.append_extensions(::ActiveModel::Translation) ::DataMapper::Model.append_extensions(Rails::DataMapper::I18nSupport) end |
#setup_logger(app, logger) ⇒ Object
54 55 56 |
# File 'lib/dm-rails/railtie.rb', line 54 def setup_logger(app, logger) Rails::DataMapper.setup_logger(logger) end |