summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2017-03-24 12:05:54 +0100
committerAzul <azul@riseup.net>2017-03-24 12:05:57 +0100
commitb9f3bb09604974b34f1b301cddaec52df460dabf (patch)
tree8d3e6c9caa7e4ceb2f3cf3ad7806708866c49a70
parent9beeee8aa2d1656e7c80e54137156e7922737aa5 (diff)
bugfix: client_side_validation load order
The Active::Model modules of client side validations only get included in CouchRest::Model::Base if the gems are loaded in the right order: * activemodel is required first so the modules to extend are present * client_side_validations is required next so its modules get included * couchrest_model is required last so it includes the enhanced modules. \
-rw-r--r--config/application.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/config/application.rb b/config/application.rb
index d8e4c82..9534d3e 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -7,6 +7,13 @@ require "action_mailer/railtie"
require "sprockets/railtie"
require "rails/test_unit/railtie"
+# Require gems that depend on a certain load order
+# client_side_validations modules get included only if active_model is loaded.
+# they will only be included in couchrest_model if that is required last.
+require 'active_model'
+require 'client_side_validations'
+require 'couchrest_model'
+
# Require the gems listed in Gemfile, including any gems
# you've limited to :test, :development, or :production.
Bundler.require(*Rails.groups)