Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >> Release
- => 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)
- >> Release.first
- => #<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>
- >> Release.first.title
- => "Daedelus Live Test"
- >> Release.first.track.title
- NoMethodError: undefined method `track' for #<Release:0x22f7054>
- from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
- from (irb):4
- >> Release.first.track.name
- NoMethodError: undefined method `track' for #<Release:0x22ef7b4>
- from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
- from (irb):5
- >> @release = Release.find_by_title(Dingle Child)
- (irb):6: warning: parenthesize argument(s) for future version
- NameError: uninitialized constant Child
- from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:443:in `load_missing_constant'
- from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:80:in `const_missing'
- from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:92:in `const_missing'
- from (irb):6
- >> @release = Release.find_by_title("Dingle Child")
- => #<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>
- >> @release.title
- => "Dingle Child"
- >> @release.track.name
- NoMethodError: undefined method `track' for #<Release:0x22decd4>
- from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
- from (irb):9
- >> @release.track.name
- NoMethodError: undefined method `track' for #<Release:0x22decd4>
- from /Library/Ruby/Gems/1.8/gems/activerecord-2.3.2/lib/active_record/attribute_methods.rb:260:in `method_missing'
- from (irb):10
- >> @release.tracks.name
- => "Track"
- >> @release.tracks.first.name
- => "Dinglemasters"
- >> quit
Add Comment
Please, Sign In to add comment