1

I'm looking at Ryan Bates' Railscasts tutorial on integrating stripe (http://railscasts.com/episodes/288-billing-with-stripe), and I'm excited to try it out.

Before he starts the tutorial though, he already has an authorization system that has different roles. I'm assuming he has a role_id table in the database, and based on that, segments the users into different plans by calling plan_id= .

I'm not sure how to tackle that though, does anyone know of a good tutorial, or resource for creating plan_id type authorization systems, so I can continue with the tutorial?

rekire
  • 47,260
  • 30
  • 167
  • 264
Stepan Parunashvili
  • 2,627
  • 5
  • 30
  • 51
  • Nothing special in source code: https://github.com/railscasts/288-billing-with-stripe – apneadiving Oct 01 '12 at 06:33
  • Thanks for the link! I copied over the source code, and I'm getting an idea of how it works. For those who also want to figure it out, I think the way Ryan does it is : He has two models. A Users Model, and a Plan Model. On the Users Model, he has a column called Plan_id, to connect it to the Plans Model. On the plans model, he says has_many users, and on the users model, he says belong_to plans. – Stepan Parunashvili Oct 01 '12 at 09:37

1 Answers1

1

The source code is great even for a noob like me :P.

He has two models -- Plan, and User. Afterwards, he associates them together by saying Plan has_many users, and users belong_to Plan. The rest follows in the source code! Thanks to Apneadiving

Stepan Parunashvili
  • 2,627
  • 5
  • 30
  • 51