Class: GiveAction
- Inherits:
-
Action
- Object
- ActiveRecord::Base
- Action
- GiveAction
show all
- Defined in:
- app/models/actions/give_action.rb
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Action
create_of_type, #default_starred_to_false, for_organization, from_open_struct, #full_details, recent, #set_creator, subtypes_by_type, #to_open_struct, #unstarred?
#destroy, #destroyable?
Class Method Details
.subtypes ⇒ Object
2
3
4
|
# File 'app/models/actions/give_action.rb', line 2
def self.subtypes
["Monetary", "In-Kind"]
end
|
Instance Method Details
#action_type ⇒ Object
10
11
12
|
# File 'app/models/actions/give_action.rb', line 10
def action_type
"Give"
end
|
#editable? ⇒ Boolean
6
7
8
|
# File 'app/models/actions/give_action.rb', line 6
def editable?
subject.try(:editable?)
end
|
#quip ⇒ Object
22
23
24
|
# File 'app/models/actions/give_action.rb', line 22
def quip
"gave us (#{subtype.downcase})"
end
|
#sentence ⇒ Object
18
19
20
|
# File 'app/models/actions/give_action.rb', line 18
def sentence
" contributed to your organization"
end
|
#set_params(params, person) ⇒ Object
26
27
28
29
30
|
# File 'app/models/actions/give_action.rb', line 26
def set_params(params, person)
params ||= {}
self.dollar_amount = params[:dollar_amount]
super(params, person)
end
|
#verb ⇒ Object
14
15
16
|
# File 'app/models/actions/give_action.rb', line 14
def verb
"gave"
end
|