Method: ActionBlocks::DataEngine#to_json
- Defined in:
- lib/action_blocks/data_engine/data_engine.rb
#to_json ⇒ Object
90 91 92 93 94 95 |
# File 'lib/action_blocks/data_engine/data_engine.rb', line 90 def to_json sql = query.to_sql jsql = "select array_to_json(array_agg(row_to_json(t))) from (#{sql}) t" ActiveRecord::Base.connection.select_value(jsql) end |