Class: Seedy::Users
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Record
#initialize, #inspect, #to_s, #to_sql
Constructor Details
This class inherits a constructor from Seedy::Record
Class Method Details
Instance Method Details
#set_user_name(offset) ⇒ Object
42 43 44 45 |
# File 'lib/seedy/records/users.rb', line 42 def set_user_name(offset) return "user#{offset}" if offset (@attributes[:first_name][0,1] + @attributes[:last_name][0,6]).downcase end |
#update_attributes(offset) ⇒ Object
36 37 38 39 40 |
# File 'lib/seedy/records/users.rb', line 36 def update_attributes(offset) write_attribute(:user_name, set_user_name(offset)) write_attribute(:sugar_login, 0) write_attribute(:user_hash, OpenSSL::Digest::MD5.new("#{offset}")) if offset end |