Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created June 26, 2013 00:01
Show Gist options
  • Save sprite2005/5863612 to your computer and use it in GitHub Desktop.
Save sprite2005/5863612 to your computer and use it in GitHub Desktop.
1.9.3-p429 :001 > d = Dictionary.first
Dictionary Load (0.1ms) SELECT "dictionaries".* FROM "dictionaries" LIMIT 1
=> #<Dictionary id: 1, language: "English", enabled: true, created_at: "2013-06-24 00:11:31", updated_at: "2013-06-24 00:11:31", dictionary_words_count: 178691>
1.9.3-p429 :002 > d.dictionary_words.count
(453.5ms) SELECT COUNT(*) FROM "dictionary_words" WHERE "dictionary_words"."dictionary_id" = 1
=> 178691
class DictionaryWord < ActiveRecord::Base
belongs_to :dictionary, :counter_cache => true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment