Changeset 114

Show
Ignore:
Timestamp:
06/13/08 23:04:14 (5 months ago)
Author:
jweiss
Message:

more TimeZone? changes

Location:
trunk/app/models
Files:
9 modified

Legend:

Unmodified
Added
Removed
  • trunk/app/models/configuration_parameter.rb

    r108 r114  
    66   
    77  before_validation :empty_value_if_deploy_is_set 
    8    
    9   tz_time_attributes :created_at, :updated_at 
    108   
    119  def validate 
  • trunk/app/models/deployment.rb

    r90 r114  
    1111   
    1212  attr_accessible :task, :prompt_config, :description, :excluded_host_ids 
    13    
    14   tz_time_attributes :created_at, :updated_at, :completed_at 
    15    
     13     
    1614  # given configuration hash on create in order to satisfy prompt configurations 
    1715  attr_accessor :prompt_config  
     
    7876    raise 'cannot complete a second time' if self.completed? 
    7977    self.success = 0 
    80     self.completed_at = TzTime.now 
     78    self.completed_at = Time.now 
    8179    self.save! 
    8280     
     
    8987    raise 'cannot complete a second time' if self.completed? 
    9088    self.success = 1 
    91     self.completed_at = TzTime.now 
     89    self.completed_at = Time.now 
    9290    self.save! 
    9391     
  • trunk/app/models/host.rb

    r51 r114  
    88   
    99  attr_accessible :name 
    10    
    11   tz_time_attributes :created_at, :updated_at 
    1210   
    1311  before_validation :strip_whitespace 
  • trunk/app/models/notification.rb

    r51 r114  
    1212    @recipients = email 
    1313    @from       = @@webistrano_sender_address 
    14     @sent_on    = TzTime.now 
     14    @sent_on    = Time.now 
    1515    @headers    = {} 
    1616  end 
  • trunk/app/models/project.rb

    r51 r114  
    1212   
    1313  attr_accessible :name, :description, :template 
    14    
    15   tz_time_attributes :created_at, :updated_at 
    1614   
    1715  # creates the default configuration parameters based on the template 
  • trunk/app/models/recipe.rb

    r88 r114  
    88  attr_accessible :name, :body, :description 
    99   
    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 
    1613  
    1714  def check_syntax 
  • trunk/app/models/role.rb

    r51 r114  
    1414   
    1515  attr_accessor :custom_name 
    16    
    17   tz_time_attributes :created_at, :updated_at 
    1816   
    1917  DEFAULT_NAMES = %w(app db www) 
  • trunk/app/models/stage.rb

    r106 r114  
    1212   
    1313  attr_accessible :name, :alert_emails 
    14    
    15   tz_time_attributes :created_at, :updated_at 
    16    
     14 
    1715  # fake attr (Hash) that hold info why deployment is not possible 
    1816  # (think model.errors lite) 
  • trunk/app/models/user.rb

    r51 r114  
    77   
    88  attr_accessible :login, :email, :password, :password_confirmation, :time_zone, :tz 
    9   composed_of :tz, :class_name => 'TZInfo::Timezone', :mapping => %w( time_zone time_zone ) 
    109 
    1110  validates_presence_of     :login, :email 
     
    1817  validates_uniqueness_of   :login, :email, :case_sensitive => false 
    1918  before_save :encrypt_password 
    20    
    21   tz_time_attributes :created_at, :updated_at 
    22    
     19     
    2320  def validate_on_update 
    2421    if User.find(self.id).admin? && !self.admin? 
     
    4845 
    4946  def remember_token? 
    50     remember_token_expires_at && TzTime.now < remember_token_expires_at 
     47    remember_token_expires_at && Time.now < remember_token_expires_at 
    5148  end 
    5249 
     
    9895    def encrypt_password 
    9996      return if password.blank? 
    100       self.salt = Digest::SHA1.hexdigest("--#{TzTime.now.to_s}--#{login}--") if new_record? 
     97      self.salt = Digest::SHA1.hexdigest("--#{Time.now.to_s}--#{login}--") if new_record? 
    10198      self.crypted_password = encrypt(password) 
    10299    end