dynamoid 2.1.0 → 2.2.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c5d8f6269824b26eaae72aa50582f732cf12d32a
4
- data.tar.gz: b2d435682f178120634e816294f9903c205c2a41
3
+ metadata.gz: 542fc1c696af080fcd65a7428ec553584d3fe48d
4
+ data.tar.gz: 93cca063db742ea205238443dcf98ab8e03ba627
5
5
  SHA512:
6
- metadata.gz: 8cda5990c7916d53b5a34fb1c6b66cba13191f51627bd100fb276354e391c73168a7c06b01c27da946b3b164e12b15727ef1f41aa1ebd60b4e17128ce6ab2e4c
7
- data.tar.gz: 821224d319424d6bb75e76b8ba17ed9832a73d9efab46622b6666ab0239c46515b883a37797e3fbec527fec98b0cd09929e5804e81d926d633d4c41bacc4c9ba
6
+ metadata.gz: 438f005ef464d1f90f8e6ba57b3c1b2969e183828e2ad35dcb9fd5db00dea9bc394684ad1787c4c61c6ad23f8a879a933b8a18be3254fc730bc74c1d39b574e9
7
+ data.tar.gz: 905e8db4276d80e280fd95fb56902da845a0aa0eb496c4251d67deff3200436a83fada31f23af341fe490e4576956c9db7e5f9137d58ac53f68e7505addae7d1
data/.travis.yml CHANGED
@@ -15,16 +15,21 @@ gemfile:
15
15
  - gemfiles/rails_4_2.gemfile
16
16
  - gemfiles/rails_5_0.gemfile
17
17
  - gemfiles/rails_5_1.gemfile
18
+ - gemfiles/rails_5_2.gemfile
18
19
  matrix:
19
20
  exclude:
20
21
  - rvm: ruby-2.0.0-p648
21
22
  gemfile: gemfiles/rails_5_0.gemfile
22
23
  - rvm: ruby-2.0.0-p648
23
24
  gemfile: gemfiles/rails_5_1.gemfile
25
+ - rvm: ruby-2.0.0-p648
26
+ gemfile: gemfiles/rails_5_2.gemfile
24
27
  - rvm: ruby-2.1.10
25
28
  gemfile: gemfiles/rails_5_0.gemfile
26
29
  - rvm: ruby-2.1.10
27
30
  gemfile: gemfiles/rails_5_1.gemfile
31
+ - rvm: ruby-2.1.10
32
+ gemfile: gemfiles/rails_5_2.gemfile
28
33
  - rvm: ruby-2.4.1
29
34
  gemfile: gemfiles/rails_4_0.gemfile
30
35
  - rvm: ruby-2.4.1
data/Appraisals CHANGED
@@ -20,3 +20,7 @@ end
20
20
  appraise "rails-5-1" do
21
21
  gem "rails", "~> 5.1.0"
22
22
  end
23
+
24
+ appraise "rails-5-2" do
25
+ gem "rails", "~> 5.2.0"
26
+ end
data/CHANGELOG.md CHANGED
@@ -12,6 +12,20 @@
12
12
 
13
13
  * N/A
14
14
 
15
+ # 2.2.0
16
+
17
+ ## Breaking
18
+
19
+ * N/A
20
+
21
+ ## Improvements
22
+
23
+ * Feature: [#256](https://github.com/Dynamoid/Dynamoid/pull/256) Support Rails 5.2 (@andrykonchin)
24
+
25
+ ## Fixes
26
+
27
+ * Bug: [#255](https://github.com/Dynamoid/Dynamoid/pull/255) Fix Vagrant RVM configuration and upgrade to Ruby 2.4.1 (@richardhsu)
28
+
15
29
  # 2.1.0
16
30
 
17
31
  ## Breaking
@@ -51,7 +65,7 @@
51
65
  Breaking changes in this release generally bring Dynamoid behavior closer to the Rails-way.
52
66
 
53
67
  * Change: [#186](https://github.com/Dynamoid/Dynamoid/pull/186) Consistent behavior for `Model.where({}).all` (@andrykonchin)
54
- * <= 1.3.x behaviour -
68
+ * <= 1.3.x behaviour -
55
69
  * load lazily if user specified batch size
56
70
  * load all collection into memory otherwise
57
71
  * New behaviour -
@@ -85,7 +99,7 @@ Breaking changes in this release generally bring Dynamoid behavior closer to the
85
99
 
86
100
  ## Fixes
87
101
 
88
- * Bug: [#191](https://github.com/Dynamoid/Dynamoid/pull/191), [#192](https://github.com/Dynamoid/Dynamoid/pull/192) Support lambdas as fix for value types were not able to be used as default values (@andrykonchin)(@richardhsu)
102
+ * Bug: [#191](https://github.com/Dynamoid/Dynamoid/pull/191), [#192](https://github.com/Dynamoid/Dynamoid/pull/192) Support lambdas as fix for value types were not able to be used as default values (@andrykonchin)(@richardhsu)
89
103
  * Bug: [#202](https://github.com/Dynamoid/Dynamoid/pull/202) Fix several issues with associations (@andrykonchin)
90
104
  * setting `nil` value raises an exception
91
105
  * document doesn't keep assigned model and loads it from the storage
@@ -95,7 +109,7 @@ Breaking changes in this release generally bring Dynamoid behavior closer to the
95
109
  * Fixed `Chain#key_present?`
96
110
  * Bug: [#205](https://github.com/Dynamoid/Dynamoid/pull/205) Fixed `delete_all` (@andrykonchin)
97
111
  * Fixed exception when makes scan and sort key is declared in model
98
- * Fixed exception when makes scan and any condition is specified in where clause (like Document.where().delete_all)
112
+ * Fixed exception when makes scan and any condition is specified in where clause (like Document.where().delete_all)
99
113
  * Fixed exception when makes query and sort key isn't declared in model
100
114
  * Bug: [#207](https://github.com/Dynamoid/Dynamoid/pull/207) Fixed `#delete` method for case `adapter.delete(table_name, [1, 2, 3], range_key: 1)` (@andrykonchin)
101
115
 
data/Vagrantfile CHANGED
@@ -18,7 +18,7 @@ Vagrant.configure('2') do |config|
18
18
  # Pillars
19
19
  salt.pillar({
20
20
  'ruby' => {
21
- 'version' => '2.3.3',
21
+ 'version' => '2.4.1',
22
22
  }
23
23
  })
24
24
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "pry-byebug", platforms: :ruby
5
6
  gem "rails", "~> 4.0.0"
6
7
  gem "nokogiri", "~> 1.6.8"
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "pry-byebug", platforms: :ruby
5
6
  gem "rails", "~> 4.1.0"
6
7
  gem "nokogiri", "~> 1.6.8"
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "pry-byebug", platforms: :ruby
5
6
  gem "rails", "~> 4.2.0"
6
7
  gem "nokogiri", "~> 1.6.8"
7
8
 
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "pry-byebug", platforms: :ruby
5
6
  gem "rails", "~> 5.0.0"
6
7
 
7
8
  gemspec path: "../"
@@ -2,6 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
+ gem "pry-byebug", platforms: :ruby
5
6
  gem "rails", "~> 5.1.0"
6
7
 
7
8
  gemspec path: "../"
@@ -0,0 +1,8 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pry-byebug", platforms: :ruby
6
+ gem "rails", "~> 5.2.0"
7
+
8
+ gemspec path: "../"
@@ -5,7 +5,7 @@ module Dynamoid
5
5
 
6
6
  module ClassMethods
7
7
  def from_database(*)
8
- super.tap { |d| d.changed_attributes.clear }
8
+ super.tap { |d| d.send(:clear_changes_information) }
9
9
  end
10
10
  end
11
11
 
@@ -28,7 +28,7 @@ module Dynamoid
28
28
  (block_given? ? yield : true).tap do |result|
29
29
  unless result == false # failed validation; nil is OK.
30
30
  @previously_changed = previous
31
- changed_attributes.clear
31
+ clear_changes_information
32
32
  end
33
33
  end
34
34
  end
@@ -43,5 +43,24 @@ module Dynamoid
43
43
  def attribute_method?(attr)
44
44
  super || self.class.attributes.has_key?(attr.to_sym)
45
45
  end
46
+
47
+ if ActiveModel::VERSION::STRING >= '5.2.0'
48
+ # The ActiveModel::Dirty API was changed
49
+ # https://github.com/rails/rails/commit/c3675f50d2e59b7fc173d7b332860c4b1a24a726#diff-aaddd42c7feb0834b1b5c66af69814d3
50
+ # So we just try to disable new functionality
51
+
52
+ def mutations_from_database
53
+ @mutations_from_database ||= ActiveModel::NullMutationTracker.instance
54
+ end
55
+
56
+ def forget_attribute_assignments
57
+ end
58
+ end
59
+
60
+ if ActiveModel::VERSION::STRING < '4.2.0'
61
+ def clear_changes_information
62
+ changed_attributes.clear
63
+ end
64
+ end
46
65
  end
47
66
  end
@@ -1,3 +1,3 @@
1
1
  module Dynamoid
2
- VERSION = '2.1.0'
2
+ VERSION = '2.2.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dynamoid
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Symonds
@@ -21,7 +21,7 @@ authors:
21
21
  autorequire:
22
22
  bindir: exe
23
23
  cert_chain: []
24
- date: 2018-04-21 00:00:00.000000000 Z
24
+ date: 2018-05-02 00:00:00.000000000 Z
25
25
  dependencies:
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: activemodel
@@ -222,6 +222,7 @@ files:
222
222
  - gemfiles/rails_4_2.gemfile
223
223
  - gemfiles/rails_5_0.gemfile
224
224
  - gemfiles/rails_5_1.gemfile
225
+ - gemfiles/rails_5_2.gemfile
225
226
  - lib/dynamoid.rb
226
227
  - lib/dynamoid/adapter.rb
227
228
  - lib/dynamoid/adapter_plugin/aws_sdk_v2.rb