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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32186c23b2155944fe8760d18cbfd9fa1091ba10
|
4
|
+
data.tar.gz: 811f0a0dfd47754e463afe3c6d540443456e8397
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
data/spec/support/models.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2017-11-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|