diff --git a/config/application.rb b/config/application.rb index 58756b98..0e9217ac 100644 --- a/config/application.rb +++ b/config/application.rb @@ -13,6 +13,11 @@ module Vellum class Application < Rails::Application + # Observers will not be invoked unless they are instantiated first. If you are + # using Rails, Mongoid will instantiate your observers automatically as long + # as you register them in your config/application.rb file. + config.mongoid.observers = :doc_observer + # Settings in config/environments/* take precedence over those specified here. # Application configuration should go into files in config/initializers # -- all .rb files in that directory are automatically loaded. diff --git a/config/environments/development.rb b/config/environments/development.rb index e9a0b9d5..c952b7f4 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -21,11 +21,4 @@ # Only use best-standards-support built into browsers config.action_dispatch.best_standards_support = :builtin - - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict - - # Log the query plan for queries taking more than this (works - # with SQLite, MySQL, and PostgreSQL) - config.active_record.auto_explain_threshold_in_seconds = 0.5 end diff --git a/config/environments/test.rb b/config/environments/test.rb index bb510480..0168c6a0 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -33,12 +33,6 @@ # This is necessary if your schema can't be completely dumped by the schema dumper, # like if you have constraints or database-specific column types # config.active_record.schema_format = :sql - - # Print deprecation notices to the stderr - config.active_support.deprecation = :stderr - - # Raise exception on mass assignment protection for Active Record models - config.active_record.mass_assignment_sanitizer = :strict # Allow pass debug_assets=true as a query parameter to load pages with unpackaged assets config.assets.allow_debugging = true diff --git a/config/initializers/devise.rb b/config/initializers/devise.rb index c2654ddd..6ea2c905 100644 --- a/config/initializers/devise.rb +++ b/config/initializers/devise.rb @@ -90,7 +90,7 @@ # ==> General configuration # Load and configure the ORM. Supports :active_record (default), :mongoid # (requires mongo_ext installed) and :data_mapper (experimental). - require 'devise/orm/active_record' + require 'devise/orm/mongoid' # Turn scoped views on. Before rendering "sessions/new", it will first check for # "sessions/users/new". It's turned off by default because it's slower if you diff --git a/config/initializers/observers.rb b/config/initializers/observers.rb deleted file mode 100644 index 159f9856..00000000 --- a/config/initializers/observers.rb +++ /dev/null @@ -1 +0,0 @@ -ActiveRecord::Base.observers = :doc_observer \ No newline at end of file