Rails 4 how to find the maximum length of a string column -


to find maximum length of string column in sql is:

select max(length(<column>)) <table> 

can show how same in rails 4 activerecord or squeel?

you can use model.pluck("max(length(column))"), won't load memory.


Comments

Popular posts from this blog

How to group boxplot outliers in gnuplot -

cakephp - simple blog with croogo -