Fixed: undefined local variable or method data for File

This commit is contained in:
Vokhmin Alexey V 2014-06-25 13:20:05 +04:00
parent 1a1c67367e
commit 5611a94281
1 changed files with 2 additions and 1 deletions

View File

@ -32,7 +32,8 @@ module FileStoreService
file = ::File.new(data[:path])
# Hook for RestClient
# See: [RestClient::Payload#create_file_field](https://github.com/rest-client/rest-client/blob/master/lib/restclient/payload.rb#L202-L215)
file.define_singleton_method(:original_filename) { data[:fullname] }
fullname = data[:fullname]
file.define_singleton_method(:original_filename) { fullname }
resp = resource.post(file_store: { file: file })
resp = JSON(resp)