Skip to content

Add .current method back to ShopifyAPI::Shop and ShopifyAPI::RecurringApplicationCharge #923

@scart88

Description

@scart88

Issue summary

With the new breaking api change, ShopifyAPI::Shop.current, ShopifyAPI::RecurringApplicationCharge.current methods are missing. Is there any plan in adding these back?

Expected behavior

ShopifyAPI::Shop.current should return the current shop from the session.

Actual behavior

Right now it returns
NoMethodError: undefined method 'current' for ShopifyAPI::Shop:Class

Previous implementation

def current
  (all || []).find { |c| c.status == 'active' }
end

Steps to reproduce the problem

Shop.first.with_shopify_session do
  puts ShopifyAPI::Shop.current
end 

Loading development environment (Rails 7.0.2.3)
[1] pry(main)> Shop.first.with_shopify_session { ShopifyAPI::Shop.current }
  Shop Load (7.4ms)  SELECT "shops".* FROM "shops" ORDER BY "shops"."id" ASC LIMIT $1  [["LIMIT", 1]]
NoMethodError: undefined method `current' for ShopifyAPI::Shop:Class
from (pry):1:in `block in __pry__'
[2] pry(main)> 

Specifications

  • shopify_api version: 10.0.0
  • Shopify API version used (example: 2022-04): 2022-04

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions