setting_accessors 1.2.0 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -1
- data/CHANGELOG.md +15 -4
- data/README.md +10 -1
- data/gemfiles/rails_4.2.gemfile.lock +1 -1
- data/gemfiles/rails_5.0.gemfile.lock +1 -1
- data/gemfiles/rails_5.1.gemfile.lock +1 -1
- data/gemfiles/rails_5.2.gemfile.lock +1 -1
- data/lib/setting_accessors/integration.rb +6 -2
- data/lib/setting_accessors/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d10252f28011080f4515a87d93e9142f6cb549058051750cadabf23541ad36d
|
4
|
+
data.tar.gz: 89651781d75a48777e4b5c746e5bb58686dff71394b7f33b91734b3858533a49
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 852a0cbc26936d8d2f3621d10e4eff8abb4687d26d3bb8182ead157977c21cbaa73afa9ffdafb96a2235ae5b6063782d78e22a430e9549de6ee0725704235e7a
|
7
|
+
data.tar.gz: 52ce5cce974c81aa9ec6f64b1777157ba3b6a3eedf4a0de3098ac0bd05bdfb1e705f0891874c68ddfb365fb43118b13fa1ae0f6916b1793179d27e166b710503
|
data/.travis.yml
CHANGED
@@ -20,7 +20,7 @@ gemfile:
|
|
20
20
|
- gemfiles/rails_5.1.gemfile
|
21
21
|
- gemfiles/rails_5.2.gemfile
|
22
22
|
|
23
|
-
before_install: 'gem install bundler'
|
23
|
+
before_install: 'gem install bundler -v 1.17.3'
|
24
24
|
|
25
25
|
before_script:
|
26
26
|
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,17 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
-
##
|
3
|
+
## [2.0.0] - 2019-09-27
|
4
|
+
|
5
|
+
New major version as the change to the `touch` behavior might break existing apps
|
6
|
+
and therefore is not backwards compatible.
|
7
|
+
|
8
|
+
### Fixed
|
9
|
+
|
10
|
+
- For AR >= 5.1, records are no longer `touch`ed after saving if
|
11
|
+
- [#19] the lifecycle was halted using `throw(:abort)` (props to @Haniyya)
|
12
|
+
- [#20] neither attributes nor settings were changed (basically `Model.first.save`)
|
13
|
+
|
14
|
+
## [1.2.0]
|
4
15
|
|
5
16
|
This is a major bugfix release as the gem was basically broken when being installed in a fresh Rails 5 application.
|
6
17
|
|
@@ -20,7 +31,7 @@ This is a major bugfix release as the gem was basically broken when being instal
|
|
20
31
|
* Calls to `#as_json` as well as probably other parts of the AR API would fail if the gem was only included
|
21
32
|
but not used (#17)
|
22
33
|
|
23
|
-
## 1.1.0
|
34
|
+
## [1.1.0]
|
24
35
|
|
25
36
|
A bugfix and slight refactoring release which takes care of several issues regarding
|
26
37
|
changing setting-values in-place without actually setting them before. (#13)
|
@@ -28,7 +39,7 @@ changing setting-values in-place without actually setting them before. (#13)
|
|
28
39
|
* More and better specs
|
29
40
|
* Better handling of non-existent settings through exception handling rather than multiple error prone tests
|
30
41
|
|
31
|
-
## 1.0.0
|
42
|
+
## [1.0.0]
|
32
43
|
|
33
44
|
This is almost a complete refactoring of the gem which also removes some not really needed functionality.
|
34
45
|
It is the first release fully compatible with Rails 5.
|
@@ -65,6 +76,6 @@ New minimum versions:
|
|
65
76
|
* `setting_accessor` no longer supports the `fallback` option.
|
66
77
|
If a `default` option is given, it is automatically used as fallback.
|
67
78
|
|
68
|
-
## 0.3.0
|
79
|
+
## [0.3.0]
|
69
80
|
|
70
81
|
* Fixed a bug that caused setting accessors not being initialized when being called as part of a rake task chain (#6)
|
data/README.md
CHANGED
@@ -16,7 +16,7 @@ and ActiveRecord integration to add virtual columns to models without having to
|
|
16
16
|
Version Information / Backwards Compatibility
|
17
17
|
---------------------------------------------
|
18
18
|
|
19
|
-
The current version (
|
19
|
+
The current version (2.x) is only compatible with Ruby >= 2.3 and Rails >= 4.2.
|
20
20
|
Versions 0.x support older versions of both Ruby and Rails.
|
21
21
|
|
22
22
|
Version 0.x also supported validations and type conversions for globally defined settings
|
@@ -197,6 +197,15 @@ validates :my_string, presence: true
|
|
197
197
|
validates :my_number, numericality: {only_integer: true}
|
198
198
|
```
|
199
199
|
|
200
|
+
Contributors
|
201
|
+
------------
|
202
|
+
|
203
|
+
<a href="https://github.com/stex/setting_accessors/graphs/contributors">
|
204
|
+
<img src="https://contributors-img.firebaseapp.com/image?repo=stex/setting_accessors" />
|
205
|
+
</a>
|
206
|
+
|
207
|
+
Made with [contributors-img](https://contributors-img.firebaseapp.com).
|
208
|
+
|
200
209
|
Contributing
|
201
210
|
------------
|
202
211
|
|
@@ -82,8 +82,12 @@ module SettingAccessors
|
|
82
82
|
if Gem.loaded_specs['activerecord'].version >= Gem::Version.create('5.1')
|
83
83
|
def _update_record(*)
|
84
84
|
super.tap do |affected_rows|
|
85
|
-
#
|
86
|
-
|
85
|
+
# The callback chain can, if a filter was provided for a certain callback and the callback throws and :abort,
|
86
|
+
# return +false+ instead of a number so we have to address both cases here.
|
87
|
+
unless affected_rows == false
|
88
|
+
# Workaround to trigger a #touch if necessary, see +after_save+ callback further up
|
89
|
+
@_setting_accessors_touch_assignable = affected_rows.zero? && settings.changed_settings.present?
|
90
|
+
end
|
87
91
|
end
|
88
92
|
end
|
89
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: setting_accessors
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 2.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefan Exner
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: appraisal
|