Class: Effective::Representative

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/effective/representative.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#new_representative_user_actionObject

Returns the value of attribute new_representative_user_action.



5
6
7
# File 'app/models/effective/representative.rb', line 5

def new_representative_user_action
  @new_representative_user_action
end

Instance Method Details

#build_organization(attributes = {}) ⇒ Object



52
53
54
55
# File 'app/models/effective/representative.rb', line 52

def build_organization(attributes = {})
  raise('please assign organization_type first') if organization_type.blank?
  self.organization = organization_type.constantize.new(attributes)
end

#build_user(attributes = {}) ⇒ Object



47
48
49
50
# File 'app/models/effective/representative.rb', line 47

def build_user(attributes = {})
  raise('please assign user_type first') if user_type.blank?
  self.user = user_type.constantize.new(attributes)
end

#to_sObject



43
44
45
# File 'app/models/effective/representative.rb', line 43

def to_s
  user.to_s
end