Module: Sqlreport::ActiveRecordExtension::RelationMethods

Defined in:
lib/sqlreport/active_record_extension.rb

Overview

Provides SQLReport functionality to ActiveRecord models

Instance Method Summary collapse

Instance Method Details

#sqlreportObject

Convert the relation to a SQLReport result



10
11
12
13
14
15
16
# File 'lib/sqlreport/active_record_extension.rb', line 10

def sqlreport
  # Get the SQL query from the relation
  sql = to_sql

  # Create a SQLReport result from the query
  ::Sqlreport::Result.new(sql)
end