Skip to content

Commit

Permalink
Check if file is a StringIO
Browse files Browse the repository at this point in the history
Fixes image_file_string=
  • Loading branch information
Heiner Wohner committed Jun 29, 2011
1 parent e86f752 commit b4a68e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.6
1.0.7
6 changes: 3 additions & 3 deletions fleximage.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

Gem::Specification.new do |s|
s.name = %q{fleximage}
s.version = "1.0.5"
s.version = "1.0.7"

s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
s.authors = ["Ahmed Adam", "Alex Wayne", "Andrew White", "Duccio", "Fernando Kosh", "Heiner Wohner", "JJ Buckley", "Jason Lee", "Joshua Abbott", "Koji Ando", "Kouhei Sutou", "Lasse Jansen", "Loïc Guitaut", "Martin Vielsmaier", "Squeegy", "Thomas von Deyen", "Vannoy", "Wolfgang Klinger", "Wolfgang Kölbl", "josei", "ralph"]
Expand All @@ -24,6 +24,7 @@ super easy.
"Rakefile",
"VERSION",
"autotest.rb",
"fleximage.gemspec",
"init.rb",
"lib/dsl_accessor.rb",
"lib/fleximage.rb",
Expand Down Expand Up @@ -151,8 +152,7 @@ super easy.
"test/unit/preprocess_image_option_test.rb",
"test/unit/require_image_option_test.rb",
"test/unit/temp_image_test.rb",
"test/unit/use_creation_date_based_directories_option_test.rb",
"tvdeyen-fleximage.gemspec"
"test/unit/use_creation_date_based_directories_option_test.rb"
]
s.homepage = %q{http://github.com/hewo/fleximage}
s.require_paths = ["lib"]
Expand Down
3 changes: 2 additions & 1 deletion lib/fleximage/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,8 @@ def url_format
def image_file=(file)
if self.class.image_file_exists(file)

file_path = file.is_a?( ActionDispatch::Http::UploadedFile ) ? file.tempfile.path : file.path
file_path=file.tempfile.path if file.is_a?( ActionDispatch::Http::UploadedFile )
file_path=file.path unless file.is_a? StringIO

# Create RMagick Image object from uploaded file
if file_path
Expand Down

0 comments on commit b4a68e8

Please sign in to comment.