2013-09-13 21:52:24 +08:00
|
|
|
class HomeworkAttach < ActiveRecord::Base
|
2014-04-09 09:25:24 +08:00
|
|
|
include Redmine::SafeAttributes
|
2013-09-13 21:52:24 +08:00
|
|
|
belongs_to :user
|
|
|
|
belongs_to :bid
|
2014-05-16 11:02:25 +08:00
|
|
|
has_many :journals_for_messages, :as => :jour, :dependent => :destroy
|
|
|
|
seems_rateable :allow_update => true, :dimensions => :quality
|
2013-09-13 21:52:24 +08:00
|
|
|
|
2013-12-19 15:59:10 +08:00
|
|
|
safe_attributes "bid_id",
|
|
|
|
"user_id"
|
2013-09-13 21:52:24 +08:00
|
|
|
acts_as_attachable
|
2014-05-16 11:02:25 +08:00
|
|
|
|
2014-05-17 11:15:27 +08:00
|
|
|
def addjours user_id,message,status = 0
|
|
|
|
jfm = self.journals_for_messages.build(:user_id => user_id,:notes =>message,:status => status)
|
|
|
|
jfm.save
|
|
|
|
jfm
|
|
|
|
end
|
2013-09-13 21:52:24 +08:00
|
|
|
end
|