activerecord-typedstore 1.3.0 → 1.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3c305575dc1d19ea16344072768e7c4dc2f36de6261a5f7c18e638428b61d3d
4
- data.tar.gz: 7b2e6454da64d6e1138cfc2bf0f52fe88869a27b687d7624d51f3723e601f21f
3
+ metadata.gz: 922ee9aa28151d4d9682563fb960a01e3f0b483d1c9d1e9168c095391b87344e
4
+ data.tar.gz: 1116257100c7775ec75c3742666c9ab35454ceca71bef07781fe8581edaeeeec
5
5
  SHA512:
6
- metadata.gz: dbdbe06798896b11e98b9abdc04c5b87147a8724665e0fc85c6e87f3e44ba4f7284bd42f86120c5ca1683593d6b6010bfa248f3c071ba45145964c7bde614ae4
7
- data.tar.gz: c33b750f4873d9709ab1a453b667b1a1938bc05db8b0cb4ac6f8c6a60127d4b73714695b042551671e499a67ffecaf72fee00f714b1731c9e25939ff037b1b10
6
+ metadata.gz: 0c01c5370bc89c17b38a7f9a928e96064cececa214eb9e43a90a10b0ee8e990d18fbea8d18f1c45e1b1f3a9446d17174e79fe5483b1ae5a89ac5f5e994e618a8
7
+ data.tar.gz: 99fc46ff54dd8ba238ef3bda41d2861d200fb8f11f41a5b07d0c5846d747435c3424a5f550c168c6f73a36c78638f6affbf95636f4a75c56af40ad8d42685268
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.add_development_dependency 'rspec', '~> 3'
26
26
  spec.add_development_dependency 'coveralls', '~> 0'
27
27
  spec.add_development_dependency 'sqlite3', '~> 1'
28
- spec.add_development_dependency 'pg', '~> 0.18'
28
+ spec.add_development_dependency 'pg', ENV.fetch('PG_VERSION', '~> 0.18')
29
29
  spec.add_development_dependency 'mysql2', '> 0.3'
30
30
  spec.add_development_dependency 'database_cleaner', '~> 1'
31
31
  end
@@ -1,5 +1,6 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ ENV['PG_VERSION'] = '~> 1.1'
3
4
  gemspec path: '..'
4
5
 
5
6
  gem 'activerecord', github: 'rails/rails'
@@ -53,7 +53,7 @@ module ActiveRecord::TypedStore
53
53
  super
54
54
  end
55
55
 
56
- def query_attribute(attr_name)
56
+ def attribute?(attr_name)
57
57
  if self.class.store_accessors.include?(attr_name.to_s)
58
58
  value = public_send(attr_name)
59
59
 
@@ -21,8 +21,14 @@ module ActiveRecord::TypedStore
21
21
  typed_klass = TypedHash.create(dsl.fields.values)
22
22
  const_set("#{store_attribute}_hash".camelize, typed_klass)
23
23
 
24
- decorate_attribute_type(store_attribute, :typed_store) do |subtype|
25
- Type.new(typed_klass, dsl.coder, subtype)
24
+ if ActiveRecord.version >= Gem::Version.new('6.1.0.alpha')
25
+ attribute(store_attribute) do |subtype|
26
+ Type.new(typed_klass, dsl.coder, subtype)
27
+ end
28
+ else
29
+ decorate_attribute_type(store_attribute, :typed_store) do |subtype|
30
+ Type.new(typed_klass, dsl.coder, subtype)
31
+ end
26
32
  end
27
33
  store_accessor(store_attribute, dsl.accessors)
28
34
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module ActiveRecord
4
4
  module TypedStore
5
- VERSION = '1.3.0'
5
+ VERSION = '1.3.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-typedstore
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.0
4
+ version: 1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-03 00:00:00.000000000 Z
11
+ date: 2020-07-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -174,7 +174,7 @@ homepage: https://github.com/byroot/activerecord-typedstore
174
174
  licenses:
175
175
  - MIT
176
176
  metadata: {}
177
- post_install_message:
177
+ post_install_message:
178
178
  rdoc_options: []
179
179
  require_paths:
180
180
  - lib
@@ -189,8 +189,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
189
189
  - !ruby/object:Gem::Version
190
190
  version: '0'
191
191
  requirements: []
192
- rubygems_version: 3.0.4
193
- signing_key:
192
+ rubygems_version: 3.1.2
193
+ signing_key:
194
194
  specification_version: 4
195
195
  summary: Add type casting and full method attributes support to АctiveRecord store
196
196
  test_files: