Sha256: 2d811b038d71b58d1a4338814d6f27289f86b6e082c4362342af87748c968f6d

Contents?: true

Size: 862 Bytes

Versions: 112

Compression:

Stored size: 862 Bytes

Contents

def puts! a, b=""
  puts "+++ +++ #{b}"
  puts a.inspect
end

task :migrate => [ 'migrate:assign_galleries_to_profile' ]

namespace :migrate do

  desc 'assign galleries to profile'
  task :assign_galleries_to_profile => :environment do
    u = User.find_by :email => 'piousbox@gmail.com'
    Gallery.unscoped.where( :user_profile => nil ).update_all( :user_profile_id => u.profile.id )
    puts 'Each gallery is associated with a user profile.'
  end

  desc 'destination for every marker'
  task :markers_destinations => :environment do
    ms = Marker.where( destination: nil )
    ms.each do |m|
      d = Map.where( slug: m.slug ).first
      if d
        m.destination = d
        m.save
        puts "Marker |#{m.name}| got destination |#{m.slug}|."
      else
        puts "+++ +++ #{m.slug}, No destination for this one."
      end
    end
  end

end

Version data entries

112 entries across 112 versions & 1 rubygems

Version Path
ish_manager-0.1.8.403 lib/tasks-done/migrate.rake
ish_manager-0.1.8.402 lib/tasks-done/migrate.rake
ish_manager-0.1.8.401 lib/tasks-done/migrate.rake
ish_manager-0.1.8.400 lib/tasks-done/migrate.rake
ish_manager-0.1.8.399 lib/tasks-done/migrate.rake
ish_manager-0.1.8.397 lib/tasks-done/migrate.rake
ish_manager-0.1.8.396 lib/tasks-done/migrate.rake
ish_manager-0.1.8.395 lib/tasks-done/migrate.rake
ish_manager-0.1.8.394 lib/tasks-done/migrate.rake
ish_manager-0.1.8.393 lib/tasks-done/migrate.rake
ish_manager-0.1.8.392 lib/tasks-done/migrate.rake
ish_manager-0.1.8.391 lib/tasks-done/migrate.rake
ish_manager-0.1.8.390 lib/tasks-done/migrate.rake
ish_manager-0.1.8.389 lib/tasks-done/migrate.rake
ish_manager-0.1.8.388 lib/tasks-done/migrate.rake
ish_manager-0.1.8.387 lib/tasks-done/migrate.rake
ish_manager-0.1.8.386 lib/tasks-done/migrate.rake
ish_manager-0.1.8.385 lib/tasks-done/migrate.rake
ish_manager-0.1.8.384 lib/tasks-done/migrate.rake
ish_manager-0.1.8.383 lib/tasks-done/migrate.rake