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.382 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.381 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.380 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.379 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.378 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.377 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.376 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.374 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.373 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.372 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.371 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.370 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.369 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.368 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.367 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.366 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.365 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.364 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.363 lib/tasks/ish_manager_tasks.rake
ish_manager-0.1.8.362 lib/tasks/ish_manager_tasks.rake