Skip to content

Instantly share code, notes, and snippets.

@rumblex
Created October 29, 2008 02:54
Show Gist options
  • Select an option

  • Save rumblex/20599 to your computer and use it in GitHub Desktop.

Select an option

Save rumblex/20599 to your computer and use it in GitHub Desktop.
?> Rating.count
=> 80371
>> r = Rating.find(26)
=> #<Rating id: 26, value: 3, user_id: 1089, rateable_id: 46, rateable_type: "Entry", created_at: "2008-10-23 01:51:38", updated_at: "2008-10-23 01:51:38", category: "completeness", certified: true>
>> r.save
=> true
>> r = Rating.find(26)
ActiveRecord::RecordNotFound: Couldn't find Rating with ID=26
from /usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1379:in `find_one'
from /usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:1362:in `find_from_ids'
from /usr/local/ruby/lib/ruby/gems/1.8/gems/activerecord-2.1.0/lib/active_record/base.rb:537:in `find'
from (irb):46
>> Rating.count
=> 80370
>> Rating.certified.count
=> 80370
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment