Validate the attachment before we attach without calling valid?
Using the ActiveRecord validations is smart in order to lessen load on the project to develop our own validators, but it's problematic in that calling `valid?` on the record fires off all the other validations -- including those on fields which may not be set yet because of mass-assignment. This commit will "pre-validate" the attachment's fields so that it doesn't process an invalid attachment, but it does so by running its validations manually on assignment.
Showing
... | ... | @@ -45,6 +45,7 @@ Gem::Specification.new do |s| |
s.add_development_dependency('bundler') | ||
s.add_development_dependency('fog', '>= 1.4.0', "< 1.7.0") | ||
s.add_development_dependency('pry') | ||
s.add_development_dependency('pry-debugger') | ||
s.add_development_dependency('launchy') | ||
s.add_development_dependency('rake') | ||
s.add_development_dependency('fakeweb') | ||
... | ... |
Please
register
or
sign in
to comment