2009-10-19 02:25:00 +04:00
|
|
|
class TimeEntry < ActiveRecord::Base
|
|
|
|
generator_for(:spent_on) { Date.today }
|
|
|
|
generator_for(:hours) { (rand * 10).round(2) } # 0.01 to 9.99
|
2010-01-27 21:29:03 +03:00
|
|
|
generator_for :user, :method => :generate_user
|
2009-10-19 02:25:00 +04:00
|
|
|
|
2010-01-27 21:29:03 +03:00
|
|
|
def self.generate_user
|
|
|
|
User.generate_with_protected!
|
|
|
|
end
|
|
|
|
|
2009-10-19 02:25:00 +04:00
|
|
|
end
|