montage_rails 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0fdf2265c4aceb2765f375a9367c1aec3f5ad883
4
- data.tar.gz: dcb225f4c6a96a0e5cf7b8b36ae6ca3fe251230f
3
+ metadata.gz: 2999518b4c7d68341448bba7c57da753d79269e8
4
+ data.tar.gz: 08dd171b9bdcda313d1f6cbb52dd9a451907f9bc
5
5
  SHA512:
6
- metadata.gz: 068568225701fca0b2f70d6c7b6190e4f28f45f9718c6f4c139b7951ec3eec66721c55affcba34a26d4975e5ff08987157483ff60df7f0b7ba0c7318cdb94354
7
- data.tar.gz: fc0987a1e02e6945d8bae774749965accaa9dd1985d466ad2169f3a556039d9c61a6e9120f2c31eaf1f69fd5d499878ab8a9936d80df58d2b0bd1cc128a2d43e
6
+ metadata.gz: cd10c0cd708a9c2d401130b3a14830aa3f6cad442b55c6b237a88dc3932529f413e85a72e4eb27fcaad05eade3f2e70bb2558f464f3043c116c06cfd9e280591
7
+ data.tar.gz: d159afa5bbb03d415ad1afffec08960c0ecb62a87a78f49bd58086d5c2e0534deb00a53099c41c7dc7199fc6a46d54e4613703600f68f2666773363575e50844
@@ -230,39 +230,42 @@ module MontageRails
230
230
  if persisted?
231
231
  @current_method = "Update"
232
232
 
233
- response = notify(self) do
233
+ @response = notify(self) do
234
234
  connection.create_or_update_documents(self.class.table_name, [updateable_attributes(true)])
235
235
  end
236
+
237
+ initialize(attributes_from_response(@response))
236
238
  else
237
- @current_method = "Create"
239
+ run_callbacks :create do
240
+ @current_method = "Create"
238
241
 
239
- response = notify(self) do
240
- connection.create_or_update_documents(self.class.table_name, [updateable_attributes(false)])
241
- end
242
- end
242
+ @response = notify(self) do
243
+ connection.create_or_update_documents(self.class.table_name, [updateable_attributes(false)])
244
+ end
243
245
 
244
- if response.success?
245
- if persisted?
246
- initialize(attributes_from_response(response))
247
- else
248
- run_callbacks :create do
249
- initialize(attributes_from_response(response))
246
+ if @response.success?
247
+ @persisted = true
248
+ initialize(attributes_from_response(@response))
249
+ else
250
+ break
250
251
  end
251
252
  end
252
-
253
- self
254
- else
255
- response
256
253
  end
257
254
  end
255
+
256
+ @response.success?
258
257
  end
259
258
 
260
259
  # The bang method for save, which will raise an exception if saving is not successful
261
260
  #
262
261
  def save!
263
- unless save
262
+ response = save
263
+
264
+ unless response
264
265
  raise MontageAPIError, "There was an error saving your data"
265
266
  end
267
+
268
+ response
266
269
  end
267
270
 
268
271
  # Update the given attributes for the document
@@ -1,3 +1,3 @@
1
1
  module MontageRails
2
- VERSION = "0.4.6"
2
+ VERSION = "0.4.7"
3
3
  end
@@ -1036,3 +1036,41 @@ MontageClient: Checkin connection MontageClient:http://testco.dev.montagehot.clu
1036
1036
  Movie Load (2424.5ms) {:filter=>{:title=>"Star Wars"}, :limit=>1}
1037
1037
  Movie Load (626.4ms) {:filter=>{:title=>"Star Wars"}, :limit=>1, :order_by=>"year", :ordering=>"desc"}
1038
1038
  Movie Load (911.5ms) {:filter=>{:title=>"Star Wars"}, :limit=>1, :order_by=>"year", :ordering=>"desc", :index=>"title"}
1039
+ Movie Load (1306.9ms) {:filter=>{}, :limit=>1}
1040
+ Movie Create (334.0ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>235432, :year=>1996}
1041
+ Movie Create (263.3ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1042
+ Movie Create (263.1ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1043
+ Movie Create (280.4ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1044
+ Movie Create (272.2ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1045
+ Movie Create (239.3ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1046
+ Movie Create (313.7ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1047
+ Movie Create (287.5ms) {:studio_id=>nil, :rank=>1, :rating=>12345, :title=>"Foo", :votes=>600, :year=>1996}
1048
+ Movie Create (433.1ms) {:studio_id=>nil, :rank=>2, :rating=>12333, :title=>"Bar", :votes=>234567, :year=>1998}
1049
+ Movie Update (2587.8ms) : {:id=>nil, :studio_id=>nil, :rank=>2, :rating=>12333, :title=>"Bar", :votes=>600, :year=>1998}
1050
+ Movie Load (635.3ms) {:filter=>{:title=>"Bar"}, :limit=>1}
1051
+ Movie Create (378.5ms) {:studio_id=>nil, :rank=>3, :rating=>123, :title=>"FooBar", :votes=>1234, :year=>1999}
1052
+ Movie Update (353.1ms) 85949f2b-0c35-4906-849a-4e0b4cf557a2: {:id=>"85949f2b-0c35-4906-849a-4e0b4cf557a2", :studio_id=>"", :rank=>3, :rating=>123, :title=>"FooBar", :votes=>600, :year=>1999}
1053
+ Movie Load (351.2ms) {:filter=>{:title=>"FooBar"}, :limit=>1}
1054
+ Movie Create (282.1ms) {:studio_id=>nil, :rank=>4, :rating=>1234, :title=>"Foobared", :votes=>1234, :year=>2000}
1055
+ Movie Update (258.4ms) 555e6c01-5538-41a3-94d3-49c0f67059cc: {:id=>"555e6c01-5538-41a3-94d3-49c0f67059cc", :studio_id=>"", :rank=>4, :rating=>1234, :title=>"Foobared", :votes=>600, :year=>2000}
1056
+ Movie Create (261.9ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 2", :votes=>325445, :year=>2001}
1057
+ Movie Update (264.8ms) 8d30afe2-621c-41ca-a764-d53da0542d23: {:id=>"8d30afe2-621c-41ca-a764-d53da0542d23", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 2", :votes=>600, :year=>2001}
1058
+ Movie Create (281.8ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 3", :votes=>325445, :year=>2001}
1059
+ Movie Update (325.5ms) 2cb2affd-56b3-41db-93c9-e908a8cb1914: {:id=>"2cb2affd-56b3-41db-93c9-e908a8cb1914", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 3", :votes=>600, :year=>2001}
1060
+ Movie Create (342.3ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 4", :votes=>325445, :year=>2001}
1061
+ Movie Update (240.3ms) 06d5d619-4ff8-4fe8-bbc9-c57e0838de45: {:id=>"06d5d619-4ff8-4fe8-bbc9-c57e0838de45", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 4", :votes=>600, :year=>2001}
1062
+ Movie Create (229.0ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 5", :votes=>325445, :year=>2001}
1063
+ Movie Update (275.0ms) 52b16376-12fd-484a-8742-ca5f3a7c8cb8: {:id=>"52b16376-12fd-484a-8742-ca5f3a7c8cb8", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 5", :votes=>600, :year=>2001}
1064
+ Movie Create (250.0ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 6", :votes=>325445, :year=>2001}
1065
+ Movie Update (270.4ms) 4e4af843-83b1-4f28-ae5b-ac2fbcb3d85a: {:id=>"4e4af843-83b1-4f28-ae5b-ac2fbcb3d85a", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 6", :votes=>600, :year=>2001}
1066
+ Movie Create (248.2ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 7", :votes=>325445, :year=>2001}
1067
+ Movie Update (285.8ms) f8c18d87-9f39-4b83-b77d-30bb96643cc6: {:id=>"f8c18d87-9f39-4b83-b77d-30bb96643cc6", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 7", :votes=>600, :year=>2001}
1068
+ Movie Create (242.6ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 8", :votes=>325445, :year=>2001}
1069
+ Movie Update (252.4ms) 572aa2d7-c1be-401d-b873-73bfba967c63: {:id=>"572aa2d7-c1be-401d-b873-73bfba967c63", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 8", :votes=>600, :year=>2001}
1070
+ Movie Create (283.7ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 9", :votes=>325445, :year=>2001}
1071
+ Movie Create (239.9ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 10", :votes=>325445, :year=>2001}
1072
+ Movie Update (342.2ms) 22ff967c-e2aa-4496-9f2c-bea564aa26e9: {:id=>"22ff967c-e2aa-4496-9f2c-bea564aa26e9", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 10", :votes=>600, :year=>2001}
1073
+ Movie Create (252.5ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 11", :votes=>325445, :year=>2001}
1074
+ Movie Update (300.0ms) c36757f5-b535-46c3-97d1-174a497aed41: {:id=>"c36757f5-b535-46c3-97d1-174a497aed41", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 11", :votes=>600, :year=>2001}
1075
+ Movie Create (264.2ms) {:studio_id=>nil, :rank=>5, :rating=>4325, :title=>"Foobared 12", :votes=>325445, :year=>2001}
1076
+ Movie Update (292.0ms) f70e8dbf-b5bc-470e-839a-e1e5e70109ea: {:id=>"f70e8dbf-b5bc-470e-839a-e1e5e70109ea", :studio_id=>"", :rank=>5, :rating=>4325, :title=>"Foobared 12", :votes=>600, :year=>2001}
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: montage_rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.6
4
+ version: 0.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - dphaener
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-15 00:00:00.000000000 Z
11
+ date: 2015-06-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails