Commit e1951ed0 by Prem Sichanugrist

Remove unused `:validations` option

Fixes #786
parent 6c5fe19f
module Paperclip module Paperclip
class AttachmentOptions < Hash class AttachmentOptions < Hash
def initialize(options) def initialize(options)
options = {:validations => []}.merge(options)
options.each do |k, v| options.each do |k, v|
self.[]=(k, v) self.[]=(k, v)
end end
......
...@@ -5,19 +5,6 @@ class AttachmentOptionsTest < Test::Unit::TestCase ...@@ -5,19 +5,6 @@ class AttachmentOptionsTest < Test::Unit::TestCase
assert_kind_of Hash, Paperclip::AttachmentOptions.new({}) assert_kind_of Hash, Paperclip::AttachmentOptions.new({})
end end
should "add a default empty validations" do
options = {:arbi => :trary}
expected = {:validations => []}.merge(options)
actual = Paperclip::AttachmentOptions.new(options).to_hash
assert_equal expected, actual
end
should "not override validations if passed to initializer" do
options = {:validations => "something"}
attachment_options = Paperclip::AttachmentOptions.new(options)
assert_equal "something", attachment_options[:validations]
end
should "respond to []" do should "respond to []" do
assert Paperclip::AttachmentOptions.new({}).respond_to?(:[]) assert Paperclip::AttachmentOptions.new({}).respond_to?(:[])
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment