镜像自地址
https://github.com/redmine/redmine.git
已同步 2024-08-27 17:54:48 +02:00
![Etienne Massip](/assets/img/avatar_default.png)
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7458 e93f8b46-1217-0410-a6f0-8f06a7374b81
10 行
262 B
Ruby
10 行
262 B
Ruby
class TimeEntry < ActiveRecord::Base
|
|
generator_for(:spent_on) { Date.today }
|
|
generator_for(:hours) { (rand * 10).round(2) } # 0.01 to 9.99
|
|
generator_for :user, :method => :generate_user
|
|
|
|
def self.generate_user
|
|
User.generate_with_protected!
|
|
end
|
|
end
|