jsonb_accessor 1.3.7-java → 1.3.10-java

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: ce484d9aeee21dc13a5af013a9621e95d83b56304b6c8f12ff889e4a198ed4a3
4
- data.tar.gz: 10da9efa55604838e84f1741885b64cfb4cb958d1f6c1ca49b8e4bb44c028764
3
+ metadata.gz: 61fa514ba532ab6dc613d5f1e13ac2bb6731714694990e5377ec1501e6357e01
4
+ data.tar.gz: c37757deac5de852ace762f7d135db62124ee9d9a842445156611d1f577ebf03
5
5
  SHA512:
6
- metadata.gz: cde3cd949401ce97e08e44549a4d1053bd5560bbd6b3b9f6ac42fab160c4d631510501a26933e6b7fc2e43ef5ab31fbc67393253c0358c41dbd4902b20c13cb3
7
- data.tar.gz: 74f273a9462b9abf39e1e0f97e04d411a6f3549c803faab600583585168246df199a93fa520bca5967a54aa6865d549098d029e91acdad79c2ea8877477ca4f9
6
+ metadata.gz: fb68c0714bed5224e145321aae128e5d0c7e9330dc4aee97c04d42a0fe5c11018d5bdd788bbb541af35900d3077459675484c3bc878920c9afdd9bb51778d2f3
7
+ data.tar.gz: d069cfe296853335a7038068d891360a919d119fe4bc273498e4736b14129eb2595a9b3e8dbfd14e7fe8860482771fbc09ffc6d00984ecd973f5aaba0cd8ba43
@@ -10,12 +10,11 @@ jobs:
10
10
  lint:
11
11
  runs-on: ubuntu-latest
12
12
  steps:
13
- - uses: actions/checkout@v2
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@v2
133
+ - uses: actions/checkout@v3
135
134
 
136
135
  - name: Set up Ruby
137
136
  uses: ruby/setup-ruby@v1
data/.rubocop.yml CHANGED
@@ -60,3 +60,5 @@ Gemspec/RequiredRubyVersion:
60
60
  Enabled: false
61
61
  Gemspec/RequireMFA:
62
62
  Enabled: false
63
+ Gemspec/DevelopmentDependencies:
64
+ EnforcedStyle: gemspec
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- jruby-9.3.9.0
1
+ 3.2.1
data/CHANGELOG.md CHANGED
@@ -1,6 +1,11 @@
1
1
  # Changelog
2
2
  ## [Unreleased]
3
3
 
4
+ ## [1.3.8] - 2023-05-29
5
+ ### Fixes
6
+
7
+ - Support for ActiveRecord::Enum. [#163](https://github.com/madeintandem/jsonb_accessor/pull/163)
8
+
4
9
  ## [1.3.7] - 2022-12-29
5
10
 
6
11
  - 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=latest
2
- FROM ruby:${RUBY_VERSION}
1
+ ARG RUBY_VERSION
2
+ ARG RUBY_PLATFORM
3
+ FROM ${RUBY_PLATFORM}:${RUBY_VERSION}
3
4
 
4
- WORKDIR /usr/src/app
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
- RUN bundle install
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/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
@@ -6,7 +6,8 @@ services:
6
6
  - DATABASE_HOST=postgres
7
7
  build:
8
8
  args:
9
- - RUBY_VERSION=${RUBY_VERSION:-2.7.2}
9
+ - RUBY_VERSION=${RUBY_VERSION:-3.2.2}
10
+ - RUBY_PLATFORM=${RUBY_PLATFORM:-ruby}
10
11
  context: .
11
12
  volumes:
12
13
  - '.:/usr/src/app'
@@ -66,7 +66,9 @@ module JsonbAccessor
66
66
  define_method("#{name}=") do |value|
67
67
  super(value)
68
68
 
69
- attribute_value = public_send(name)
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")
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module JsonbAccessor
4
- VERSION = "1.3.7"
4
+ VERSION = "1.3.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonb_accessor
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.7
4
+ version: 1.3.10
5
5
  platform: java
6
6
  authors:
7
7
  - Michael Crismali
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2022-12-29 00:00:00.000000000 Z
13
+ date: 2023-05-30 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  requirement: !ruby/object:Gem::Requirement
@@ -256,7 +256,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
256
256
  - !ruby/object:Gem::Version
257
257
  version: '0'
258
258
  requirements: []
259
- rubygems_version: 3.2.33
259
+ rubygems_version: 3.3.25
260
260
  signing_key:
261
261
  specification_version: 4
262
262
  summary: Adds typed jsonb backed fields to your ActiveRecord models.