bogdan/datagrid — pull request #92 by iwiznia (2014-03-01 23:38:34+00:00)
Title: Define column value as SQL

This is what's discussed on #40. It allows to specify the sql of the query. It only works for ActiveRecord (I'm not sure if it has any value for Mongodb).
I added a new option for the column :select instead of passing it as an argument like your example, I think it's better this way.
When you specify one column with the select option, ActiveRecord by default, clears all other selects you had, so datagrid adds all the columns of the table that the scope is defined on. If you have:

scope { User }
column(:name)
column(:uppercase_name, :sql => 'UPPER(name) uppercase_name')

The scope that will be generated is:

User.select("#{User.quoted_table_name}.*").select('UPPER(name) uppercase_name'')