store_configurable 3.2.3 → 3.2.4

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG CHANGED
@@ -1,4 +1,9 @@
1
1
 
2
+ = 3.2.4
3
+
4
+ * The loader will just not send to key names but always use :[] and :[]= for safety.
5
+
6
+
2
7
  = 3.2.3
3
8
 
4
9
  * Allow inspect of the StoreConfigurable object to pass down to ordered options.
@@ -38,8 +38,8 @@ module StoreConfigurable
38
38
  config = StoreConfigurable::Object.new
39
39
  config.__store_configurable_owner__ = owner
40
40
  loader = lambda do |options, key, value|
41
- value.is_a?(Hash) ? value.each { |k,v| loader.call(options.send(key), k, v) } :
42
- options.send("#{key}=", value)
41
+ value.is_a?(Hash) ? value.each { |k,v| loader.call(options.send(:[],key), k, v) } :
42
+ options.send(:[]=, key, value)
43
43
  end
44
44
  stored_data.each { |k,v| loader.call(config, k, v) }
45
45
  owner.changed_attributes.delete('_config')
@@ -1,6 +1,6 @@
1
1
  module StoreConfigurable
2
2
 
3
3
  # We track ActiveRecord's major and minor version and follow semantic versioning.
4
- VERSION = '3.2.3'
4
+ VERSION = '3.2.4'
5
5
 
6
6
  end
@@ -57,6 +57,12 @@ class StoreConfigurable::BaseTest < StoreConfigurable::TestCase
57
57
  lambda{ user_ken.config.merge({}) }.must_raise(NotImplementedError)
58
58
  end
59
59
 
60
+ it 'can save unsafe keys' do
61
+ user_ken.config.sortable_tables[:posts][:sort].on = 'title'
62
+ user_ken.config.sortable_tables[:posts][:sort].dir = 'asc'
63
+ user_ken.save!
64
+ end
65
+
60
66
  describe 'existing data' do
61
67
 
62
68
  let(:color) { '#c1c1c1' }
@@ -150,6 +156,12 @@ class StoreConfigurable::BaseTest < StoreConfigurable::TestCase
150
156
  @user.must_be :config_changed?
151
157
  end
152
158
 
159
+ it 'can resave unsafe keys' do
160
+ @user.config.sortable_tables[:comments][:sort].on = 'title'
161
+ @user.config.sortable_tables[:comments][:sort].dir = 'asc'
162
+ @user.save!
163
+ end
164
+
153
165
  end
154
166
 
155
167
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: store_configurable
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.3
4
+ version: 3.2.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2012-04-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activerecord
16
- requirement: &70306619248640 !ruby/object:Gem::Requirement
16
+ requirement: &70330795216880 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: 3.2.0
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *70306619248640
24
+ version_requirements: *70330795216880
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: sqlite3
27
- requirement: &70306619248140 !ruby/object:Gem::Requirement
27
+ requirement: &70330795216380 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '1.3'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *70306619248140
35
+ version_requirements: *70330795216380
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: rake
38
- requirement: &70306619247680 !ruby/object:Gem::Requirement
38
+ requirement: &70330795215920 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: 0.9.2
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *70306619247680
46
+ version_requirements: *70330795215920
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: minitest
49
- requirement: &70306619247180 !ruby/object:Gem::Requirement
49
+ requirement: &70330795215420 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ~>
@@ -54,7 +54,7 @@ dependencies:
54
54
  version: 2.8.1
55
55
  type: :development
56
56
  prerelease: false
57
- version_requirements: *70306619247180
57
+ version_requirements: *70330795215420
58
58
  description: Grown up ActiveRecord::Store config options!
59
59
  email:
60
60
  - ken@metaskills.net