g5_integrations_updatable 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dc4ab58cc731a0499813141b08c10094c84c75fb
4
- data.tar.gz: 9a4d46236ac55bbba14012369e2aaa7c8ce253ec
3
+ metadata.gz: 47def5f9c16fa817e5fe58bc04c5be9c5c22fa4b
4
+ data.tar.gz: 7cd3163b7a6cb8233db851493da5a776655216bd
5
5
  SHA512:
6
- metadata.gz: af559915089eabd08b6c6230e07822194e77835afa5ebbaa94e1e70c328856dd4bd4d08d34c79fc934defd3d29d05c5b3ea7a2da80c9459dff8a8cd2413389c0
7
- data.tar.gz: ebde961bb01735edc4731548f7f1891c0641a78fc5151e2616308fbc1ec75b4ba400b7e19c63d0c002bfe502dd9be2ee84db343041547f63214119842103db38
6
+ metadata.gz: f8433b801aff53f798c4edc9413224604c9773b3189279a4aca77f09dc8554ab69487bfb8c1a37148d16d2c73b527d0344de782951010a937c93e2c258f9018a
7
+ data.tar.gz: 32185adb93d6be3117e0120329e2462bbb489161e545f72a20100bd55fd9cf1e11d7a1c434e6b9556800c68f65d00ceeb152e30f73980da93d50ec4dac1becbe
@@ -9,7 +9,15 @@ module G5IntegrationsUpdatable
9
9
  class << self
10
10
  def load_all_settings(all_uri)
11
11
  result_hash = G5IntegrationsUpdatable::FeedFetcher.new(all_uri).process
12
- find_or_create_all result_hash
12
+ G5IntegrationsUpdatable::LocationSetting.transaction do
13
+ destroy_existing result_hash
14
+ find_or_create_all result_hash
15
+ end
16
+ end
17
+
18
+ def destroy_existing(feed_array)
19
+ existing = G5IntegrationsUpdatable::LocationSetting.where(client_urn: feed_array.collect { |feed| feed['client_urn'] })
20
+ existing.destroy_all
13
21
  end
14
22
 
15
23
  def find_or_create_all(feed_array)
@@ -1,3 +1,3 @@
1
1
  module G5IntegrationsUpdatable
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: g5_integrations_updatable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.7
4
+ version: 0.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Perry Hertler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-17 00:00:00.000000000 Z
11
+ date: 2015-01-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails