Changeset 114
- Timestamp:
- 06/13/08 23:04:14 (5 months ago)
- Location:
- trunk/app/models
- Files:
-
- 9 modified
-
configuration_parameter.rb (modified) (1 diff)
-
deployment.rb (modified) (3 diffs)
-
host.rb (modified) (1 diff)
-
notification.rb (modified) (1 diff)
-
project.rb (modified) (1 diff)
-
recipe.rb (modified) (1 diff)
-
role.rb (modified) (1 diff)
-
stage.rb (modified) (1 diff)
-
user.rb (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/app/models/configuration_parameter.rb
r108 r114 6 6 7 7 before_validation :empty_value_if_deploy_is_set 8 9 tz_time_attributes :created_at, :updated_at10 8 11 9 def validate -
trunk/app/models/deployment.rb
r90 r114 11 11 12 12 attr_accessible :task, :prompt_config, :description, :excluded_host_ids 13 14 tz_time_attributes :created_at, :updated_at, :completed_at 15 13 16 14 # given configuration hash on create in order to satisfy prompt configurations 17 15 attr_accessor :prompt_config … … 78 76 raise 'cannot complete a second time' if self.completed? 79 77 self.success = 0 80 self.completed_at = T zTime.now78 self.completed_at = Time.now 81 79 self.save! 82 80 … … 89 87 raise 'cannot complete a second time' if self.completed? 90 88 self.success = 1 91 self.completed_at = T zTime.now89 self.completed_at = Time.now 92 90 self.save! 93 91 -
trunk/app/models/host.rb
r51 r114 8 8 9 9 attr_accessible :name 10 11 tz_time_attributes :created_at, :updated_at12 10 13 11 before_validation :strip_whitespace -
trunk/app/models/notification.rb
r51 r114 12 12 @recipients = email 13 13 @from = @@webistrano_sender_address 14 @sent_on = T zTime.now14 @sent_on = Time.now 15 15 @headers = {} 16 16 end -
trunk/app/models/project.rb
r51 r114 12 12 13 13 attr_accessible :name, :description, :template 14 15 tz_time_attributes :created_at, :updated_at16 14 17 15 # creates the default configuration parameters based on the template -
trunk/app/models/recipe.rb
r88 r114 8 8 attr_accessible :name, :body, :description 9 9 10 tz_time_attributes :created_at, :updated_at 11 12 13 def validate 14 check_syntax 15 end 10 def validate 11 check_syntax 12 end 16 13 17 14 def check_syntax -
trunk/app/models/role.rb
r51 r114 14 14 15 15 attr_accessor :custom_name 16 17 tz_time_attributes :created_at, :updated_at18 16 19 17 DEFAULT_NAMES = %w(app db www) -
trunk/app/models/stage.rb
r106 r114 12 12 13 13 attr_accessible :name, :alert_emails 14 15 tz_time_attributes :created_at, :updated_at 16 14 17 15 # fake attr (Hash) that hold info why deployment is not possible 18 16 # (think model.errors lite) -
trunk/app/models/user.rb
r51 r114 7 7 8 8 attr_accessible :login, :email, :password, :password_confirmation, :time_zone, :tz 9 composed_of :tz, :class_name => 'TZInfo::Timezone', :mapping => %w( time_zone time_zone )10 9 11 10 validates_presence_of :login, :email … … 18 17 validates_uniqueness_of :login, :email, :case_sensitive => false 19 18 before_save :encrypt_password 20 21 tz_time_attributes :created_at, :updated_at 22 19 23 20 def validate_on_update 24 21 if User.find(self.id).admin? && !self.admin? … … 48 45 49 46 def remember_token? 50 remember_token_expires_at && T zTime.now < remember_token_expires_at47 remember_token_expires_at && Time.now < remember_token_expires_at 51 48 end 52 49 … … 98 95 def encrypt_password 99 96 return if password.blank? 100 self.salt = Digest::SHA1.hexdigest("--#{T zTime.now.to_s}--#{login}--") if new_record?97 self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record? 101 98 self.crypted_password = encrypt(password) 102 99 end
