jsonb_accessor 1.3.7 → 1.3.10
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 +4 -4
- data/.github/workflows/ci.yml +2 -3
- data/.rubocop.yml +2 -0
- data/.ruby-version +1 -1
- data/CHANGELOG.md +13 -0
- data/Dockerfile +9 -9
- data/Makefile +7 -0
- data/README.md +6 -0
- data/docker-compose.yml +2 -1
- data/lib/jsonb_accessor/macro.rb +3 -1
- data/lib/jsonb_accessor/version.rb +1 -1
- metadata +7 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5593f84fe3d0e2038beeac5377fef22f4d1b1b18daf78b3f65dc4c55362592e0
|
4
|
+
data.tar.gz: 3421f8ce790d9ca3db6f93007ce3a0ca327a749073f6f8df36f7fb922f5485af
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1433289f8c96cd0105f9b49922a4771c99a886f593b79225c835850d6875fad420fd91c60f6c05844464ae757ff597ec1a287245c75bf1afb823fff457eb33a
|
7
|
+
data.tar.gz: 9b3af34ed491b630e2e0f5859e263cbd157a2d7c6d29713d8536a7e389a21dc356a70e2b70ec3b207cb42c26814736e1fe984e3201acd34e58b08813d5a1a2fd
|
data/.github/workflows/ci.yml
CHANGED
@@ -10,12 +10,11 @@ jobs:
|
|
10
10
|
lint:
|
11
11
|
runs-on: ubuntu-latest
|
12
12
|
steps:
|
13
|
-
- uses: actions/checkout@
|
13
|
+
- uses: actions/checkout@v3
|
14
14
|
|
15
15
|
- name: Set up Ruby
|
16
16
|
uses: ruby/setup-ruby@v1
|
17
17
|
with:
|
18
|
-
ruby-version: 2.7.2
|
19
18
|
bundler-cache: true
|
20
19
|
|
21
20
|
- name: Rubocop
|
@@ -131,7 +130,7 @@ jobs:
|
|
131
130
|
name: ${{ matrix.gemfile }}, ruby ${{ matrix.ruby }}
|
132
131
|
|
133
132
|
steps:
|
134
|
-
- uses: actions/checkout@
|
133
|
+
- uses: actions/checkout@v3
|
135
134
|
|
136
135
|
- name: Set up Ruby
|
137
136
|
uses: ruby/setup-ruby@v1
|
data/.rubocop.yml
CHANGED
data/.ruby-version
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.
|
1
|
+
3.2.1
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,19 @@
|
|
1
1
|
# Changelog
|
2
2
|
## [Unreleased]
|
3
3
|
|
4
|
+
## [1.3.10] - 2023-05-30
|
5
|
+
### No changes
|
6
|
+
A new release was necessary to fix the corrupted 1.3.9 Java release on RubyGems.
|
7
|
+
|
8
|
+
## [1.3.9] - 2023-05-30
|
9
|
+
### No changes
|
10
|
+
A new release was necessary to fix the corrupted 1.3.8 Java release on RubyGems.
|
11
|
+
|
12
|
+
## [1.3.8] - 2023-05-29
|
13
|
+
### Fixes
|
14
|
+
|
15
|
+
- Support for ActiveRecord::Enum. [#163](https://github.com/madeintandem/jsonb_accessor/pull/163)
|
16
|
+
|
4
17
|
## [1.3.7] - 2022-12-29
|
5
18
|
|
6
19
|
- jruby support. jsonb_accessor now depends on `activerecord-jdbcpostgresql-adapter` instead of `pg` when the RUBY_PLATFORM is java. [#157](https://github.com/madeintandem/jsonb_accessor/pull/157)
|
data/Dockerfile
CHANGED
@@ -1,12 +1,12 @@
|
|
1
|
-
ARG RUBY_VERSION
|
2
|
-
|
1
|
+
ARG RUBY_VERSION
|
2
|
+
ARG RUBY_PLATFORM
|
3
|
+
FROM ${RUBY_PLATFORM}:${RUBY_VERSION}
|
3
4
|
|
4
|
-
|
5
|
-
|
6
|
-
RUN mkdir -p lib/jsonb_accessor
|
7
|
-
COPY lib/jsonb_accessor/version.rb ./lib/jsonb_accessor/
|
8
|
-
COPY *.gemspec Gemfile* ./
|
5
|
+
RUN apt-get update && apt-get install -y --no-install-recommends git
|
9
6
|
|
10
|
-
|
7
|
+
WORKDIR /usr/src/app
|
11
8
|
|
12
|
-
COPY . .
|
9
|
+
COPY lib/jsonb_accessor/version.rb ./lib/jsonb_accessor/version.rb
|
10
|
+
COPY jsonb_accessor.gemspec Gemfile ./
|
11
|
+
# RUN bundle install
|
12
|
+
COPY . ./
|
data/Makefile
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
build-gem:
|
2
|
+
@docker build --build-arg RUBY_PLATFORM=ruby --build-arg RUBY_VERSION=3.2.2 -t jsonb_accessor-ruby:3.2.2 .
|
3
|
+
@docker run --rm -v $(PWD):/usr/src/app -w /usr/src/app jsonb_accessor-ruby:3.2.2 gem build
|
4
|
+
|
5
|
+
build-gem-java:
|
6
|
+
@docker build --build-arg RUBY_PLATFORM=jruby --build-arg RUBY_VERSION=9.4.2-jdk -t jsonb_accessor-jruby:9.4.2-jdk .
|
7
|
+
@docker run --rm -v $(PWD):/usr/src/app -w /usr/src/app jsonb_accessor-jruby:9.4.2-jdk gem build --platform java
|
data/README.md
CHANGED
@@ -353,3 +353,9 @@ docker-compose run ruby rake spec
|
|
353
353
|
4. Commit your changes (`git commit -am 'Add some feature'`)
|
354
354
|
5. Push to the branch (`git push origin my-new-feature`)
|
355
355
|
6. Create a new Pull Request
|
356
|
+
|
357
|
+
## Alternatives
|
358
|
+
|
359
|
+
- https://github.com/DmitryTsepelev/store_model 💪
|
360
|
+
- https://github.com/palkan/store_attribute ❤️
|
361
|
+
- https://github.com/jrochkind/attr_json 🤩
|
data/docker-compose.yml
CHANGED
data/lib/jsonb_accessor/macro.rb
CHANGED
@@ -66,7 +66,9 @@ module JsonbAccessor
|
|
66
66
|
define_method("#{name}=") do |value|
|
67
67
|
super(value)
|
68
68
|
|
69
|
-
|
69
|
+
# If enum was defined, take the value from the enum and not what comes out directly from the getter
|
70
|
+
attribute_value = defined_enums[name].present? ? defined_enums[name][value] : public_send(name)
|
71
|
+
|
70
72
|
# Rails always saves time based on `default_timezone`. Since #as_json considers timezone, manual conversion is needed
|
71
73
|
if attribute_value.acts_like?(:time)
|
72
74
|
attribute_value = (JsonbAccessor::Helpers.active_record_default_timezone == :utc ? attribute_value.utc : attribute_value.in_time_zone).strftime("%F %R:%S.%L")
|
metadata
CHANGED
@@ -1,16 +1,16 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonb_accessor
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Crismali
|
8
8
|
- Joe Hirn
|
9
9
|
- Jason Haruska
|
10
|
-
autorequire:
|
10
|
+
autorequire:
|
11
11
|
bindir: exe
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-05-31 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activerecord
|
@@ -214,6 +214,7 @@ files:
|
|
214
214
|
- Dockerfile
|
215
215
|
- Gemfile
|
216
216
|
- LICENSE.txt
|
217
|
+
- Makefile
|
217
218
|
- README.md
|
218
219
|
- Rakefile
|
219
220
|
- UPGRADE_GUIDE.md
|
@@ -241,7 +242,7 @@ homepage: https://github.com/devmynd/jsonb_accessor
|
|
241
242
|
licenses:
|
242
243
|
- MIT
|
243
244
|
metadata: {}
|
244
|
-
post_install_message:
|
245
|
+
post_install_message:
|
245
246
|
rdoc_options: []
|
246
247
|
require_paths:
|
247
248
|
- lib
|
@@ -256,8 +257,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
256
257
|
- !ruby/object:Gem::Version
|
257
258
|
version: '0'
|
258
259
|
requirements: []
|
259
|
-
rubygems_version: 3.
|
260
|
-
signing_key:
|
260
|
+
rubygems_version: 3.4.10
|
261
|
+
signing_key:
|
261
262
|
specification_version: 4
|
262
263
|
summary: Adds typed jsonb backed fields to your ActiveRecord models.
|
263
264
|
test_files: []
|