File tree 2 files changed +11
-1
lines changed
2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -83,7 +83,7 @@ def cacluate_score
83
83
end
84
84
85
85
def generate_public_id
86
- return self . public_id if self . public_id
86
+ return self . public_id if self . public_id . present?
87
87
self . public_id = SecureRandom . urlsafe_base64 ( 4 ) . downcase
88
88
#retry if not unique
89
89
generate_public_id unless Protip . where ( public_id : self . public_id ) . blank?
Original file line number Diff line number Diff line change @@ -64,6 +64,16 @@ namespace :db do
64
64
end
65
65
66
66
namespace :port do
67
+
68
+ task :check => :connect do
69
+ puts "legacy => ported"
70
+ puts "Likes: #{ Legacy [ :likes ] } => #{ Like . count } "
71
+ puts "Comments: #{ Legacy [ :comments ] } => #{ Comment . count } "
72
+ puts "Protips: #{ Legacy [ :protips ] } => #{ Protip . count } "
73
+ puts "Badges: #{ Legacy [ :badges ] } => #{ Badge . count } "
74
+ puts "Users: #{ Legacy [ :users ] } => #{ User . count } "
75
+ end
76
+
67
77
task :connect => :environment do
68
78
if hide_sql_out = Rails . env . development?
69
79
ActiveRecord ::Base . logger . level = Logger ::INFO
You can’t perform that action at this time.
0 commit comments