Guest User

Untitled

a guest
Jun 18th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.79 KB | None | 0 0
  1. >> Release
  2. => Release(id: integer, title: string, length: time, blurb: string, description: text, active: boolean, release_type_id: integer, location_id: integer, content_id: integer, user_id: integer, photo_file_name: string, photo_content_type: string, photo_file_size: integer, created_at: datetime, updated_at: datetime, artist_id: integer, featured: boolean)
  3. >> Release.first
  4. => #<Release id: 1, title: "Daedelus Live Test", length: "2000-01-01 03:55:00", blurb: "Daedelus is Live", description: "He's a wizard with dem Monkey Fingers.", active: true, release_type_id: 2, location_id: 4, content_id: nil, user_id: 2, photo_file_name: "Grundle.gif", photo_content_type: "image/gif", photo_file_size: 18444, created_at: "2009-05-09 04:36:49", updated_at: "2009-05-12 18:55:22", artist_id: 7, featured: true>
  5. >> Release.first.title
  6. => "Daedelus Live Test"
  7. >> Release.first.track.title
  8. NoMethodError: undefined method `track' for #<Release:0x22f7054>
  9. from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
  10. from (irb):4
  11. >> Release.first.track.name
  12. NoMethodError: undefined method `track' for #<Release:0x22ef7b4>
  13. from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
  14. from (irb):5
  15. >> @release = Release.find_by_title(Dingle Child)
  16. (irb):6: warning: parenthesize argument(s) for future version
  17. NameError: uninitialized constant Child
  18. from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant'
  19. from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
  20. from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
  21. from (irb):6
  22. >> @release = Release.find_by_title("Dingle Child")
  23. => #<Release id: 5, title: "Dingle Child", length: "2000-01-01 06:24:00", blurb: "He's a Dingle", description: "Wow!", active: true, release_type_id: 2, location_id: 1, content_id: nil, user_id: 2, photo_file_name: "Grundle.gif", photo_content_type: "image/gif", photo_file_size: 18444, created_at: "2009-05-13 06:25:16", updated_at: "2009-05-18 15:20:55", artist_id: 9, featured: true>
  24. >> @release.title
  25. => "Dingle Child"
  26. >> @release.track.name
  27. NoMethodError: undefined method `track' for #<Release:0x22decd4>
  28. from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
  29. from (irb):9
  30. >> @release.track.name
  31. NoMethodError: undefined method `track' for #<Release:0x22decd4>
  32. from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
  33. from (irb):10
  34. >> @release.tracks.name
  35. => "Track"
  36. >> @release.tracks.first.name
  37. => "Dinglemasters"
  38. >> quit
Add Comment
Please, Sign In to add comment