mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-03 03:40:49 +08:00
init project
This commit is contained in:
24
app/models/bidding_user.rb
Normal file
24
app/models/bidding_user.rb
Normal file
@@ -0,0 +1,24 @@
|
||||
class BiddingUser < ApplicationRecord
|
||||
include AASM
|
||||
|
||||
belongs_to :user
|
||||
belongs_to :project_package, counter_cache: true
|
||||
|
||||
aasm(:status) do
|
||||
state :pending, initial: true
|
||||
state :bidding_won
|
||||
state :bidding_lost
|
||||
|
||||
event :win do
|
||||
transitions from: [:pending], to: :bid_won
|
||||
end
|
||||
|
||||
event :lose do
|
||||
transitions from: [:pending], to: :bid_lost
|
||||
end
|
||||
end
|
||||
|
||||
def status_text
|
||||
I18n.t("bidding_user.status.#{status}")
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user