lib/phony_rails.rb in phony_rails-0.0.10 vs lib/phony_rails.rb in phony_rails-0.0.11
- old
+ new
@@ -87,11 +87,11 @@
# Creates a normalized_fax_number method.
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|
- raise ArgumentError, "Attribute #{attribute} was not found on #{self.name} (PhonyRails)" unless self.attribute_method?(attribute)
define_method :"normalized_#{attribute}" do
+ raise ArgumentError, "Attribute #{attribute} was not found on #{self.name} (PhonyRails)" unless self.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