Module: FatFreeCRM::Exportable::InstanceMethods

Defined in:
lib/fat_free_crm/exportable.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/fat_free_crm/exportable.rb', line 40

def self.included(base)
  if base.instance_methods.include?(:assignee) or base.instance_methods.include?('assignee')
    define_method :assigned_to_full_name do
      user = self.assignee
      user ? user.full_name : ''
    end
  end

  if base.instance_methods.include?(:completor) or base.instance_methods.include?('completor')
    define_method :completed_by_full_name do
      user = self.completor
      user ? user.full_name : ''
    end
  end
end

Instance Method Details

#user_id_full_nameObject



35
36
37
38
# File 'lib/fat_free_crm/exportable.rb', line 35

def user_id_full_name
  user = self.user
  user ? user.full_name : ''
end