golden-setting 0.5.0 → 0.6.0

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: 382a93b828ea1126ea3c8055aa3503b06068d3ba
4
- data.tar.gz: b05c40f13d1d1ebdeb6feab79ac0961c4855bc45
3
+ metadata.gz: 800d09425b041c08a44ab9cac58bb4782f5fbb94
4
+ data.tar.gz: 7e62725cd53150713e3875d65c557508a8f91d9c
5
5
  SHA512:
6
- metadata.gz: 70e2597f9752dc23975f3b32938ad1c59c95dd2d96d78d6f0a2d5c42f779938b8b27df2cf971db814efb20747f5144ce64d37c7585186c29b9eaa33cddfb06fa
7
- data.tar.gz: 17a5735be2f7280c38820a94630be4331bbd0d4e8717320532301965f59bc4db4945f26849cb568da268aef82f80b9696aa404ae763254413bd8ce9cc28e856d
6
+ metadata.gz: 0c96623b32faee6ca82e7ce5fe3f3b0bb2d52c04c58032bbd157ba929eb221b67e774e64c7f46ec987cbe0fda0a170409d9cb4ad270eeb86effeed1147979e63
7
+ data.tar.gz: 3c694b300dcb4184452f3311e3c44edf520b899d633a4c736c6c792a846ca612000c4b784012f40c771f325297f1d58508110ff2f7e6847df9b591c860cdc511
@@ -59,14 +59,13 @@ class Golden::Setting::SettingsController < ApplicationController
59
59
 
60
60
  def new_setting
61
61
  value = params[:setting].delete :value
62
- @setting = @setting_class.new params[:setting]
62
+ @setting = @setting_class.new setting_params
63
63
  @setting.value = value
64
64
  end
65
65
 
66
66
  def setting_params
67
67
  if params.respond_to? :permit
68
- fields = [:field_type, :field_values, :group, :name, :value]
69
- params.require(:setting).permit(fields)
68
+ params.require(:setting).permit(Golden::Setting.permitted_fields)
70
69
  else
71
70
  params[:setting]
72
71
  end
@@ -33,4 +33,7 @@ Golden::Setting.configure do |config|
33
33
  # Define default tab with name of groups.
34
34
  # Default is ''.
35
35
  config.default_tab = 'site'
36
+
37
+ # Add more allowed fields for strong paramters.
38
+ #config.permitted_fields += []
36
39
  end
@@ -35,6 +35,11 @@ module Golden
35
35
  mattr_accessor :default_tab
36
36
  @@default_tab = ''
37
37
 
38
+ mattr_accessor :permitted_fields
39
+ @@permitted_fields = [
40
+ :field_type, :field_values, :group, :name, :value
41
+ ]
42
+
38
43
  def self.configure
39
44
  yield self
40
45
  end
@@ -1,5 +1,5 @@
1
1
  module Golden
2
2
  module Setting
3
- VERSION = '0.5.0'
3
+ VERSION = '0.6.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: golden-setting
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tse-Ching Ho
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-12 00:00:00.000000000 Z
11
+ date: 2013-08-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord