towsta 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/towsta/version.rb +1 -1
- data/lib/towsta/vertical.rb +5 -3
- metadata +2 -2
data/lib/towsta/version.rb
CHANGED
data/lib/towsta/vertical.rb
CHANGED
@@ -70,12 +70,14 @@ module Towsta
|
|
70
70
|
export.delete :vertical
|
71
71
|
id_aux = export.delete(:id)
|
72
72
|
export = {:creator => creator, :vertical => self.class.to_s, :attributes => export, :id => id_aux}
|
73
|
-
uri = URI.parse("http://manager.towsta.com/synchronizers/#{$towsta_secret}/
|
74
|
-
JSON.parse Net::HTTP.post_form(uri, {:code => export.to_json}).body.to_s, :symbolize_names => true
|
73
|
+
uri = URI.parse("http://manager.towsta.com/synchronizers/#{$towsta_secret}/import.json")
|
74
|
+
response = JSON.parse Net::HTTP.post_form(uri, {:code => export.to_json}).body.to_s, :symbolize_names => true
|
75
|
+
self.id = response[:id] if response[:status]
|
76
|
+
response
|
75
77
|
end
|
76
78
|
|
77
79
|
def self.create args
|
78
|
-
self.new(args).save
|
80
|
+
self.new(args.merge(:id => nil)).save
|
79
81
|
end
|
80
82
|
|
81
83
|
def attributes
|