in my rails 3 app, I want to define a variable like so:
PERSONAL_DOMAINS = %w[
@126.com
@163.com
@aim.com
@aol.com
]
I then want to be able to use this in user.rb for validations like so:
return true if PERSONAL_DOMAINS.any? { |rule| "@#{domain}".include? rule }
I also want to use it in another model.
Like so:
domain_rules = [PERSONAL_DOMAINS]
domain_rules.each { |rule| return false if !domain.match(rule).nil? }
With Rails, where and how should you define this list of PERSONAL_DOMAINS? YML, config, initializer? And then how do you use it correctly?
Thanks