active_data 1.1.4 → 1.1.5

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
  SHA256:
3
- metadata.gz: 8fd00914914806d951a6e19e1927d9256d681c3af5b2125b67e06b3d90ad368f
4
- data.tar.gz: ceeb1a7d53206a65d045d7a46017d261a0d872aa384bdebc7f11f4500861226d
3
+ metadata.gz: 1c1d3b2c3318d731085fd9a76ef956e1d9fe4b52877b21384acb02e146c2408d
4
+ data.tar.gz: d95da2f65fd5a789369359e3787afd4f380f29e4a5e87afb599bcaff80fe57bf
5
5
  SHA512:
6
- metadata.gz: 995f37a727c0815e131189133c31a8bb767f7001fecef437305e81723c11ec25f54884cc50411fb34e53d213fb7482298af8ac2d576e51da68044fb2deb287e5
7
- data.tar.gz: e9609fb34fba1628e4bc3d341378c2fea985fa021b2463ed61d5f9b2b9ae997315d07a54de516402459b2dc51dffc66076f1e64a492021895b507c3770330d58
6
+ metadata.gz: 9d31b3015091e0d535d80e835d6f05e10526c5f4173b57c0d7c5b771d1b823109abb7e33fbb081d2fc1940c15916a6904221c2c9ec96c0014532af664d2b2ce3
7
+ data.tar.gz: 7c825f0e284920b89ee85faa0a2e56dd11199ae3a3cc55b6aff902695e2214326ee273fb1005395c9181522a019cfe7e12fdd32d7d83b80cb5a0c651734a2f0c
@@ -1,32 +1,15 @@
1
1
  sudo: false
2
2
 
3
- rvm:
4
- - 2.2.10
5
- - 2.3.7
6
- - 2.4.4
7
- - rbx
8
-
9
- gemfile:
10
- - gemfiles/rails.4.0.gemfile
11
- - gemfiles/rails.4.1.gemfile
12
- - gemfiles/rails.4.2.gemfile
13
- - gemfiles/rails.5.0.gemfile
14
- - gemfiles/rails.5.1.gemfile
15
- - gemfiles/rails.5.2.gemfile
16
-
17
3
  matrix:
18
- allow_failures:
19
- - rvm: rbx
20
- exclude:
21
- - rvm: 2.4.4
22
- gemfile: gemfiles/rails.4.0.gemfile
23
- - rvm: 2.4.4
24
- gemfile: gemfiles/rails.4.1.gemfile
25
- - rvm: 2.4.4
4
+ include:
5
+ - rvm: 2.3.8
26
6
  gemfile: gemfiles/rails.4.2.gemfile
27
-
28
- before_install:
29
- - gem update --system --no-doc
7
+ - rvm: 2.4.7
8
+ gemfile: gemfiles/rails.5.1.gemfile
9
+ - rvm: 2.5.6
10
+ gemfile: gemfiles/rails.5.2.gemfile
11
+ - rvm: 2.6.4
12
+ gemfile: gemfiles/rails.6.0.gemfile
30
13
 
31
14
  script:
32
15
  - bundle exec rspec
data/Appraisals CHANGED
@@ -1,7 +1,8 @@
1
- %w[4.0 4.1 4.2 5.0 5.1 5.2].each do |version|
1
+ %w[4.2 5.1 5.2 6.0].each do |version|
2
2
  appraise "rails.#{version}" do
3
3
  gem 'activesupport', "~> #{version}.0"
4
4
  gem 'activemodel', "~> #{version}.0"
5
5
  gem 'activerecord', "~> #{version}.0"
6
+ gem 'sqlite3', '~> 1.3.6' if version < '6.0'
6
7
  end
7
8
  end
@@ -1,5 +1,9 @@
1
1
  # master
2
2
 
3
+ # Version 1.1.5
4
+
5
+ * Rails 6 support (#70, #71)
6
+
3
7
  # Version 1.1.4
4
8
 
5
9
  ## Changes
@@ -21,7 +21,6 @@ Gem::Specification.new do |gem|
21
21
  gem.add_development_dependency 'rspec', '~> 3.7.0'
22
22
  gem.add_development_dependency 'rspec-its'
23
23
  gem.add_development_dependency 'rubocop', '0.52.1'
24
- gem.add_development_dependency 'rubysl', '~> 2.0' if RUBY_ENGINE == 'rbx'
25
24
  gem.add_development_dependency 'sqlite3'
26
25
  gem.add_development_dependency 'uuidtools'
27
26
 
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activesupport", "~> 4.2.0"
6
6
  gem "activemodel", "~> 4.2.0"
7
7
  gem "activerecord", "~> 4.2.0"
8
+ gem "sqlite3", "~> 1.3.6"
8
9
 
9
10
  group :test do
10
11
  gem "guard"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activesupport", "~> 5.1.0"
6
6
  gem "activemodel", "~> 5.1.0"
7
7
  gem "activerecord", "~> 5.1.0"
8
+ gem "sqlite3", "~> 1.3.6"
8
9
 
9
10
  group :test do
10
11
  gem "guard"
@@ -5,6 +5,7 @@ source "https://rubygems.org"
5
5
  gem "activesupport", "~> 5.2.0"
6
6
  gem "activemodel", "~> 5.2.0"
7
7
  gem "activerecord", "~> 5.2.0"
8
+ gem "sqlite3", "~> 1.3.6"
8
9
 
9
10
  group :test do
10
11
  gem "guard"
@@ -2,9 +2,9 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "activesupport", "~> 4.0.0"
6
- gem "activemodel", "~> 4.0.0"
7
- gem "activerecord", "~> 4.0.0"
5
+ gem "activesupport", "~> 6.0.0"
6
+ gem "activemodel", "~> 6.0.0"
7
+ gem "activerecord", "~> 6.0.0"
8
8
 
9
9
  group :test do
10
10
  gem "guard"
@@ -81,8 +81,13 @@ module ActiveData
81
81
  pollute = owner.class.dirty? && !owner.send(:attribute_changed?, name)
82
82
 
83
83
  if pollute
84
- previous_value = read
84
+ previous_value = owner.__send__(name)
85
+ owner.send("#{name}_will_change!")
86
+
85
87
  result = yield
88
+
89
+ owner.__send__(:clear_attribute_changes, [name]) if owner.__send__(name) == previous_value
90
+
86
91
  if previous_value != read || (
87
92
  read.respond_to?(:changed?) &&
88
93
  read.changed?
@@ -1,3 +1,3 @@
1
1
  module ActiveData
2
- VERSION = '1.1.4'.freeze
2
+ VERSION = '1.1.5'.freeze
3
3
  end
@@ -71,8 +71,8 @@ describe ActiveData::Model::Dirty do
71
71
  specify { expect(Model.new(numbers: '42').changes).to eq('numbers' => [[], [42]]) }
72
72
 
73
73
  # Have no idea how should it work right now
74
- specify { expect(Model.new(title: 'Hello').changes).to eq('title' => [{}, 'Hello']) }
75
- specify { expect(Model.new(title_translations: {en: 'Hello'}).changes).to eq('title' => [{}, 'Hello']) }
74
+ specify { expect(Model.new(title: 'Hello').changes).to eq('title' => [nil, 'Hello']) }
75
+ specify { expect(Model.new(title_translations: {en: 'Hello'}).changes).to eq('title' => [nil, 'Hello']) }
76
76
 
77
77
  specify { expect(Model.new).not_to respond_to :something_changed? }
78
78
  specify { expect(Model.new).to respond_to :n_changed? }
@@ -39,11 +39,17 @@ describe ActiveData::Model::Representation do
39
39
  end
40
40
 
41
41
  context 'dirty' do
42
- before { Post.include ActiveData::Model::Dirty }
42
+ before do
43
+ Author.include ActiveData::Model::Dirty
44
+ Post.include ActiveData::Model::Dirty
45
+ end
43
46
 
44
47
  specify do
45
48
  expect(Post.new(author: author, rate: '33').changes)
46
49
  .to eq('author' => [nil, author], 'rate' => [42, 33])
50
+
51
+ expect(Post.new(author: author, rate: '33').changes)
52
+ .to eq('author' => [nil, author])
47
53
  end
48
54
  end
49
55
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_data
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.4
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyromaniac
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-05-14 00:00:00.000000000 Z
11
+ date: 2019-09-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -199,12 +199,10 @@ files:
199
199
  - README.md
200
200
  - Rakefile
201
201
  - active_data.gemspec
202
- - gemfiles/rails.4.0.gemfile
203
- - gemfiles/rails.4.1.gemfile
204
202
  - gemfiles/rails.4.2.gemfile
205
- - gemfiles/rails.5.0.gemfile
206
203
  - gemfiles/rails.5.1.gemfile
207
204
  - gemfiles/rails.5.2.gemfile
205
+ - gemfiles/rails.6.0.gemfile
208
206
  - lib/active_data.rb
209
207
  - lib/active_data/active_record/associations.rb
210
208
  - lib/active_data/active_record/nested_attributes.rb
@@ -333,7 +331,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
333
331
  - !ruby/object:Gem::Version
334
332
  version: '0'
335
333
  requirements: []
336
- rubygems_version: 3.0.3
334
+ rubygems_version: 3.0.6
337
335
  signing_key:
338
336
  specification_version: 4
339
337
  summary: Working with hashes in AR style
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activesupport", "~> 4.1.0"
6
- gem "activemodel", "~> 4.1.0"
7
- gem "activerecord", "~> 4.1.0"
8
-
9
- group :test do
10
- gem "guard"
11
- gem "guard-rspec"
12
- end
13
-
14
- gemspec path: "../"
@@ -1,14 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "https://rubygems.org"
4
-
5
- gem "activesupport", "~> 5.0.0"
6
- gem "activemodel", "~> 5.0.0"
7
- gem "activerecord", "~> 5.0.0"
8
-
9
- group :test do
10
- gem "guard"
11
- gem "guard-rspec"
12
- end
13
-
14
- gemspec path: "../"