Created
August 25, 2016 06:04
-
-
Save naveedkakal/9cd3e9b5809eadea078a71d262632272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
has_many :contacts | |
end | |
class Contact < ActiveRecord::Base | |
end | |
class DomesticContact < Contact | |
validate :us_zip_format_validation | |
private | |
def us_zip_format_validation | |
# errors.add(:zip, 'blah format valid stuff') if (validation_condition) | |
end | |
end | |
class InternationalContact < Contact | |
validate :intl_zip_format_validation | |
private | |
def intl_zip_format_validation | |
# errors.add(:zip, 'blah format valid stuff') if (validation_condition) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment