I have simple model which looks like this:
def video_file=(input_data)
unless input_data.to_s.empty?
newfile = File.open("#{RAILS_ROOT}/public/to_upload/#{self.filename}_vid.f4v", "wb") do |f|
while buff = input_data.read(4096)
f.write(buff)
end
end
end
end
and here the error which rails manages to display and then dies, literally.
ActiveRecord::StatementInvalid in <ControllerName>
Why?