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

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -