Skip to content

Instantly share code, notes, and snippets.

@Porta
Created April 20, 2011 18:33
Show Gist options
  • Save Porta/932246 to your computer and use it in GitHub Desktop.
Save Porta/932246 to your computer and use it in GitHub Desktop.
ruby-1.9.2-p136 > e = Event[1]
=> #<Event:1 user_id="1" item_id="3" transaction_id="2" kind="reception" text=nil created_at="2011-04-20 14:32:19 -0300">
ruby-1.9.2-p136 > e.item
NoMethodError: You tried to call Item#find, but Item is not defined on /home/porta/Dropbox/Code/rails3/barter/app/models/event.rb:4:in `block in <class:Event>'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/ohm-0.1.3/lib/ohm.rb:215:in `method_missing'
from /home/porta/Dropbox/Code/rails3/barter/app/models/event.rb:4:in `block in <class:Event>'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/ohm-0.1.3/lib/ohm.rb:1192:in `[]'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/ohm-0.1.3/lib/ohm.rb:1192:in `block in reference'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/ohm-0.1.3/lib/ohm.rb:1275:in `instance_eval'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/ohm-0.1.3/lib/ohm.rb:1275:in `block in define_memoized_method'
from (irb):2
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/railties-3.0.7/lib/rails/commands/console.rb:44:in `start'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/railties-3.0.7/lib/rails/commands/console.rb:8:in `start'
from /home/porta/.rvm/gems/ruby-1.9.2-p136@barter/gems/railties-3.0.7/lib/rails/commands.rb:23:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
ruby-1.9.2-p136 > e.item
+----+----------+----------+----------+-------+----------+----------+---------+----------+---------+-------+
| id | title | descr... | owner_id | price | state | tags_... | crea... | updat... | crea... | delta |
+----+----------+----------+----------+-------+----------+----------+---------+----------+---------+-------+
| 3 | Rumba... | Una t... | 1 | 1 | avail... | | 2011... | 2011-... | 1 | true |
+----+----------+----------+----------+-------+----------+----------+---------+----------+---------+-------+
1 row in set
ruby-1.9.2-p136 >
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment