Sha256: a301cec03c7957d881db5ce2b4fec0ccec0e1705a00ff6729346eba1bca3f04d

Contents?: true

Size: 336 Bytes

Versions: 32

Compression:

Stored size: 336 Bytes

Contents

class AddImagesCountToUsers < ActiveRecord::Migration
   def self.up
    add_column :users, :images_count, :integer, :default => 0

    # User.reset_column_information
    # User.all.each do |u|
    #   u.update_attribute :images_count, u.images.length
    # end
  end

  def self.down
    remove_column :users, :images_count
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
lentil-1.0.5 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-1.0.4 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-1.0.3 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-1.0.2 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-1.0.1 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-1.0.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.9.1 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.9.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.8.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.7.1 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.6.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.5.2 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.5.1 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.5.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.4.2 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.4.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.3.1 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.3.0 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.2.3 db/migrate/20121213142215_add_images_count_to_users.rb
lentil-0.2.2 db/migrate/20121213142215_add_images_count_to_users.rb