andrewculver / koudoku

Robust subscription support for Rails with Stripe.
MIT License
1.16k stars 187 forks source link

undefined method `current_organization' for #<Koudoku::SubscriptionsController #182

Closed Ray-Sutton closed 7 years ago

Ray-Sutton commented 7 years ago

Hi! I installed Koudoku but i'm getting a NoMethodError. I installed the gem on a model called organization, which allows groups to access the same content. Should I install it on a organization_user model? Screen shot of the error is attached and I can show any model necessary.

screen shot 2017-08-02 at 12 26 27 pm
andrewculver commented 7 years ago

Hey Ray! Great running into you on here! Can you try adding something like this to your ApplicationController?

def current_organization
  current_user.organization
end

I think that's how I handled this before. This assumes your users belong to an organization. (Let me know if they have more than one organization.)

Ray-Sutton commented 7 years ago

Hi Andrew!

It looks like that passed, but now I have a NoMethodError undefined method `subscription'

screen shot 2017-08-02 at 12 57 40 pm
Ray-Sutton commented 7 years ago

Hi Andrew,

I got it to work by using;

def current_organization @organization end

I'll play around with it and test it a bit to make sure it works.

All I have to do is update the pricing view, so I can fix my navbar layout. Thank you!