Skip to content

Instantly share code, notes, and snippets.

@NeMO84
Created August 22, 2011 22:35
Show Gist options
  • Save NeMO84/1163828 to your computer and use it in GitHub Desktop.
Save NeMO84/1163828 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p0 > sub_end.strftime("Ends on %m/%d/%Y at %I:%M%p")
NoMethodError: undefined method `strftime' for 1315186557:Fixnum
from (irb):12
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands/console.rb:44:in `start'
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands/console.rb:8:in `start'
from /.rvm/gems/ruby-1.9.2-p0/gems/railties-3.0.9/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p0 > sub_end
=> 1315186557
ruby-1.9.2-p0 > sub_end = test.subscriptions.last.period_end
=> 1315186557
# == Schema Information
#
# Table name: subscriptions
#
# id :integer not null, primary key
# status :string(255)
# plan_id :integer
# payment_method_token :string(255)
# created_at :datetime
# updated_at :datetime
# user_id :integer
# period_start :datetime
# period_end :datetime
# coupon_id :integer
class Subscription < ActiveRecord::Base
belongs_to :plan
has_one :coupon
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment