From 79e37ad1a8eaaf75d0fa7efc156b07ea09ab2e10 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 26 Aug 2014 12:32:08 -0400 Subject: [PATCH] FIX: thor populate:posts tool needs to use find_by_username --- lib/tasks/populate.thor | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/populate.thor b/lib/tasks/populate.thor index 0b653287d3..f151b6a059 100644 --- a/lib/tasks/populate.thor +++ b/lib/tasks/populate.thor @@ -24,7 +24,7 @@ class Populate < Thor def posts require './config/environment' - users = User.find_all_by_username_lower(options[:users].map(&:downcase)) + users = options[:users].map { |u| User.find_by_username(u.downcase) } if users.length != options[:users].length not_found = options[:users].map(&:downcase) - users.map(&:username_lower) puts "No user found for these usernames: #{not_found.join(', ')}"