Skip to content
cesidio edited this page Mar 28, 2013 · 13 revisions

Welcome to the icare wiki!

Upgrading scripts

From 0.7.14 to 0.7.15+

Itinerary.all.each {|i| i.update_attributes(start_address: i[:title].split("-").first.strip, end_address: i[:title].split("-").last.strip); i.unset :title}

From 0.6.3 to 0.6.4+

User.all.each { |u| u.update_attribute :username_or_uid, [u.username, u.uid] }
User.all.each { |u| u.rename :facebook_data_updated_at, :facebook_data_cached_at }
User.all.each { |u| u.unset :references }
Conversation.all.each { |c| c.messages.each { |m| m.set(:read_at, m.read); m.unset :read } }

run rake db:mongoid:create_indexes too

From 0.5.2 to 0.5.3+

User.all.each do |u|
  u.references.all.each do |r|
    r.set :incoming, r[:references_incoming] if r[:references_incoming]
    r.set :outgoing, r[:references_outgoing] if r[:references_outgoing]
    r.unset :references_incoming
    r.unset :references_outgoing
  end
end