Skip to content

Instantly share code, notes, and snippets.

@unstablereality
Created January 14, 2014 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save unstablereality/8419246 to your computer and use it in GitHub Desktop.
Save unstablereality/8419246 to your computer and use it in GitHub Desktop.
class FranchiseeRequest < ActiveRecord:: Base
attr_accessor :skip_region_validation
attr_accessor :skip_region_validation, as: :import
validate :expanding_into_region, unless: :skip_region_validation
def expanding_into_region
raise error if franchise is not expanding into current region
end
def skip_region_validation
self.franchisee.region_code == "n/a"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment