Class: Effective::RegistrarAction

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Model
Defined in:
app/models/effective/registrar_action.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#bad_standing_reasonObject

Bad Standing



13
14
15
# File 'app/models/effective/registrar_action.rb', line 13

def bad_standing_reason
  @bad_standing_reason
end

#category_idObject

Reclassify & Register



19
20
21
# File 'app/models/effective/registrar_action.rb', line 19

def category_id
  @category_id
end

#category_idsObject

Assign



28
29
30
# File 'app/models/effective/registrar_action.rb', line 28

def category_ids
  @category_ids
end

#current_actionObject

Returns the value of attribute current_action.



9
10
11
# File 'app/models/effective/registrar_action.rb', line 9

def current_action
  @current_action
end

#current_userObject

All Actions



8
9
10
# File 'app/models/effective/registrar_action.rb', line 8

def current_user
  @current_user
end

#membership_numberObject

Returns the value of attribute membership_number.



20
21
22
# File 'app/models/effective/registrar_action.rb', line 20

def membership_number
  @membership_number
end

#note_internalObject

Returns the value of attribute note_internal.



35
36
37
# File 'app/models/effective/registrar_action.rb', line 35

def note_internal
  @note_internal
end

#note_to_buyerObject

Returns the value of attribute note_to_buyer.



34
35
36
# File 'app/models/effective/registrar_action.rb', line 34

def note_to_buyer
  @note_to_buyer
end

#ownerObject

Returns the value of attribute owner.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner
  @owner
end

#owner_idObject

Returns the value of attribute owner_id.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner_id
  @owner_id
end

#owner_typeObject

Returns the value of attribute owner_type.



10
11
12
# File 'app/models/effective/registrar_action.rb', line 10

def owner_type
  @owner_type
end

#payment_cardObject

Returns the value of attribute payment_card.



33
34
35
# File 'app/models/effective/registrar_action.rb', line 33

def payment_card
  @payment_card
end

#payment_providerObject

Mark Fees Paid - Order Attributes



32
33
34
# File 'app/models/effective/registrar_action.rb', line 32

def payment_provider
  @payment_provider
end

#skip_feesObject

Returns the value of attribute skip_fees.



21
22
23
# File 'app/models/effective/registrar_action.rb', line 21

def skip_fees
  @skip_fees
end

#status_idObject

Status Change



16
17
18
# File 'app/models/effective/registrar_action.rb', line 16

def status_id
  @status_id
end

#status_idsObject

Returns the value of attribute status_ids.



29
30
31
# File 'app/models/effective/registrar_action.rb', line 29

def status_ids
  @status_ids
end

#status_remove_actionObject

Returns the value of attribute status_remove_action.



25
26
27
# File 'app/models/effective/registrar_action.rb', line 25

def status_remove_action
  @status_remove_action
end

Instance Method Details

#assign!Object



79
80
81
82
# File 'app/models/effective/registrar_action.rb', line 79

def assign!
  update!(current_action: :assign)
  EffectiveMemberships.Registrar.assign!(owner, categories: categories, statuses: statuses, number: number)
end

#bad_standing!Object



89
90
91
92
# File 'app/models/effective/registrar_action.rb', line 89

def bad_standing!
  update!(current_action: :bad_standing)
  EffectiveMemberships.Registrar.bad_standing!(owner, reason: bad_standing_reason)
end

#fees_paid!Object



94
95
96
97
# File 'app/models/effective/registrar_action.rb', line 94

def fees_paid!
  update!(current_action: :fees_paid)
  EffectiveMemberships.Registrar.fees_paid!(owner, order_attributes: order_attributes)
end

#good_standing!Object



84
85
86
87
# File 'app/models/effective/registrar_action.rb', line 84

def good_standing!
  update!(current_action: :good_standing)
  EffectiveMemberships.Registrar.good_standing!(owner)
end

#reclassify!Object



64
65
66
67
# File 'app/models/effective/registrar_action.rb', line 64

def reclassify!
  update!(current_action: :reclassify)
  EffectiveMemberships.Registrar.reclassify!(owner, to: category, skip_fees: skip_fees?)
end

#register!Object



59
60
61
62
# File 'app/models/effective/registrar_action.rb', line 59

def register!
  update!(current_action: :register)
  EffectiveMemberships.Registrar.register!(owner, to: category, status: status, number: number, skip_fees: skip_fees?)
end

#remove!Object



99
100
101
102
# File 'app/models/effective/registrar_action.rb', line 99

def remove!
  update!(current_action: :remove)
  EffectiveMemberships.Registrar.remove!(owner)
end

#save!Object



108
109
110
# File 'app/models/effective/registrar_action.rb', line 108

def save!
  valid? ? true : raise('invalid')
end

#status_change!Object



69
70
71
72
# File 'app/models/effective/registrar_action.rb', line 69

def status_change!
  update!(current_action: :status_change)
  EffectiveMemberships.Registrar.status_change!(owner, to: status)
end

#status_remove!Object



74
75
76
77
# File 'app/models/effective/registrar_action.rb', line 74

def status_remove!
  update!(current_action: :status_remove)
  EffectiveMemberships.Registrar.status_remove!(owner)
end

#to_sObject



55
56
57
# File 'app/models/effective/registrar_action.rb', line 55

def to_s
  'action'
end

#update!(atts) ⇒ Object



104
105
106
# File 'app/models/effective/registrar_action.rb', line 104

def update!(atts)
  assign_attributes(atts); save!
end