query_report 1.0.5 → 1.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,7 @@
2
2
  <table class="<%= QueryReport.config.record_table_class %>" cellpadding="0" cellspacing="0">
3
3
  <thead>
4
4
  <% report.columns.each do |column| %>
5
- <th><%= column.sortable? ? sort_link(report.search, column.name, {}, remote: @remote) : column.name %></th>
5
+ <th><%= column.sortable? ? sort_link(report.search, column.name, {}, remote: @remote) : column.humanize %></th>
6
6
  <% end %>
7
7
  </thead>
8
8
 
@@ -9,5 +9,5 @@
9
9
  <%= hidden_field_tag :subject %>
10
10
  <%= hidden_field_tag :message %>
11
11
  <%= hidden_field_tag :target_dom_id, @target_dom_id %>
12
- <%= f.submit 'Search', :class => QueryReport.config.search_button_class, :onclick => "$('#{@target_dom_id} #send_as_email').val(0);" %>
12
+ <%= f.submit t('query_report.labels.search'), :class => QueryReport.config.search_button_class, :onclick => "$('#{@target_dom_id} #send_as_email').val(0);" %>
13
13
  <% end %>
@@ -6,4 +6,6 @@ en:
6
6
  from: 'From'
7
7
  to: 'To'
8
8
  total:
9
- Total
9
+ Total
10
+ labels:
11
+ search: Search
@@ -6,8 +6,12 @@
6
6
  module QueryReport
7
7
  module PaginateModule
8
8
  def apply_pagination(query, params)
9
- page_method_name = Kaminari.config.page_method_name
10
- query.send(page_method_name, params[:page])
9
+ if paginate?
10
+ page_method_name = Kaminari.config.page_method_name
11
+ query.send(page_method_name, params[:page])
12
+ else
13
+ query
14
+ end
11
15
  end
12
16
  end
13
17
  end
@@ -42,6 +42,11 @@ module QueryReport
42
42
  @columns.any?(&:has_total?)
43
43
  end
44
44
 
45
+ def paginate?
46
+ return true if @options[:paginate].nil?
47
+ @options[:paginate]
48
+ end
49
+
45
50
  # to support the helper methods
46
51
  def method_missing(meth, *args, &block)
47
52
  if @template.respond_to?(meth)
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "1.0.5"
2
+ VERSION = "1.0.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: query_report
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: