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 +4 -4
- data/.travis.yml +8 -25
- data/Appraisals +2 -1
- data/CHANGELOG.md +4 -0
- data/active_data.gemspec +0 -1
- data/gemfiles/rails.4.2.gemfile +1 -0
- data/gemfiles/rails.5.1.gemfile +1 -0
- data/gemfiles/rails.5.2.gemfile +1 -0
- data/gemfiles/{rails.4.0.gemfile → rails.6.0.gemfile} +3 -3
- data/lib/active_data/model/attributes/base.rb +6 -1
- data/lib/active_data/version.rb +1 -1
- data/spec/lib/active_data/model/dirty_spec.rb +2 -2
- data/spec/lib/active_data/model/representation_spec.rb +7 -1
- metadata +4 -6
- data/gemfiles/rails.4.1.gemfile +0 -14
- data/gemfiles/rails.5.0.gemfile +0 -14
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1c1d3b2c3318d731085fd9a76ef956e1d9fe4b52877b21384acb02e146c2408d
|
4
|
+
data.tar.gz: d95da2f65fd5a789369359e3787afd4f380f29e4a5e87afb599bcaff80fe57bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9d31b3015091e0d535d80e835d6f05e10526c5f4173b57c0d7c5b771d1b823109abb7e33fbb081d2fc1940c15916a6904221c2c9ec96c0014532af664d2b2ce3
|
7
|
+
data.tar.gz: 7c825f0e284920b89ee85faa0a2e56dd11199ae3a3cc55b6aff902695e2214326ee273fb1005395c9181522a019cfe7e12fdd32d7d83b80cb5a0c651734a2f0c
|
data/.travis.yml
CHANGED
@@ -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
|
-
|
19
|
-
- rvm:
|
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
|
-
|
29
|
-
|
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.
|
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
|
data/CHANGELOG.md
CHANGED
data/active_data.gemspec
CHANGED
@@ -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
|
|
data/gemfiles/rails.4.2.gemfile
CHANGED
data/gemfiles/rails.5.1.gemfile
CHANGED
data/gemfiles/rails.5.2.gemfile
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
source "https://rubygems.org"
|
4
4
|
|
5
|
-
gem "activesupport", "~>
|
6
|
-
gem "activemodel", "~>
|
7
|
-
gem "activerecord", "~>
|
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 =
|
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?
|
data/lib/active_data/version.rb
CHANGED
@@ -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' => [
|
75
|
-
specify { expect(Model.new(title_translations: {en: 'Hello'}).changes).to eq('title' => [
|
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
|
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
|
+
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-
|
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.
|
334
|
+
rubygems_version: 3.0.6
|
337
335
|
signing_key:
|
338
336
|
specification_version: 4
|
339
337
|
summary: Working with hashes in AR style
|
data/gemfiles/rails.4.1.gemfile
DELETED
@@ -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: "../"
|
data/gemfiles/rails.5.0.gemfile
DELETED
@@ -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: "../"
|