add courier info
This commit is contained in:
parent
792a7fed1c
commit
30e70cc5d6
10 changed files with 146 additions and 95 deletions
|
|
@ -5,7 +5,10 @@ class Sponsor < ActiveRecord::Base
|
|||
belongs_to :conference
|
||||
|
||||
serialize :swags, Hash
|
||||
attr_accessor :type, :quantity, :swag_index, :hint_hash
|
||||
serialize :courier_info, Hash
|
||||
|
||||
attr_accessor :type, :quantity, :swag_index, :courier_index,
|
||||
:courier_name, :tracking_number, :boxes
|
||||
|
||||
has_paper_trail ignore: [:updated_at], meta: { conference_id: :conference_id }
|
||||
|
||||
|
|
@ -14,19 +17,19 @@ class Sponsor < ActiveRecord::Base
|
|||
validates :name, :website_url, :sponsorship_level, presence: true
|
||||
|
||||
scope :confirmed, -> { where(state: 'confirmed') }
|
||||
scope :unconfirmed, -> { where(state: 'uncofirmed') }
|
||||
scope :unconfirmed, -> { where(state: 'unconfirmed') }
|
||||
|
||||
state_machine initial: :uncofirmed do
|
||||
state :uncofirmed
|
||||
state_machine initial: :unconfirmed do
|
||||
state :unconfirmed
|
||||
state :confirmed
|
||||
|
||||
|
||||
event :confirm do
|
||||
transitions to: :confirmed, from: [:uncofirmed]
|
||||
transitions to: :confirmed, from: [:unconfirmed]
|
||||
end
|
||||
|
||||
event :cancel do
|
||||
transitions to: :uncofirmed, from: [:confirmed]
|
||||
transitions to: :unconfirmed, from: [:confirmed]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue