query_report 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,6 +8,8 @@ module QueryReport
8
8
  chart_on_pdf: true, paginate: true
9
9
  }
10
10
  class Report
11
+ include ActionView::Helpers
12
+
11
13
  attr_accessor :params, :chart, :charts, :filters, :scopes, :current_scope, :options
12
14
 
13
15
  def initialize(params, options={}, &block)
@@ -29,6 +31,19 @@ module QueryReport
29
31
  end
30
32
  end
31
33
 
34
+ # to support the helper methods
35
+ def method_missing(meth, *args, &block)
36
+ if Rails.application.routes.url_helpers.respond_to?(meth)
37
+ Rails.application.routes.url_helpers.send(meth, *args)
38
+ elsif ActionController::Base.helpers.respond_to?(meth)
39
+ ActionController::Base.helpers.send(meth, *args)
40
+ else
41
+ super # You *must* call super if you don't handle the
42
+ # method, otherwise you'll mess up Ruby's method
43
+ # lookup.
44
+ end
45
+ end
46
+
32
47
  def column(name, options={}, &block)
33
48
  @columns << Column.new(name, options, block)
34
49
  end
@@ -1,3 +1,3 @@
1
1
  module QueryReport
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
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: 0.0.6
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-04-13 00:00:00.000000000 Z
12
+ date: 2013-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ransack