sunstone 5.0.0.8 → 5.0.1.0
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 +4 -4
- data/.travis.yml +2 -1
- data/ext/active_record/associations/collection_association.rb +16 -17
- data/ext/active_record/relation/calculations.rb +2 -2
- data/lib/sunstone/version.rb +1 -1
- data/sunstone.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49ec91e7217f1050f6ca55bc4cdf7346244f7886
|
4
|
+
data.tar.gz: f184988c933bc517712d638916b4b4b17f5861b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a2a8515d5e3ba1297b180e1b56ba243584e8d92f0d61ef86c2807e3cbacad13908380c4421e12a31e482808d041259692b3718b9b915663d63bf22d31243c83d
|
7
|
+
data.tar.gz: a342d7f74b6a8792828861893d53a6caac544fb0d22a62cb3c440f67ea08e8ff69c6fc0b1d93cfd44b2b030501685f6d30b619f0012a269d7be740c16ddac4ea
|
data/.travis.yml
CHANGED
@@ -8,31 +8,30 @@ module ActiveRecord
|
|
8
8
|
|
9
9
|
if owner.new_record?
|
10
10
|
replace_records(other_array, original_target)
|
11
|
-
|
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
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
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
|
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
|
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|
|
data/lib/sunstone/version.rb
CHANGED
data/sunstone.gemspec
CHANGED
@@ -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.
|
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
|
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:
|
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.
|
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.
|
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.
|
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
|