Michael Johnston
Michael Johnston

Reputation: 5320

What is the correct way to scope user data in a rails shopify app?

For locally stored data, what is the best way to scope entities to the currently logged in shop owner?

Upvotes: 1

Views: 130

Answers (2)

John Duff
John Duff

Reputation: 38578

The best idea is to store the .myshopify domain. This is a unique identifier that never changes for the shop and you need it to make requests to the shop. The shop id is unique as well, but essentially useless for anything you might want to do.

Upvotes: 1

Michael Johnston
Michael Johnston

Reputation: 5320

After a little poking, I realized ShopifyAPI::Shop.current.id is the correct way.

Upvotes: 1

Related Questions