Skip to content

Commit

Permalink
Fix paperclip tempfile detect
Browse files Browse the repository at this point in the history
  • Loading branch information
galetahub committed May 14, 2012
1 parent a2c3de0 commit 4914510
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
5 changes: 4 additions & 1 deletion lib/ckeditor/backend/paperclip.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ def self.extended(base)

module InstanceMethods
def geometry
@geometry ||= ::Paperclip::Geometry.from_file(data.to_file)
@geometry ||= begin
file = data.respond_to?(:queued_for_write) ? data.queued_for_write[:original] : data.to_file
::Paperclip::Geometry.from_file(file)
end
end

protected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def self.up
t.string :type, :limit => 30

# Uncomment it to save images dimensions, if your need it
# t.integer :width
# t.integer :height
t.integer :width
t.integer :height

t.timestamps
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ def self.up
t.string :type, :limit => 30

# Uncomment these to save image dimensions, if your need them.
# t.integer :data_width
# t.integer :data_height
t.integer :data_width
t.integer :data_height

t.timestamps
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ def self.up
t.string :type, :limit => 30

# Uncomment it to save images dimensions, if your need it
# t.integer :width
# t.integer :height
t.integer :width
t.integer :height

t.timestamps
end
Expand Down

0 comments on commit 4914510

Please sign in to comment.