Module: Blazer::Plus::QueriesController

Extended by:
ActiveSupport::Concern
Defined in:
lib/blazer/plus/queries_controller.rb

Constant Summary collapse

DEFAULT_ROW_LIMIT =
5000

Instance Method Summary collapse

Instance Method Details

#csv_data(columns, rows, data_source) ⇒ Object

NOTE: Support BOM for Excel



17
18
19
# File 'lib/blazer/plus/queries_controller.rb', line 17

def csv_data(columns, rows, data_source)
  "\xEF\xBB\xBF#{super}"
end

#render_runObject

NOTE: Support row_limit setting for HTML



22
23
24
25
26
27
28
29
# File 'lib/blazer/plus/queries_controller.rb', line 22

def render_run
  row_limit = Blazer.settings.fetch('row_limit', DEFAULT_ROW_LIMIT)
  if request.format == :html && row_limit
    @row_limit ||= row_limit
  end

  super
end