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

r - Trouble relying on third party package imports in my package -

Payment information shows nothing in one page checkout page magento -