use engine of queryutils module in validation for validation const discovery

pull/6827/head
jwollert 14 years ago
parent 71e59313d1
commit c46a111691
  1. 1
      lib/report/query_utils.rb
  2. 9
      lib/report/validation.rb

@ -224,4 +224,5 @@ module Report::QueryUtils
super
klass.extend self
end
end

@ -1,6 +1,6 @@
module Report::Validation
extend ProactiveAutoloader
include Report::QueryUtils
# autoload :Dates, 'report/validation/dates'
# autoload :Integers, 'report/validation/integers'
# autoload :Sql, 'report/validation/sql'
@ -14,7 +14,7 @@ module Report::Validation
def register_validation(val_method)
const_name = val_method.to_s.camelize
begin
val_module = Report::Validation.const_get const_name
val_module = engine::Validation.const_get const_name
singleton_class.send(:include, val_module)
val_method = "validate_" + val_method.to_s.pluralize
if method(val_method)
@ -44,4 +44,9 @@ module Report::Validation
end
end
def self.included(klass)
super
klass.send :include, Report::QueryUtils
end
end

Loading…
Cancel
Save