mirror of
https://github.com/diaspora/diaspora.git
synced 2026-04-29 03:01:03 -04:00
Ruby 1.9 fixes
This commit is contained in:
@@ -21,9 +21,9 @@ class PhotosController < ApplicationController
|
||||
# get file content type
|
||||
att_content_type = (request.content_type.to_s == "") ? "application/octet-stream" : request.content_type.to_s
|
||||
# create temporal file
|
||||
file = Tempfile.new(file_name)
|
||||
file = Tempfile.new(file_name, {encoding: 'BINARY'})
|
||||
# put data into this file from raw post request
|
||||
file.print request.raw_post
|
||||
file.print request.raw_post.force_encoding('BINARY')
|
||||
|
||||
# create several required methods for this temporal file
|
||||
Tempfile.send(:define_method, "content_type") {return att_content_type}
|
||||
|
||||
@@ -22,7 +22,7 @@ class Photo < Post
|
||||
timestamps!
|
||||
|
||||
validates_presence_of :album
|
||||
validates_true_for :album_id, :logic => lambda {self.validate_album_person}
|
||||
validates_true_for(:album_id, :logic => Proc.new { self.validate_album_person })
|
||||
|
||||
before_destroy :ensure_user_picture
|
||||
|
||||
|
||||
Reference in New Issue
Block a user