diff --git a/app/models/report/operator.rb b/app/models/report/operator.rb index 65461c5cd0..1a05c7f862 100644 --- a/app/models/report/operator.rb +++ b/app/models/report/operator.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 @@ -280,4 +280,4 @@ class Report::Operator # Done with class method definition, let's initialize the operators load -end \ No newline at end of file +end diff --git a/app/models/report/validation.rb b/app/models/report/validation.rb index 4e3655e281..a4d0b7dc96 100644 --- a/app/models/report/validation.rb +++ b/app/models/report/validation.rb @@ -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 @@ -40,4 +40,4 @@ module Report::Validation end end -end \ No newline at end of file +end