Skip to content

Commit 4bf35d4

Browse files
committed
Prevent error message when permitting parameters for Attachinary::File. Fixes #88.
1 parent 2d7b74a commit 4bf35d4

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,4 @@ spec/dummy/config/cloudinary.yml
1010
bin/
1111

1212
.rspec
13+
config/cloudinary.yml

lib/attachinary/utils.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def self.process_hash(hash, scope=nil)
1414
file = if Rails::VERSION::MAJOR == 3
1515
Attachinary::File.new hash.slice(*Attachinary::File.attr_accessible[:default].to_a)
1616
else
17-
permitted_params = ActionController::Parameters.new(hash).permit(:public_id, :version, :width, :height, :format, :resource_type)
17+
permitted_params = ActionController::Parameters.new(hash.slice(:public_id, :version, :width, :height, :format, :resource_type)).permit!
1818
Attachinary::File.new(permitted_params)
1919
end
2020
file.scope = scope.to_s if scope && file.respond_to?(:scope=)

0 commit comments

Comments
 (0)