Commit 45b6ff53 authored by Aria Stewart's avatar Aria Stewart

Ruby 1.9 fixes

parent 7d0db114
......@@ -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
......
......@@ -6,6 +6,7 @@
# This file is used by Rack-based servers to start the application.
$LOAD_PATH << '.'
require ::File.expand_path('../config/environment', __FILE__)
#use Rack::FiberPool
#require 'lib/chrome_frame'
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment