Created
September 7, 2012 21:06
-
-
Save JakeAustwick/3669643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class User < ActiveRecord::Base | |
# Other stuff removed | |
belongs_to :plan | |
belongs_to :stripe_plan | |
def plan | |
self.stripe_token.to_s == "0" ? self.plan : self.stripe_plan | |
end | |
# Other stuff removed | |
end | |
1.9.2-p290 :001 > User.first.plan | |
User Load (0.7ms) SELECT `users`.* FROM `users` LIMIT 1 | |
SystemStackError: stack level too deep | |
from /Users/Jake/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/irb/workspace.rb:80 | |
Maybe IRB bug!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment