Closed locochris closed 8 years ago
Validate global phone numbers in Rails 3.x and ActiveModel.
class Person < ActiveRecord::Base validates :home_phone, :global_phone => true end Person.new(home_phone: '+61 3 9876 0010').valid? # => true class User < ActiveRecord::Base validates :work_phone, :global_phone => { :using => :work_country_code } def work_country_code 'AU' end end User.new(work_phone: '03 9876 0010').valid? # => true
Sorry, but I don't think AR/AM specific code belongs in this gem.
Thanks for the PR :+1: I agree with Josh, this gem is meant to pure Ruby and not have dependencies on Rails so I'm going to close this.
Validate global phone numbers in Rails 3.x and ActiveModel.