activerecord-typedstore 1.1.1 → 1.1.2

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
  SHA1:
3
- metadata.gz: fea522cd38d362c1f89a69c7fd9492b72a4d9057
4
- data.tar.gz: 77cd21ab722c5262b9150af01ee94bdd3c6e9539
3
+ metadata.gz: 32186c23b2155944fe8760d18cbfd9fa1091ba10
4
+ data.tar.gz: 811f0a0dfd47754e463afe3c6d540443456e8397
5
5
  SHA512:
6
- metadata.gz: 42332f9a8e566e555e4bee6696ffa7b803f886e0d6a37f589216b8665d0bf94c7726dab22f2878179f3bbc9be13174f2cfcbb07d33d8b08baea3dfd14b35165a
7
- data.tar.gz: fcbb9def1916703be1b236f8674795c6779941364199fa4e9997e34adc250f0fa1a1f5acb767b24fef951f237ec88c68a57d1fec7dbf985f6d3d5e182d8f19b9
6
+ metadata.gz: abbf5d186254ff6052dcd07d11e8f4743eaa406086845511bd0ef2a5451e2b3e56ae3f5ba3e190bd6582d409985ce08fd33db61a52eee8d0cf415c7c0cad0c37
7
+ data.tar.gz: ce93bc861633c8b1e1aecd0c23e398caa0688fd23577cb8da5398459927711905a9c72a07337ab34c42952e3e8e81fec0d827775e8eeddedbc6c3ff700bcff04
@@ -19,6 +19,7 @@ module ActiveRecord::TypedStore
19
19
  def typed_store(store_attribute, options={}, &block)
20
20
  dsl = DSL.new(store_attribute, options, &block)
21
21
  self.typed_stores ||= {}
22
+ self.typed_stores = typed_stores.deep_dup
22
23
  self.typed_stores[store_attribute] = dsl
23
24
 
24
25
  typed_klass = TypedHash.create(dsl.fields.values)
@@ -1,5 +1,5 @@
1
1
  module ActiveRecord
2
2
  module TypedStore
3
- VERSION = '1.1.1'
3
+ VERSION = '1.1.2'
4
4
  end
5
5
  end
@@ -217,6 +217,14 @@ class YamlTypedStoreModel < ActiveRecord::Base
217
217
  define_store_with_partial_attributes
218
218
  end
219
219
 
220
+ class InheritedTypedStoreModel < YamlTypedStoreModel
221
+ establish_connection :test_sqlite3
222
+
223
+ typed_store :settings do |t|
224
+ t.string :new_attribute
225
+ end
226
+ end
227
+
220
228
  class JsonTypedStoreModel < ActiveRecord::Base
221
229
  establish_connection :test_sqlite3
222
230
  store :untyped_settings, accessors: [:title]
@@ -237,7 +245,6 @@ module MarshalCoder
237
245
  def dump(value)
238
246
  Base64.encode64(Marshal.dump(value))
239
247
  end
240
-
241
248
  end
242
249
 
243
250
  class MarshalTypedStoreModel < ActiveRecord::Base
@@ -252,6 +259,7 @@ end
252
259
  Models = [
253
260
  Sqlite3RegularARModel,
254
261
  YamlTypedStoreModel,
262
+ InheritedTypedStoreModel,
255
263
  JsonTypedStoreModel,
256
264
  MarshalTypedStoreModel
257
265
  ]
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.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-18 00:00:00.000000000 Z
11
+ date: 2017-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord