lib/phony_rails.rb in phony_rails-0.0.11 vs lib/phony_rails.rb in phony_rails-0.0.12
- old
+ new
@@ -88,10 +88,10 @@
def phony_normalized_method(*attributes)
options = attributes.last.is_a?(Hash) ? attributes.pop : {}
options.assert_valid_keys :country_code, :default_country_code
attributes.each do |attribute|
define_method :"normalized_#{attribute}" do
- raise ArgumentError, "Attribute #{attribute} was not found on #{self.name} (PhonyRails)" unless self.attribute_method?(attribute)
+ raise ArgumentError, "Attribute #{attribute} was not found on #{self.name} (PhonyRails)" unless self.class.attribute_method?(attribute)
options[:country_code] ||= self.country_code if self.respond_to?(:country_code)
PhonyRails.normalize_number(self[attribute], options)
end
end
end
\ No newline at end of file