kinduff/spree_reffiliate

View on GitHub
lib/tasks/spree_reffiliate.rake

Summary

Maintainability
Test Coverage
namespace :reffiliate do
  task :generate => :environment do
    Spree.user_class.all.each do |user|
      if user.referral.nil?
        user.create_referral
      end
    end
    puts "Referrals generated."
  end
end