cancan_strong_parameters 0.1.2 → 0.1.3

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -43,4 +43,5 @@ Or install it yourself as:
43
43
 
44
44
  ## Changelog
45
45
 
46
+ * Fixed some issues with nested form subfields in `permit_params`
46
47
  * Made compatible for nested forms
@@ -67,8 +67,8 @@ class ActionController::Base
67
67
  if (hash.present? && keys.present?) || (hash.select{|k,v| v.is_a?(Array)} == hash)
68
68
  prepend_before_filter :only => actions do
69
69
  resource_name = self.class.resource_name
70
- whitelist = self.class.hashified([*keys.flatten, self.class.attributized(hash)])
71
- self.params[resource_name] = params[resource_name].send method, whitelist
70
+ hash = self.class.attributized(hash)
71
+ self.params[resource_name] = params[resource_name].send method, *[*keys.flatten, hash]
72
72
  end
73
73
  elsif hash.present?
74
74
  prepend_before_filter :only => actions do
@@ -97,15 +97,6 @@ class ActionController::Base
97
97
  end
98
98
  end
99
99
  end
100
-
101
- def self.hashified(whitelist)
102
- hash = whitelist.extract_options!
103
- array = whitelist.dup
104
- whitelist = (hash || {})
105
- array.map {|v| whitelist[v] = nil }
106
-
107
- whitelist
108
- end
109
100
  end
110
101
 
111
102
  module ActionController
@@ -1,3 +1,3 @@
1
1
  module CancanStrongParameters
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cancan_strong_parameters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-15 00:00:00.000000000 Z
12
+ date: 2012-10-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: cancan