Created
June 25, 2013 06:08
-
-
Save anonymous/5856301 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UpdatePetsCache < ActiveRecord::Migration | |
def up | |
User.all.each do |user| | |
User.reset_counters user.id, :pets | |
end | |
end | |
def down | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[out :: ] == UpdatePetsCache: migrating ================================================ | |
[out :: ] | |
[out :: ] rake aborted! | |
[out :: ] | |
[out :: ] An error has occurred, this and all later migrations canceled: | |
[out :: ] | |
[out :: ] | |
[out :: ] uninitialized constant User::Pet | |
[out :: ] /var/www/Test/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/inheritance.rb:111:in `compute_type' | |
[out :: ] | |
[out :: ] /var/www/Test/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/reflection.rb:172:in `klass' | |
[out :: ] | |
[out :: ] /var/www/Test/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/counter_cache.rb:33:in `block in res | |
ounters' | |
[out :: ] | |
[out :: ] /var/www/Test/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/counter_cache.rb:19:in `each' | |
[out :: ] | |
[out :: ] /var/www/Test/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.13/lib/active_record/counter_cache.rb:19:in `reset_counte |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment