Created
October 1, 2012 21:35
-
-
Save charlespeach/3814583 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :associate_users do | |
desc "Update users external builder" do | |
@users = User.where(:external_builder_id => nil) | |
@users.each do |user| | |
#associate ExternalBuilder with User | |
unless user.lbp_number.blank? | |
@builder = ExternalBuilder.where(:lbp_number => user.lbp_number.gsub("BP", "").to_i) | |
if [email protected]? | |
u.update_column(:external_builder_id, @builder) | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment