From ddb3dfa92ec0878240211cb2b7a8e125961b1360 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Sat, 5 Jan 2013 23:01:16 +0100 Subject: Moved to GsParemeter.get and set defaults for a couple of validations. --- app/models/conference.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/models/conference.rb') diff --git a/app/models/conference.rb b/app/models/conference.rb index 8be9f21..16b646c 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -15,7 +15,7 @@ class Conference < ActiveRecord::Base validates_presence_of :max_members validates_numericality_of :max_members, :only_integer => true, :greater_than => 0, - :less_than => (MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE + 1), + :less_than => ((GsParameter.get('MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE').nil? ? 10 : GsParameter.get('MAXIMUM_NUMBER_OF_PEOPLE_IN_A_CONFERENCE')) + 1), :allow_nil => false, :allow_blank => false @@ -25,7 +25,7 @@ class Conference < ActiveRecord::Base :greater_than => 0, :allow_nil => true, :allow_blank => true - validates_length_of :pin, :minimum => MINIMUM_PIN_LENGTH, + validates_length_of :pin, :minimum => (GsParameter.get('MINIMUM_PIN_LENGTH').nil? ? 4 : GsParameter.get('MINIMUM_PIN_LENGTH')), :allow_nil => true, :allow_blank => true -- cgit v1.2.3 From 49738b091eea2ca65d6f8c71b88747e314ec2950 Mon Sep 17 00:00:00 2001 From: Stefan Wintermeyer Date: Thu, 10 Jan 2013 22:44:10 +0100 Subject: Refactoring and adding some caches. --- app/models/conference.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/conference.rb') diff --git a/app/models/conference.rb b/app/models/conference.rb index 16b646c..8c5a752 100644 --- a/app/models/conference.rb +++ b/app/models/conference.rb @@ -3,7 +3,7 @@ class Conference < ActiveRecord::Base :open_for_anybody, :max_members, :announce_new_member_by_name, :announce_left_member_by_name - belongs_to :conferenceable, :polymorphic => true + belongs_to :conferenceable, :polymorphic => true, :touch => true has_many :conference_invitees, :dependent => :destroy has_many :phone_numbers, :as => :phone_numberable, :dependent => :destroy -- cgit v1.2.3