rails-properties 3.4.3 → 4.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 +5 -5
- data/.github/workflows/ci.yml +49 -0
- data/.gitignore +2 -0
- data/.ruby-version +1 -0
- data/Appraisals +15 -0
- data/CHANGELOG.md +11 -0
- data/gemfiles/activerecord_7.1.gemfile +7 -0
- data/gemfiles/activerecord_7.2.gemfile +7 -0
- data/gemfiles/activerecord_8.0.gemfile +7 -0
- data/gemfiles/activerecord_8.1.gemfile +7 -0
- data/lib/rails-properties/property_object.rb +11 -1
- data/lib/rails-properties/version.rb +1 -1
- data/rails-properties.gemspec +4 -3
- metadata +33 -21
- data/.travis.yml +0 -74
- data/ci/Gemfile-rails-3-1 +0 -5
- data/ci/Gemfile-rails-3-2 +0 -5
- data/ci/Gemfile-rails-4-0 +0 -6
- data/ci/Gemfile-rails-4-1 +0 -6
- data/ci/Gemfile-rails-4-2 +0 -6
- data/ci/Gemfile-rails-5-0 +0 -5
- data/ci/Gemfile-rails-5-1 +0 -5
- data/ci/Gemfile-rails-5-2 +0 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 9cc886f96725856ba3240a1121822b509315801508416a3d3d430e1b806d11b8
|
|
4
|
+
data.tar.gz: 351bece1f6c7970af46956b624f716b2f97f6d468d728692c3523cfd644f2efa
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 896676e76590b0f955e01e88345dee598c6c6920150ddc9ca5eb6194c56b8f59a86fb28cf5a4a89b3f2b641b6d3699f73f7e6b43e926fcf2fac1f2ab1b9bb332
|
|
7
|
+
data.tar.gz: 61c33eab8308024d5134a5f9095c064bda2afffb8bda6132530170f467f7c7a52cb2e516fec4c80cee79645339d46fe11bb2de4d311bea7b981d3358390595c1
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main, master]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main, master]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
spec:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
ruby:
|
|
16
|
+
- '3.1'
|
|
17
|
+
- '3.2'
|
|
18
|
+
- '3.3'
|
|
19
|
+
- '3.4'
|
|
20
|
+
- '4.0'
|
|
21
|
+
# Be aware you have to update the `Appraisals` file when adding new activerecord versions!
|
|
22
|
+
activerecord:
|
|
23
|
+
- '7.1'
|
|
24
|
+
- '7.2'
|
|
25
|
+
- '8.0'
|
|
26
|
+
- '8.1'
|
|
27
|
+
exclude:
|
|
28
|
+
- ruby: '3.1'
|
|
29
|
+
activerecord: '8.0'
|
|
30
|
+
- ruby: '3.1'
|
|
31
|
+
activerecord: '8.1'
|
|
32
|
+
name: RSpec (Activerecord ${{ matrix.activerecord }}) (Ruby ${{ matrix.ruby }})
|
|
33
|
+
steps:
|
|
34
|
+
- uses: actions/checkout@v4
|
|
35
|
+
|
|
36
|
+
- name: Set up Ruby
|
|
37
|
+
uses: ruby/setup-ruby@v1
|
|
38
|
+
with:
|
|
39
|
+
ruby-version: ${{ matrix.ruby }}
|
|
40
|
+
bundler-cache: true
|
|
41
|
+
|
|
42
|
+
- name: Generate appraisal Gemfiles
|
|
43
|
+
run: bundle exec appraisal generate
|
|
44
|
+
|
|
45
|
+
- name: Install gems for this appraisal
|
|
46
|
+
run: bundle exec appraisal activerecord-${{ matrix.activerecord }} bundle install
|
|
47
|
+
|
|
48
|
+
- name: Run specs
|
|
49
|
+
run: bundle exec appraisal activerecord-${{ matrix.activerecord }} rspec
|
data/.gitignore
CHANGED
data/.ruby-version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.3.6
|
data/Appraisals
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
appraise "activerecord-7.1" do
|
|
2
|
+
gem "activerecord", "~> 7.1.0"
|
|
3
|
+
end
|
|
4
|
+
|
|
5
|
+
appraise "activerecord-7.2" do
|
|
6
|
+
gem "activerecord", "~> 7.2.0"
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
appraise "activerecord-8.0" do
|
|
10
|
+
gem "activerecord", "~> 8.0.0"
|
|
11
|
+
end
|
|
12
|
+
|
|
13
|
+
appraise "activerecord-8.1" do
|
|
14
|
+
gem "activerecord", "~> 8.1.0"
|
|
15
|
+
end
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
## 4.0.0
|
|
6
|
+
|
|
7
|
+
### Added
|
|
8
|
+
|
|
9
|
+
- **Rails 7.2+ compatibility:** `update_attributes` and `update_attributes!` were removed from ActiveRecord in Rails 7.2 (deprecated in 6.1 in favor of `update` and `update!`). This release defines both methods on `RailsProperties::PropertyObject` and delegates to `update` / `update!`, so existing callers keep working without changes.
|
|
10
|
+
- **GitHub Actions CI** (`.github/workflows/ci.yml`): runs specs on push and pull_request to `main`/`master`, with a matrix of Ruby 3.1–4.0 and ActiveRecord 7.1, 7.2, 8.0, 8.1 via [Appraisal](https://github.com/thoughtbot/appraisal). Ruby 3.1 is excluded for ActiveRecord 8.0 and 8.1 (incompatible).
|
|
11
|
+
- **Appraisals** for testing against multiple ActiveRecord versions (7.1, 7.2, 8.0, 8.1).
|
|
@@ -13,7 +13,7 @@ module RailsProperties
|
|
|
13
13
|
end
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
-
serialize :value, Hash
|
|
16
|
+
serialize :value, type: Hash, coder: YAML
|
|
17
17
|
|
|
18
18
|
if RailsProperties.can_protect_attributes?
|
|
19
19
|
# attr_protected can not be used here because it touches the database which is not connected yet.
|
|
@@ -24,6 +24,16 @@ module RailsProperties
|
|
|
24
24
|
REGEX_SETTER = /\A([a-z]\w+)=\Z/i
|
|
25
25
|
REGEX_GETTER = /\A([a-z]\w+)\Z/i
|
|
26
26
|
|
|
27
|
+
# Rails 7.2 removed `update_attributes/update_attributes!`
|
|
28
|
+
# add a shim to delegate to `update/update!` for backwards compatibility
|
|
29
|
+
def update_attributes(attrs)
|
|
30
|
+
update(attrs)
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def update_attributes!(attrs)
|
|
34
|
+
update!(attrs)
|
|
35
|
+
end
|
|
36
|
+
|
|
27
37
|
def respond_to?(method_name, include_priv=false)
|
|
28
38
|
super || method_name.to_s =~ REGEX_SETTER || _property?(method_name)
|
|
29
39
|
end
|
data/rails-properties.gemspec
CHANGED
|
@@ -12,18 +12,19 @@ Gem::Specification.new do |gem|
|
|
|
12
12
|
gem.description = %q{Properties gem for Ruby on Rails}
|
|
13
13
|
gem.summary = %q{Ruby gem to handle properties for ActiveRecord instances by storing them as serialized Hash in a separate database table. Namespaces and defaults included.}
|
|
14
14
|
gem.homepage = 'https://github.com/1debit/rails-properties'
|
|
15
|
-
gem.required_ruby_version = '>= 1
|
|
15
|
+
gem.required_ruby_version = '>= 3.1'
|
|
16
16
|
|
|
17
17
|
gem.files = `git ls-files`.split($/)
|
|
18
18
|
gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
|
|
19
19
|
gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
|
|
20
20
|
gem.require_paths = ['lib']
|
|
21
21
|
|
|
22
|
-
gem.add_dependency 'activerecord', '>=
|
|
22
|
+
gem.add_dependency 'activerecord', '>= 7.1'
|
|
23
23
|
|
|
24
|
+
gem.add_development_dependency 'appraisal'
|
|
24
25
|
gem.add_development_dependency 'rake'
|
|
25
26
|
gem.add_development_dependency 'sqlite3'
|
|
26
27
|
gem.add_development_dependency 'rspec'
|
|
27
28
|
gem.add_development_dependency 'coveralls'
|
|
28
|
-
gem.add_development_dependency 'simplecov',
|
|
29
|
+
gem.add_development_dependency 'simplecov', '>= 0.22'
|
|
29
30
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: rails-properties
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Fletcher Fowler
|
|
8
|
-
autorequire:
|
|
8
|
+
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2026-03-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: activerecord
|
|
@@ -16,14 +16,28 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - ">="
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: '
|
|
19
|
+
version: '7.1'
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - ">="
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: '
|
|
26
|
+
version: '7.1'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: appraisal
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0'
|
|
34
|
+
type: :development
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - ">="
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: rake
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -86,14 +100,14 @@ dependencies:
|
|
|
86
100
|
requirements:
|
|
87
101
|
- - ">="
|
|
88
102
|
- !ruby/object:Gem::Version
|
|
89
|
-
version: 0.
|
|
103
|
+
version: '0.22'
|
|
90
104
|
type: :development
|
|
91
105
|
prerelease: false
|
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
|
93
107
|
requirements:
|
|
94
108
|
- - ">="
|
|
95
109
|
- !ruby/object:Gem::Version
|
|
96
|
-
version: 0.
|
|
110
|
+
version: '0.22'
|
|
97
111
|
description: Properties gem for Ruby on Rails
|
|
98
112
|
email:
|
|
99
113
|
- fletch@fzf.me
|
|
@@ -101,20 +115,19 @@ executables: []
|
|
|
101
115
|
extensions: []
|
|
102
116
|
extra_rdoc_files: []
|
|
103
117
|
files:
|
|
118
|
+
- ".github/workflows/ci.yml"
|
|
104
119
|
- ".gitignore"
|
|
105
|
-
- ".
|
|
120
|
+
- ".ruby-version"
|
|
121
|
+
- Appraisals
|
|
122
|
+
- CHANGELOG.md
|
|
106
123
|
- Gemfile
|
|
107
124
|
- MIT-LICENSE
|
|
108
125
|
- README.md
|
|
109
126
|
- Rakefile
|
|
110
|
-
-
|
|
111
|
-
-
|
|
112
|
-
-
|
|
113
|
-
-
|
|
114
|
-
- ci/Gemfile-rails-4-2
|
|
115
|
-
- ci/Gemfile-rails-5-0
|
|
116
|
-
- ci/Gemfile-rails-5-1
|
|
117
|
-
- ci/Gemfile-rails-5-2
|
|
127
|
+
- gemfiles/activerecord_7.1.gemfile
|
|
128
|
+
- gemfiles/activerecord_7.2.gemfile
|
|
129
|
+
- gemfiles/activerecord_8.0.gemfile
|
|
130
|
+
- gemfiles/activerecord_8.1.gemfile
|
|
118
131
|
- lib/generators/rails_properties/migration/migration_generator.rb
|
|
119
132
|
- lib/generators/rails_properties/migration/templates/migration.rb
|
|
120
133
|
- lib/rails-properties.rb
|
|
@@ -138,7 +151,7 @@ homepage: https://github.com/1debit/rails-properties
|
|
|
138
151
|
licenses:
|
|
139
152
|
- MIT
|
|
140
153
|
metadata: {}
|
|
141
|
-
post_install_message:
|
|
154
|
+
post_install_message:
|
|
142
155
|
rdoc_options: []
|
|
143
156
|
require_paths:
|
|
144
157
|
- lib
|
|
@@ -146,16 +159,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
146
159
|
requirements:
|
|
147
160
|
- - ">="
|
|
148
161
|
- !ruby/object:Gem::Version
|
|
149
|
-
version: 1
|
|
162
|
+
version: '3.1'
|
|
150
163
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
151
164
|
requirements:
|
|
152
165
|
- - ">="
|
|
153
166
|
- !ruby/object:Gem::Version
|
|
154
167
|
version: '0'
|
|
155
168
|
requirements: []
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
signing_key:
|
|
169
|
+
rubygems_version: 3.5.22
|
|
170
|
+
signing_key:
|
|
159
171
|
specification_version: 4
|
|
160
172
|
summary: Ruby gem to handle properties for ActiveRecord instances by storing them
|
|
161
173
|
as serialized Hash in a separate database table. Namespaces and defaults included.
|
data/.travis.yml
DELETED
|
@@ -1,74 +0,0 @@
|
|
|
1
|
-
language: ruby
|
|
2
|
-
rvm:
|
|
3
|
-
- 1.9.3
|
|
4
|
-
- 2.0.0
|
|
5
|
-
- 2.1.10
|
|
6
|
-
- 2.2.9
|
|
7
|
-
- 2.3.6
|
|
8
|
-
- 2.4.3
|
|
9
|
-
- 2.5.0
|
|
10
|
-
gemfile:
|
|
11
|
-
- ci/Gemfile-rails-3-1
|
|
12
|
-
- ci/Gemfile-rails-3-2
|
|
13
|
-
- ci/Gemfile-rails-4-0
|
|
14
|
-
- ci/Gemfile-rails-4-1
|
|
15
|
-
- ci/Gemfile-rails-4-2
|
|
16
|
-
- ci/Gemfile-rails-5-0
|
|
17
|
-
- ci/Gemfile-rails-5-1
|
|
18
|
-
- ci/Gemfile-rails-5-2
|
|
19
|
-
matrix:
|
|
20
|
-
include:
|
|
21
|
-
- rvm: 2.2.9
|
|
22
|
-
gemfile: ci/Gemfile-rails-4-0
|
|
23
|
-
env: PROTECTED_ATTRIBUTES=true
|
|
24
|
-
- rvm: 2.2.9
|
|
25
|
-
gemfile: ci/Gemfile-rails-4-1
|
|
26
|
-
env: PROTECTED_ATTRIBUTES=true
|
|
27
|
-
- rvm: 2.2.9
|
|
28
|
-
gemfile: ci/Gemfile-rails-4-2
|
|
29
|
-
env: PROTECTED_ATTRIBUTES=true
|
|
30
|
-
exclude:
|
|
31
|
-
- rvm: 1.9.3
|
|
32
|
-
gemfile: ci/Gemfile-rails-5-0
|
|
33
|
-
- rvm: 1.9.3
|
|
34
|
-
gemfile: ci/Gemfile-rails-5-1
|
|
35
|
-
- rvm: 1.9.3
|
|
36
|
-
gemfile: ci/Gemfile-rails-5-2
|
|
37
|
-
- rvm: 2.0.0
|
|
38
|
-
gemfile: ci/Gemfile-rails-5-0
|
|
39
|
-
- rvm: 2.0.0
|
|
40
|
-
gemfile: ci/Gemfile-rails-5-1
|
|
41
|
-
- rvm: 2.0.0
|
|
42
|
-
gemfile: ci/Gemfile-rails-5-2
|
|
43
|
-
- rvm: 2.1.10
|
|
44
|
-
gemfile: ci/Gemfile-rails-5-0
|
|
45
|
-
- rvm: 2.1.10
|
|
46
|
-
gemfile: ci/Gemfile-rails-5-1
|
|
47
|
-
- rvm: 2.1.10
|
|
48
|
-
gemfile: ci/Gemfile-rails-5-2
|
|
49
|
-
- rvm: 2.2.9
|
|
50
|
-
gemfile: ci/Gemfile-rails-3-1
|
|
51
|
-
- rvm: 2.3.6
|
|
52
|
-
gemfile: ci/Gemfile-rails-3-1
|
|
53
|
-
- rvm: 2.4.3
|
|
54
|
-
gemfile: ci/Gemfile-rails-3-1
|
|
55
|
-
- rvm: 2.5.0
|
|
56
|
-
gemfile: ci/Gemfile-rails-3-1
|
|
57
|
-
- rvm: 2.2.9
|
|
58
|
-
gemfile: ci/Gemfile-rails-3-2
|
|
59
|
-
- rvm: 2.3.6
|
|
60
|
-
gemfile: ci/Gemfile-rails-3-2
|
|
61
|
-
- rvm: 2.4.3
|
|
62
|
-
gemfile: ci/Gemfile-rails-3-2
|
|
63
|
-
- rvm: 2.4.3
|
|
64
|
-
gemfile: ci/Gemfile-rails-4-0
|
|
65
|
-
- rvm: 2.4.3
|
|
66
|
-
gemfile: ci/Gemfile-rails-4-1
|
|
67
|
-
- rvm: 2.5.0
|
|
68
|
-
gemfile: ci/Gemfile-rails-3-2
|
|
69
|
-
- rvm: 2.5.0
|
|
70
|
-
gemfile: ci/Gemfile-rails-4-0
|
|
71
|
-
- rvm: 2.5.0
|
|
72
|
-
gemfile: ci/Gemfile-rails-4-1
|
|
73
|
-
before_install: gem update bundler
|
|
74
|
-
sudo: false
|
data/ci/Gemfile-rails-3-1
DELETED
data/ci/Gemfile-rails-3-2
DELETED
data/ci/Gemfile-rails-4-0
DELETED
data/ci/Gemfile-rails-4-1
DELETED
data/ci/Gemfile-rails-4-2
DELETED
data/ci/Gemfile-rails-5-0
DELETED
data/ci/Gemfile-rails-5-1
DELETED