Permalink
Browse files

accept category id as string or fixnum in Fotolia::Categories

  • Loading branch information...
1 parent ec055ff commit daf2fc625fdff3e98364f78a6f1934fd0b3d9ac0 Torsten Schönebaum committed Jul 15, 2009
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/fotolia/categories.rb
View
4 lib/fotolia/categories.rb
@@ -13,7 +13,9 @@ def find(category = nil)
@categories[k] # use cached categories
else
# get cats from fotolia
- res = if(category)
+ res = if(category && (category.kind_of?(String) || category.kind_of?(Fixnum)))
+ @fotolia.remote_call(@method, @fotolia.language.id, category.to_s)
+ elsif(category)
@fotolia.remote_call(@method, @fotolia.language.id, category.id)
else
@fotolia.remote_call(@method, @fotolia.language.id)

0 comments on commit daf2fc6

Please sign in to comment.