setting_accessors 1.2.0 → 2.0.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
  SHA256:
3
- metadata.gz: 0ee5a9907251833eaa146db7fbac4a5018c2de9560ce5e6e20f3bea46f37fe24
4
- data.tar.gz: 6bfa23385d8e0457139faf0965b0bf966cde9234145a86b10f9671bc4830b13b
3
+ metadata.gz: 8d10252f28011080f4515a87d93e9142f6cb549058051750cadabf23541ad36d
4
+ data.tar.gz: 89651781d75a48777e4b5c746e5bb58686dff71394b7f33b91734b3858533a49
5
5
  SHA512:
6
- metadata.gz: a03c398cdc4458249af5ef3a5ca29742460e477d2c4c55df30e81ac3d8db539d20ae06859cef4462e2bc3805ae944083c0d488b219d251989752a99cf145fbbb
7
- data.tar.gz: 340c2ea4add256ddd50c57868957c223feffbec345332fa4e5e7f5e7e310206724f896f143c200814a745ab785abd66d67f28c3dcccaea1dc327035806c02ece
6
+ metadata.gz: 852a0cbc26936d8d2f3621d10e4eff8abb4687d26d3bb8182ead157977c21cbaa73afa9ffdafb96a2235ae5b6063782d78e22a430e9549de6ee0725704235e7a
7
+ data.tar.gz: 52ce5cce974c81aa9ec6f64b1777157ba3b6a3eedf4a0de3098ac0bd05bdfb1e705f0891874c68ddfb365fb43118b13fa1ae0f6916b1793179d27e166b710503
@@ -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
@@ -1,6 +1,17 @@
1
1
  # Changelog
2
2
 
3
- ## 1.2.0
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 (1.x) is only compatible with Ruby >= 2.3 and Rails >= 4.2.
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
 
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- setting_accessors (1.2.0)
4
+ setting_accessors (2.0.0)
5
5
  rails (>= 4.2, < 5.3)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- setting_accessors (1.2.0)
4
+ setting_accessors (2.0.0)
5
5
  rails (>= 4.2, < 5.3)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- setting_accessors (1.2.0)
4
+ setting_accessors (2.0.0)
5
5
  rails (>= 4.2, < 5.3)
6
6
 
7
7
  GEM
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: ..
3
3
  specs:
4
- setting_accessors (1.2.0)
4
+ setting_accessors (2.0.0)
5
5
  rails (>= 4.2, < 5.3)
6
6
 
7
7
  GEM
@@ -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
- # Workaround to trigger a #touch if necessary, see +after_save+ callback further up
86
- @_setting_accessors_touch_assignable = affected_rows.zero?
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module SettingAccessors
4
- VERSION = '1.2.0'
4
+ VERSION = '2.0.0'
5
5
  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: 1.2.0
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-06-08 00:00:00.000000000 Z
11
+ date: 2019-09-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: appraisal