andrewculver / koudoku

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

Undefined method `can?' #186

Open woodardj opened 6 years ago

woodardj commented 6 years ago

I'm not using cancan in my app, but in koudoku/subscriptions_controller, execution is passing into the if defined?(:can?) block and throwing an undefined method error.

I'm on ruby 2.2.3 and rails 5.0.0. Here's what I get in pry:

[1] pry(main)> defined? :can?
=> "expression"

Which is actually what I get for any symbol:

[2] pry(main)> defined? :aslckjasdclkj
=> "expression"

I think the condition needs to be if defined?(:can?) == "method" or if respond_to? :can?