Mạnh Vũ
0 followers · 264 views
on the atlas — 2
- Custom Order for User Query1 savers
- Curius / Onboarding2668 savers
highlights — 2
class User (names) { order_by = ["CASE"] names.each_with_index do |name, index| order_by << sanitize_sql_array(["WHEN name = ? THEN ?", name, index]) end order_by << "ELSE #{names.length} END" order(Arel.sql(order_by.join(" "))) } end
Custom Order for User QueryStarting [at a young age] he’s read everything that he could find about business. The subject that interests him, he’s read newspapers, biographies, trade press. He went over to his grandfather who was a grocer and he read the progressive grocer magazine, and he read articles on how to stock a meat department... What he’s really done is he’s created this immense vertical filing cabinet in his brain of layers and layers and layers of files of information that he can draw back on now for more than 70 years worth of data.
Curius / Onboarding