Module: FatFreeCRM::Fields::InstanceMethods
- Defined in:
- lib/fat_free_crm/fields.rb
Instance Method Summary
collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_id, *args, &block) ⇒ Object
59
60
61
62
63
64
65
66
67
68
69
70
|
# File 'lib/fat_free_crm/fields.rb', line 59
def method_missing(method_id, *args, &block)
if method_id.to_s =~ /^cf_/
self.class.reset_column_information
object = self.new_record? ? self.class.new : (self.reload && self)
object.respond_to?(method_id) ? object.send(method_id, *args) : nil
else
super
end
end
|
Instance Method Details
#assign_attributes(new_attributes, options = {}) ⇒ Object
50
51
52
53
54
55
56
57
|
# File 'lib/fat_free_crm/fields.rb', line 50
def assign_attributes(new_attributes, options = {})
super
rescue ActiveRecord::UnknownAttributeError
self.class.reset_column_information
super
end
|
#field_groups ⇒ Object
45
46
47
48
|
# File 'lib/fat_free_crm/fields.rb', line 45
def field_groups
field_groups = self.class.field_groups
respond_to?(:tag_ids) ? field_groups.with_tags(tag_ids) : field_groups
end
|