summaryrefslogtreecommitdiff
path: root/app/models/hunt_group.rb
diff options
context:
space:
mode:
authorStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:10:07 +0100
committerStefan Wintermeyer <stefan.wintermeyer@amooma.de>2013-01-05 23:10:07 +0100
commit3862734b5e0833ed108300102c68159e40ffd93a (patch)
tree4491044dbf48aea515303382e7664cf9be2cb182 /app/models/hunt_group.rb
parent380a4cdfe5cfa573fb916ca7c2145a6062ef8198 (diff)
parent57196d838691aeba38ad7e088e83c0881a213861 (diff)
Merge branch 'replace_constants' into develop
Diffstat (limited to 'app/models/hunt_group.rb')
-rw-r--r--app/models/hunt_group.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/hunt_group.rb b/app/models/hunt_group.rb
index 276ae53..184297c 100644
--- a/app/models/hunt_group.rb
+++ b/app/models/hunt_group.rb
@@ -8,17 +8,17 @@ class HuntGroup < ActiveRecord::Base
: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],