Sha256: a662f3b3c40120b8f32453039fe40318d7159a66804f0c468fc13c3f29608b3c

Contents?: true

Size: 725 Bytes

Versions: 51

Compression:

Stored size: 725 Bytes

Contents

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

namespace :ish_manager do

  desc "every user needs a user_profile"
  task :generate_user_profiles => :environment do
    User.all.map do |u|
      unless u.profile
        p = ::Ish::UserProfile.new :email => u.email, :user => u, :role_name => :guy
        u.profile = p
        u.save && p.save && print('.')
      end
    end
    puts 'OK'
  end

  desc 'assign my creator_profile to Gameui::Marker where missing'
  task :gameui_markers_creator_profile => :environment do
    ms = Gameui::Marker.where( creator_profile_id: nil )
    profile = User.find_by( email: 'piousbox@gmail.com' ).profile
    ms.update_all( creator_profile_id: profile.id )
  end


end

Version data entries

51 entries across 51 versions & 1 rubygems

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