krists / refile-postgres

Postgres database as a backend for Refile
MIT License
16 stars 6 forks source link

Undefined method `verify_uploadable' for Refile:Module #1

Closed fladson closed 9 years ago

fladson commented 9 years ago

Hey @krists
Rails beginner here...

I'm getting an undefined method error on my controller#create (default from scaffold) method.

form
<div class="field">
    <%= f.label :file %><br>
    <%= f.attachment_field :file %><br>
</div>
require "refile"
Refile.configure do |config|
  config.store = Refile::Postgres::Backend.new(ActiveRecord::Base.connection.raw_connection)
end
"file"=>#<ActionDispatch::Http::UploadedFile:0x007f9a1925d1a8 @tempfile=#<Tempfile:/var/folders/kr/cpw88nhx6clgd4hjzkqp4rg80000gn/T/RackMultipart20150119-88383-1caehtl.xml>,
 @original_filename="buildInformation_SIGAA_3.7.0_3.7.35.ufopa.xml",
 @content_type="text/xml",
 @headers="Content-Disposition: form-data; name=\"build_information_file[file]\"; filename=\"buildInformation_SIGAA_3.7.0_3.7.35.ufopa.xml\"\r\nContent-Type: text/xml\r\n">},

It's runs just fine when I set the backend as FileSystem, so I'm guessing that is the Postgres backend. Any ideas?

Rails 4.2.0, Refile 0.5.3, Postgres backend, Ruby 2.2.0

Thanks

krists commented 9 years ago

Hello @fladson I will take a look at this later this evening

krists commented 9 years ago

There were breaking changes in latest Refile release 0.5.3. Refile.verify_uploadable method has been removed. I have released new Refile::Postgres gem version. Please upgrade you Gemfile with version 1.1.0.

And thanks for reporting this! Hope you find this gem useful.

fladson commented 9 years ago

:+1: