Class: GiveAction

Inherits:
Action
  • Object
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?

Methods included from OhNoes::Destroy

#destroy, #destroyable?

Class Method Details

.subtypesObject



2
3
4
# File 'app/models/actions/give_action.rb', line 2

def self.subtypes
  ["Monetary", "In-Kind"]
end

Instance Method Details

#action_typeObject



10
11
12
# File 'app/models/actions/give_action.rb', line 10

def action_type
  "Give"
end

#editable?Boolean

Returns:

  • (Boolean)


6
7
8
# File 'app/models/actions/give_action.rb', line 6

def editable?
  subject.try(:editable?)
end

#quipObject



22
23
24
# File 'app/models/actions/give_action.rb', line 22

def quip
  "gave us (#{subtype.downcase})"
end

#sentenceObject



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

#verbObject



14
15
16
# File 'app/models/actions/give_action.rb', line 14

def verb
  "gave"
end