Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
find_by_id on category returns a category instance without a correct …
…item_id, this correct it
  • Loading branch information
jakimowicz committed Nov 8, 2009
1 parent b4a412e commit 73887bc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
3 changes: 2 additions & 1 deletion lib/app_store/base.rb
Expand Up @@ -11,7 +11,8 @@ class AppStore::Base
# <tt>attrs</tt> accepts:
# * <tt>:plist</tt>: a plist object to be parsed
def initialize(attrs = {})
init_from_plist attrs[:plist] if attrs[:plist]
init_from_plist attrs.delete(:plist) if attrs[:plist]
attrs.each { |key, value| instance_variable_set "@#{key}", value}
end

protected
Expand Down
3 changes: 1 addition & 2 deletions lib/app_store/category.rb
Expand Up @@ -51,8 +51,7 @@ def self.featured

# Search a Category by its <tt>id</tt>. Accepts only one <tt>id</tt> and returns a Category instance.
def self.find_by_id(id)
# TODO: pass item_id to new
category = new(:plist => AppStore::Caller.get(AppStore::Caller::CategoryURL, :id => id))
category = new(:item_id => id, :plist => AppStore::Caller.get(AppStore::Caller::CategoryURL, :id => id))
end

# Returns id for this category
Expand Down

0 comments on commit 73887bc

Please sign in to comment.