fixing warnings

pull/6827/head
Gregor Schmidt 14 years ago
parent fee9b1d0e3
commit 114ea9e561
  1. 4
      app/models/report/operator.rb
  2. 2
      app/models/report/validation.rb

@ -240,9 +240,9 @@ class Report::Operator
validation_methods = values.delete(:validate)
register_validations(validation_methods) unless validation_methods.nil?
values.each do |key, value|
metaclass.class_eval { define_method(key) { value } }
singleton_class.class_eval { define_method(key) { value } }
end
metaclass.class_eval(&block) if block
singleton_class.class_eval(&block) if block
end
def to_operator

@ -9,7 +9,7 @@ module Report::Validation
const_name = val_method.to_s.camelize
begin
val_module = Report::Validation.const_get const_name
metaclass.send(:include, val_module)
singleton_class.send(:include, val_module)
val_method = "validate_" + val_method.to_s.pluralize
if method(val_method)
validations << val_method

Loading…
Cancel
Save