RailsCasts Pro episodes are now free!

Learn more or hide this

lulalala's Profile

GitHub User: lulalala

Comments by lulalala

Avatar

Even more optimization: use pluck to get ids:

ruby
def self.up
  add_column :projects, :tasks_count, :integer, :default => 0

  Project.reset_column_information
  Project.pluck(:id).each do |p_id|
    Project.reset_counters p_id, :tasks
  end
end

def self.down
  remove_column :projects, :tasks_count
end
Avatar

May I ask how I can get the cache monitor at the bottom of the screen?