mirror of
https://github.com/rickbarrette/redmine_qbo.git
synced 2026-10-04 09:10:43 -04:00
Bring Back The Magic
This commit is contained in:
1 parent
cec63b48ef
commit
b4c79b08a2
1 file changed
+18
@@ -90,6 +90,24 @@ class Customer < ActiveRecord::Base
|
||||
@details.notes = s if @details
|
||||
end
|
||||
|
||||
# Magic Method
|
||||
def method_missing(name, *arguments)
|
||||
value = arguments[0]
|
||||
name = name.to_s
|
||||
|
||||
# if the method's name ends with '='
|
||||
if name[-1, 1] == "="
|
||||
method_name = name[0..-2]
|
||||
@details[method_name] = value
|
||||
else
|
||||
begin
|
||||
return @details[name]
|
||||
rescue
|
||||
return nil
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# proforms a bruteforce sync operation
|
||||
# This needs to be simplified
|
||||
def self.sync
|
||||
|
||||
Reference in new issue
Block a user