sunstone 5.0.0.8 → 5.0.1.0

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: e625be1b21ec0433b462e4e6c3d625763d7b9cd0
4
- data.tar.gz: f4899f01b57055453a433b693e35e946cdd63d54
3
+ metadata.gz: 49ec91e7217f1050f6ca55bc4cdf7346244f7886
4
+ data.tar.gz: f184988c933bc517712d638916b4b4b17f5861b8
5
5
  SHA512:
6
- metadata.gz: 732274fec9d832b6acec66c3d926922078487f969d5b9886b46d5785fc63d965d1c369209f9783319744b63a20a1a0b1dbe8f535659b3a6dc0726a68c1ce3aa0
7
- data.tar.gz: c96b7fc36364bb188ff6a3d0c0c1f24075fa8bff1bfe749cb658c48187476c7c7e1f2a003dddc4be9a67605d10c4d4d18637f73c577b3108f9827977de146261
6
+ metadata.gz: a2a8515d5e3ba1297b180e1b56ba243584e8d92f0d61ef86c2807e3cbacad13908380c4421e12a31e482808d041259692b3718b9b915663d63bf22d31243c83d
7
+ data.tar.gz: a342d7f74b6a8792828861893d53a6caac544fb0d22a62cb3c440f67ea08e8ff69c6fc0b1d93cfd44b2b030501685f6d30b619f0012a269d7be740c16ddac4ea
@@ -2,11 +2,12 @@ language: ruby
2
2
 
3
3
  rvm:
4
4
  - 2.3.1
5
+ - 2.4.0
5
6
 
6
7
  env:
7
8
  - RAILS_VERSION=v5.0.0
8
9
  - RAILS_VERSION=v5.0.0.1
9
- - RAILS_VERSION=v5.0.1.rc2
10
+ - RAILS_VERSION=v5.0.1
10
11
 
11
12
  cache:
12
13
  bundler: true
@@ -8,31 +8,30 @@ module ActiveRecord
8
8
 
9
9
  if owner.new_record?
10
10
  replace_records(other_array, original_target)
11
- elsif owner.class.connection.is_a?(ActiveRecord::ConnectionAdapters::SunstoneAPIAdapter) && owner.instance_variable_defined?(:@updating) && owner.instance_variable_get(:@updating)
11
+ else
12
12
  replace_common_records_in_memory(other_array, original_target)
13
+ if owner.class.connection.is_a?(ActiveRecord::ConnectionAdapters::SunstoneAPIAdapter) && owner.instance_variable_defined?(:@updating) && owner.instance_variable_get(:@updating)
14
+ # Remove from target
15
+ (original_target - other_array).each { |record| callback(:before_remove, record) }
16
+ (original_target - other_array).each { |record| target.delete(record) }
17
+ (original_target - other_array).each { |record| callback(:after_remove, record) }
13
18
 
14
- # Remove from target
15
- (original_target - other_array).each { |record| callback(:before_remove, record) }
16
- (original_target - other_array).each { |record| target.delete(record) }
17
- (original_target - other_array).each { |record| callback(:after_remove, record) }
18
-
19
- # Add to target
20
- (other_array - original_target).each do |record|
21
- add_to_target(record)
22
- end
19
+ # Add to target
20
+ (other_array - original_target).each do |record|
21
+ add_to_target(record)
22
+ end
23
23
 
24
- other_array
25
- else
26
- replace_common_records_in_memory(other_array, original_target)
27
- if other_array != original_target
28
- transaction { replace_records(other_array, original_target) }
29
- else
30
24
  other_array
25
+ else
26
+ if other_array != original_target
27
+ transaction { replace_records(other_array, original_target) }
28
+ else
29
+ other_array
30
+ end
31
31
  end
32
32
  end
33
33
  end
34
34
 
35
-
36
35
  end
37
36
 
38
37
  class HasManyAssociation
@@ -3,14 +3,14 @@ module ActiveRecord
3
3
 
4
4
  def pluck(*column_names)
5
5
  if loaded? && (column_names.map(&:to_s) - @klass.attribute_names - @klass.attribute_aliases.keys).empty?
6
- return @records.pluck(*column_names)
6
+ return records.pluck(*column_names)
7
7
  end
8
8
 
9
9
  if has_include?(column_names.first)
10
10
  construct_relation_for_association_calculations.pluck(*column_names)
11
11
  elsif klass.connection.is_a?(ActiveRecord::ConnectionAdapters::SunstoneAPIAdapter)
12
12
  load
13
- return @records.pluck(*column_names.map{|n| n.sub(/^#{klass.table_name}\./, "")})
13
+ return records.pluck(*column_names.map{|n| n.sub(/^#{klass.table_name}\./, "")})
14
14
  else
15
15
  relation = spawn
16
16
  relation.select_values = column_names.map { |cn|
@@ -1,3 +1,3 @@
1
1
  module Sunstone
2
- VERSION = '5.0.0.8'
2
+ VERSION = '5.0.1.0'
3
3
  end
@@ -34,5 +34,5 @@ Gem::Specification.new do |s|
34
34
  s.add_runtime_dependency 'msgpack'
35
35
  s.add_runtime_dependency 'cookie_store'
36
36
  s.add_runtime_dependency 'arel', '~> 7.0'
37
- s.add_runtime_dependency 'activerecord', '~> 5.0.0'
37
+ s.add_runtime_dependency 'activerecord', '~> 5.0.1'
38
38
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.0.0.8
4
+ version: 5.0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-20 00:00:00.000000000 Z
11
+ date: 2017-01-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -254,14 +254,14 @@ dependencies:
254
254
  requirements:
255
255
  - - "~>"
256
256
  - !ruby/object:Gem::Version
257
- version: 5.0.0
257
+ version: 5.0.1
258
258
  type: :runtime
259
259
  prerelease: false
260
260
  version_requirements: !ruby/object:Gem::Requirement
261
261
  requirements:
262
262
  - - "~>"
263
263
  - !ruby/object:Gem::Version
264
- version: 5.0.0
264
+ version: 5.0.1
265
265
  description: A library for interacting with REST APIs. Similar to ActiveResource
266
266
  email:
267
267
  - jonbracy@gmail.com
@@ -344,7 +344,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
344
344
  version: '0'
345
345
  requirements: []
346
346
  rubyforge_project:
347
- rubygems_version: 2.5.1
347
+ rubygems_version: 2.6.8
348
348
  signing_key:
349
349
  specification_version: 4
350
350
  summary: A library for interacting with REST APIs