Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Unknown method ActiveResource::Base.activate_session(session) #23

Closed
gilsilas opened this Issue · 4 comments

4 participants

@gilsilas

I'm using rails 3.2.0 with shopify_api 3.0.0.

I created a valid session and tried to fetch it to ActiveResource via "ActiveResource::Base.activate_session(session)" in order to do api calls to Shopify but I got unknown method error.

@dylanahsmith
Collaborator

Please provide the actual error message and the relevant part of the backtrace (i.e. you can leave out lines from your application).

@gilsilas

This is the request that cause the error (wisoky-.... is a test shop)

Started GET "/shopify/finalize?code=yyy&shop=wisoky-leuschke3264.myshopify.com&timestamp=1337013926&signature=xxx" for 127.0.0.1 at Mon May 14 19:45:27 +0300 2012
Processing by ShopifyController#finalize as HTML
  Parameters: {"shop"=>"wisoky-leuschke3264.myshopify.com", "timestamp"=>"1337013926", "code"=>"yyy", "signature"=>"xxx"}
Completed 500 Internal Server Error in 15835ms

NoMethodError (undefined method `activate_session' for ActiveResource::Base:Class):
  app/controllers/shopify_controller.rb:27:in `finalize'


  Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
  Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/_request_and_response.erb (1.3ms)
  Rendered /Library/Ruby/Gems/1.8/gems/actionpack-3.2.0/lib/action_dispatch/middleware/templates/rescues/diagnostics.erb within rescues/layout (5.4ms)

And this is the relevant code, the variables shop_url and token are valid (I tried to make api calls with curl and I succeed)

shopify_session = ShopifyAPI::Session.new(shop_url, token)
if shopify_session.valid?
  ActiveResource::Base.activate_session(shopify_session)
end

As I mentioned the 3th line cause the error (undefined method `activate_session' for ActiveResource::Base:Class)

Thanks for your help,
Gil.

@redronin
Owner

Hi,
That call should be ShopifyAPI::Base.activate_session(shopify_session), not ActiveResource::Base

@redronin redronin closed this
@davefp davefp reopened this
@davefp

There's a typo in the README, I'll fix it momentarily.

@davefp davefp closed this in f007b3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.