Skip to content

Commit

Permalink
Trying to fix issue with a customer
Browse files Browse the repository at this point in the history
  • Loading branch information
economysizegeek committed Sep 20, 2012
1 parent efd3116 commit 3272d4a
Show file tree
Hide file tree
Showing 6 changed files with 35 additions and 31 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
insightly (0.2.6)
insightly (0.2.7)
activesupport (> 3)
builder (>= 2.0.0)
i18n (> 0)
Expand Down
34 changes: 18 additions & 16 deletions lib/insightly/address_helper.rb
@@ -1,22 +1,24 @@
module Insightly
module AddressHelper
def addresses
return [] if !@data["ADDRESSES"]
@data["ADDRESSES"].collect {|a| Insightly::Address.build(a)}
end
def addresses=(list)
@data["ADDRESSES"] = list.collect {|a| a.remote_data}
end
def add_address(address)
@data["ADDRESSES"] ||= []
@data["ADDRESSES"].each do |a|
if address.same_address?(Insightly::Address.build(a))
@data["ADDRESSES"] ||= []
@data["ADDRESSES"].collect { |a| Insightly::Address.build(a) }
end

return false
end
end
@data["ADDRESSES"] << address.remote_data
true
end
def addresses=(list)
@data["ADDRESSES"] = list.collect { |a| a.remote_data }
end

def add_address(address)
@data["ADDRESSES"] ||= []
@data["ADDRESSES"].each do |a|
if address.same_address?(Insightly::Address.build(a))

return false
end
end
@data["ADDRESSES"] << address.remote_data
true
end
end
end
24 changes: 13 additions & 11 deletions lib/insightly/contact_info_helper.rb
@@ -1,16 +1,18 @@
module Insightly
module ContactInfoHelper
def contact_infos
return [] if !@data["CONTACTINFOS"]
@data["CONTACTINFOS"].collect {|a| Insightly::ContactInfo.build(a)}
end
def contact_infos=(list)
@data["CONTACTINFOS"] = list.collect {|a| a.remote_data}
end
def add_contact_info(contact_info)
@data["CONTACTINFOS"] ||= []
@data["CONTACTINFOS"] << contact_info.remote_data
true
end
@data["CONTACTINFOS"] ||= []
@data["CONTACTINFOS"].collect { |a| Insightly::ContactInfo.build(a) }
end

def contact_infos=(list)
@data["CONTACTINFOS"] = list.collect { |a| a.remote_data }
end

def add_contact_info(contact_info)
@data["CONTACTINFOS"] ||= []
@data["CONTACTINFOS"] << contact_info.remote_data
true
end
end
end
2 changes: 1 addition & 1 deletion lib/insightly/link_helper.rb
@@ -1,7 +1,7 @@
module Insightly
module LinkHelper
def links
return [] if !@data["LINKS"]
@data["LINKS"] ||= []
@data["LINKS"].collect {|a| Insightly::Link.build(a)}
end
def links=(list)
Expand Down
2 changes: 1 addition & 1 deletion lib/insightly/tag_helper.rb
@@ -1,7 +1,7 @@
module Insightly
module TagHelper
def tags
return [] if !@data["TAGS"]
@data["TAGS"] ||= []
@data["TAGS"].collect {|a| Insightly::Tag.build(a)}
end
def tags=(list)
Expand Down
2 changes: 1 addition & 1 deletion lib/insightly/task_link_helper.rb
@@ -1,7 +1,7 @@
module Insightly
module TaskLinkHelper
def task_links
return [] if !@data["TASKLINKS"]
@data["TASKLINKS"] ||= []
@data["TASKLINKS"].collect {|a| Insightly::TaskLink.build(a)}
end
def task_links=(list)
Expand Down

0 comments on commit 3272d4a

Please sign in to comment.