From 9a41869c39323d753c9572c9dd42fcc3044f8d20 Mon Sep 17 00:00:00 2001 From: Viktor Justo Vasquez Date: Sun, 17 May 2015 16:10:50 -0400 Subject: [PATCH] Loads all gem locales files. Fixes #44. When Rails was complaining of a missing error message because the locales where not being loaded correctly. --- lib/date_validator.rb | 1 + lib/date_validator/engine.rb | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 lib/date_validator/engine.rb diff --git a/lib/date_validator.rb b/lib/date_validator.rb index 3a43f76..d54291e 100644 --- a/lib/date_validator.rb +++ b/lib/date_validator.rb @@ -1,5 +1,6 @@ require 'active_model/validations/date_validator' require 'active_support/i18n' +require 'date_validator/engine' if defined?(Rails) # A simple date validator for Rails 3. # diff --git a/lib/date_validator/engine.rb b/lib/date_validator/engine.rb new file mode 100644 index 0000000..8ba1192 --- /dev/null +++ b/lib/date_validator/engine.rb @@ -0,0 +1,5 @@ +module DateValidator + class Engine < Rails::Engine + paths["config/locales"] = 'locales' + end +end