diff options
author | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-22 15:33:06 +0100 |
---|---|---|
committer | Stefan Wintermeyer <stefan.wintermeyer@amooma.de> | 2013-01-22 15:33:06 +0100 |
commit | 39aa7132ceed3d4beab3a9b828e571bbfc67c07e (patch) | |
tree | 6c88289c9f99be0af8635636fcdf64102090e5ec /app/models/hunt_group.rb | |
parent | 5ad8203ce4f1bfea997960d0b52c626dea24b944 (diff) | |
parent | 6f69c1a85055ec7c2515719d79d2a7a4e60cec50 (diff) |
Merge branch 'develop'5.1-beta1
Diffstat (limited to 'app/models/hunt_group.rb')
-rw-r--r-- | app/models/hunt_group.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/app/models/hunt_group.rb b/app/models/hunt_group.rb index 276ae53..5011bf0 100644 --- a/app/models/hunt_group.rb +++ b/app/models/hunt_group.rb @@ -1,24 +1,24 @@ class HuntGroup < ActiveRecord::Base attr_accessible :name, :strategy, :seconds_between_jumps, :phone_numbers_attributes - belongs_to :tenant + belongs_to :tenant, :touch => true has_many :call_forwards, :as => :call_forwardable, :dependent => :destroy validates_uniqueness_of :name, :scope => :tenant_id, :allow_nil => true, :allow_blank => true validates_presence_of :strategy - validates_inclusion_of :strategy, :in => HUNT_GROUP_STRATEGIES + validates_inclusion_of :strategy, :in => (GsParameter.get('HUNT_GROUP_STRATEGIES').nil? ? [] : GsParameter.get('HUNT_GROUP_STRATEGIES')) validates_presence_of :seconds_between_jumps, :if => Proc.new{ |hunt_group| hunt_group.strategy != 'ring_all' } validates_numericality_of :seconds_between_jumps, :only_integer => true, - :greater_than_or_equal_to => VALID_SECONDS_BETWEEN_JUMPS_VALUES.min, - :less_than_or_equal_to => VALID_SECONDS_BETWEEN_JUMPS_VALUES.max, + :greater_than_or_equal_to => (GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES').nil? ? 2 : GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES').min), + :less_than_or_equal_to => (GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES').nil? ? 120 : GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES').max), :if => Proc.new{ |hunt_group| hunt_group.strategy != 'ring_all' } validates_inclusion_of :seconds_between_jumps, - :in => VALID_SECONDS_BETWEEN_JUMPS_VALUES, + :in => (GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES').nil? ? [] : GsParameter.get('VALID_SECONDS_BETWEEN_JUMPS_VALUES')), :if => Proc.new{ |hunt_group| hunt_group.strategy != 'ring_all' } validates_inclusion_of :seconds_between_jumps, :in => [nil], |