query_report 1.0.18 → 1.0.19

Sign up to get free protection for your applications and to get access to all the features.
Files changed (107) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +5 -3
  3. data/lib/query_report/helper.rb +1 -1
  4. data/lib/query_report/report_pdf.rb +0 -2
  5. data/lib/query_report/version.rb +1 -1
  6. metadata +86 -311
  7. data/test/dummy/README.rdoc +0 -261
  8. data/test/dummy/Rakefile +0 -7
  9. data/test/dummy/app/assets/javascripts/application.js +0 -15
  10. data/test/dummy/app/assets/javascripts/invoices.js +0 -2
  11. data/test/dummy/app/assets/javascripts/users.js +0 -2
  12. data/test/dummy/app/assets/stylesheets/application.css +0 -13
  13. data/test/dummy/app/assets/stylesheets/invoices.css +0 -4
  14. data/test/dummy/app/assets/stylesheets/scaffold.css +0 -56
  15. data/test/dummy/app/assets/stylesheets/users.css +0 -4
  16. data/test/dummy/app/controllers/application_controller.rb +0 -3
  17. data/test/dummy/app/controllers/invoices_controller.rb +0 -115
  18. data/test/dummy/app/controllers/users_controller.rb +0 -91
  19. data/test/dummy/app/helpers/application_helper.rb +0 -2
  20. data/test/dummy/app/helpers/invoices_helper.rb +0 -2
  21. data/test/dummy/app/helpers/users_helper.rb +0 -2
  22. data/test/dummy/app/models/invoice.rb +0 -3
  23. data/test/dummy/app/models/pdf_report_template.rb +0 -24
  24. data/test/dummy/app/views/invoices/_form.html.erb +0 -33
  25. data/test/dummy/app/views/invoices/edit.html.erb +0 -6
  26. data/test/dummy/app/views/invoices/index.html.erb +0 -29
  27. data/test/dummy/app/views/invoices/new.html.erb +0 -5
  28. data/test/dummy/app/views/invoices/show.html.erb +0 -25
  29. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  30. data/test/dummy/app/views/users/_form.html.erb +0 -33
  31. data/test/dummy/app/views/users/edit.html.erb +0 -6
  32. data/test/dummy/app/views/users/index.html.erb +0 -29
  33. data/test/dummy/app/views/users/new.html.erb +0 -5
  34. data/test/dummy/app/views/users/show.html.erb +0 -25
  35. data/test/dummy/config.ru +0 -4
  36. data/test/dummy/config/application.rb +0 -59
  37. data/test/dummy/config/boot.rb +0 -10
  38. data/test/dummy/config/database.yml +0 -25
  39. data/test/dummy/config/environment.rb +0 -5
  40. data/test/dummy/config/environments/development.rb +0 -37
  41. data/test/dummy/config/environments/production.rb +0 -67
  42. data/test/dummy/config/environments/test.rb +0 -37
  43. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  44. data/test/dummy/config/initializers/inflections.rb +0 -15
  45. data/test/dummy/config/initializers/mime_types.rb +0 -5
  46. data/test/dummy/config/initializers/query_report.rb +0 -3
  47. data/test/dummy/config/initializers/secret_token.rb +0 -7
  48. data/test/dummy/config/initializers/session_store.rb +0 -8
  49. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  50. data/test/dummy/config/locales/en.yml +0 -10
  51. data/test/dummy/config/routes.rb +0 -63
  52. data/test/dummy/db/development.sqlite3 +0 -0
  53. data/test/dummy/db/migrate/20130630132513_create_invoices.rb +0 -15
  54. data/test/dummy/db/schema.rb +0 -28
  55. data/test/dummy/db/seed.rb +0 -9
  56. data/test/dummy/db/test.sqlite3 +0 -0
  57. data/test/dummy/log/development.log +0 -47624
  58. data/test/dummy/log/test.log +0 -176
  59. data/test/dummy/public/404.html +0 -26
  60. data/test/dummy/public/422.html +0 -26
  61. data/test/dummy/public/500.html +0 -25
  62. data/test/dummy/public/favicon.ico +0 -0
  63. data/test/dummy/script/rails +0 -6
  64. data/test/dummy/test/fixtures/invoices.yml +0 -13
  65. data/test/dummy/test/functional/invoices_controller_test.rb +0 -49
  66. data/test/dummy/test/unit/helpers/invoices_helper_test.rb +0 -4
  67. data/test/dummy/test/unit/invoice_test.rb +0 -7
  68. data/test/dummy/tmp/cache/assets/C8C/B80/sprockets%2F371bf96e99717688ed7313a0c53f4212 +0 -0
  69. data/test/dummy/tmp/cache/assets/CA9/F20/sprockets%2F00ff4f84806dd8834ab35f800a082640 +0 -0
  70. data/test/dummy/tmp/cache/assets/CAA/620/sprockets%2F87b209c0c9da28094a8d5581a21262c6 +0 -0
  71. data/test/dummy/tmp/cache/assets/CB5/B70/sprockets%2Fa769d915e72b1c8c0614793b54d02c86 +0 -0
  72. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  73. data/test/dummy/tmp/cache/assets/CD8/B70/sprockets%2F4050a4e5062ab95c9f32e9b6940821ea +0 -0
  74. data/test/dummy/tmp/cache/assets/CF0/1D0/sprockets%2F6fc757c2c8329244ca95d6909865bbc2 +0 -0
  75. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  76. data/test/dummy/tmp/cache/assets/D46/650/sprockets%2Ff56253b5f374fff1a33fbbc9881c9124 +0 -0
  77. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  78. data/test/dummy/tmp/cache/assets/D54/B90/sprockets%2F90719d7bdca76469cd487928f710decb +0 -0
  79. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  80. data/test/dummy/tmp/cache/assets/D67/B60/sprockets%2F5f1a0d05e77ca8b9a1fc2a47e17a8174 +0 -0
  81. data/test/dummy/tmp/cache/assets/D7C/990/sprockets%2F302f7d851fcdb17936f8096bfb967cab +0 -0
  82. data/test/dummy/tmp/cache/assets/D7F/AF0/sprockets%2Fa7deca9af827ab462635389b96c7da39 +0 -0
  83. data/test/dummy/tmp/cache/assets/DA3/AC0/sprockets%2F797d3e5f21daaf5c046cc6ec4830e95b +0 -0
  84. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  85. data/test/dummy/tmp/cache/assets/DFC/6F0/sprockets%2F2c45c36e4d7c7bfaeb826eeba29a09d2 +0 -0
  86. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  87. data/test/dummy/tmp/cache/assets/E0E/8A0/sprockets%2Fbecd48a9cf2ece858e433d7dcf0554f6 +0 -0
  88. data/test/dummy/tmp/miniprofiler/mp_timers_1yzh11ff7f20he2ibrf5 +0 -0
  89. data/test/dummy/tmp/miniprofiler/mp_timers_43t0tuuypgcuns14vrux +0 -0
  90. data/test/dummy/tmp/miniprofiler/mp_timers_8ku60sfcb2ox5r3bn86p +0 -0
  91. data/test/dummy/tmp/miniprofiler/mp_timers_bvxp7ntgvswdeihn0xkx +0 -0
  92. data/test/dummy/tmp/miniprofiler/mp_timers_exy6ebpwi5seo6ohb61r +0 -0
  93. data/test/dummy/tmp/miniprofiler/mp_timers_f0jlfr3yzz6f1yfyq446 +0 -0
  94. data/test/dummy/tmp/miniprofiler/mp_timers_gr2fezt8668tj6sdlgxd +0 -0
  95. data/test/dummy/tmp/miniprofiler/mp_timers_gx96ln5mjqb61n0uc37o +0 -0
  96. data/test/dummy/tmp/miniprofiler/mp_timers_h42xf1rxqz40qpxkhkfh +0 -0
  97. data/test/dummy/tmp/miniprofiler/mp_timers_iyeniuysxyxtupg0v0fb +0 -0
  98. data/test/dummy/tmp/miniprofiler/mp_timers_mr5amrsanyhnyiefk7ze +0 -0
  99. data/test/dummy/tmp/miniprofiler/mp_timers_qhtoawvlvlp0753c32so +0 -0
  100. data/test/dummy/tmp/miniprofiler/mp_timers_ro8d5tfkqqi3pyyahy8t +0 -0
  101. data/test/dummy/tmp/miniprofiler/mp_timers_u5cef64yg5b391u4fmj6 +0 -0
  102. data/test/dummy/tmp/miniprofiler/mp_timers_waldf841hr1ekdv3pxby +0 -0
  103. data/test/dummy/tmp/miniprofiler/mp_timers_xgkalffzvqg8jwck2t95 +0 -0
  104. data/test/dummy/tmp/miniprofiler/mp_timers_zrlk63csu50ffb4ysymm +0 -0
  105. data/test/dummy/tmp/miniprofiler/mp_views_127.0.0.1 +0 -0
  106. data/test/functional/report_mailer_test.rb +0 -7
  107. data/test/test_helper.rb +0 -15
@@ -1,91 +0,0 @@
1
- require 'query_report/helper'
2
-
3
- class UsersController < ApplicationController
4
- include QueryReport::Helper
5
-
6
- def index
7
- @users = User.scoped
8
-
9
- reporter(@users) do
10
- filter :email, type: :text
11
- filter :name, type: :text do |query, name|
12
- query.where("name LIKE '%#{name}%'")
13
- end
14
- filter :created_at, type: :date
15
-
16
- column :email
17
- column :name
18
- end
19
- end
20
-
21
- # GET /users/1
22
- # GET /users/1.json
23
- def show
24
- @user = User.find(params[:id])
25
-
26
- respond_to do |format|
27
- format.html # show.html.erb
28
- format.json { render json: @user }
29
- end
30
- end
31
-
32
- # GET /users/new
33
- # GET /users/new.json
34
- def new
35
- @user = User.new
36
-
37
- respond_to do |format|
38
- format.html # new.html.erb
39
- format.json { render json: @user }
40
- end
41
- end
42
-
43
- # GET /users/1/edit
44
- def edit
45
- @user = User.find(params[:id])
46
- end
47
-
48
- # POST /users
49
- # POST /users.json
50
- def create
51
- @user = User.new(params[:user])
52
-
53
- respond_to do |format|
54
- if @user.save
55
- format.html { redirect_to @user, notice: 'User was successfully created.' }
56
- format.json { render json: @user, status: :created, location: @user }
57
- else
58
- format.html { render action: "new" }
59
- format.json { render json: @user.errors, status: :unprocessable_entity }
60
- end
61
- end
62
- end
63
-
64
- # PUT /users/1
65
- # PUT /users/1.json
66
- def update
67
- @user = User.find(params[:id])
68
-
69
- respond_to do |format|
70
- if @user.update_attributes(params[:user])
71
- format.html { redirect_to @user, notice: 'User was successfully updated.' }
72
- format.json { head :no_content }
73
- else
74
- format.html { render action: "edit" }
75
- format.json { render json: @user.errors, status: :unprocessable_entity }
76
- end
77
- end
78
- end
79
-
80
- # DELETE /users/1
81
- # DELETE /users/1.json
82
- def destroy
83
- @user = User.find(params[:id])
84
- @user.destroy
85
-
86
- respond_to do |format|
87
- format.html { redirect_to users_url }
88
- format.json { head :no_content }
89
- end
90
- end
91
- end
@@ -1,2 +0,0 @@
1
- module ApplicationHelper
2
- end
@@ -1,2 +0,0 @@
1
- module InvoicesHelper
2
- end
@@ -1,2 +0,0 @@
1
- module UsersHelper
2
- end
@@ -1,3 +0,0 @@
1
- class Invoice < ActiveRecord::Base
2
- attr_accessible :invoiced_on, :paid, :paid_on, :received_by, :title, :total_charged, :total_paid
3
- end
@@ -1,24 +0,0 @@
1
- class PdfReportTemplate < QueryReport::ReportPdf
2
- def render_header
3
- pdf.text "Test title", :size => 20, :style => :bold
4
- report.filters.each do |filter|
5
- filter.comparators.each do |comparator|
6
- pdf.text "#{comparator.name} : #{comparator.param_value}" if comparator.param_value.present?
7
- end
8
- end
9
- pdf.move_down 20
10
- end
11
-
12
- def render_footer
13
- pdf.move_down 20
14
- pdf.text "Copyright to @ashraf", :size => 12
15
- end
16
-
17
- def to_pdf
18
- render_header
19
- super
20
- render_footer
21
- pdf
22
- end
23
-
24
- end
@@ -1,33 +0,0 @@
1
- <%= form_for(@invoice) do |f| %>
2
- <% if @invoice.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@invoice.errors.count, "error") %> prohibited this invoice from being saved:</h2>
5
-
6
- <ul>
7
- <% @invoice.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= f.label :title %><br />
16
- <%= f.text_field :title %>
17
- </div>
18
- <div class="field">
19
- <%= f.label :total_paid %><br />
20
- <%= f.text_field :total_paid %>
21
- </div>
22
- <div class="field">
23
- <%= f.label :total_charged %><br />
24
- <%= f.text_field :total_charged %>
25
- </div>
26
- <div class="field">
27
- <%= f.label :paid %><br />
28
- <%= f.check_box :paid %>
29
- </div>
30
- <div class="actions">
31
- <%= f.submit %>
32
- </div>
33
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing invoice</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @invoice %> |
6
- <%= link_to 'Back', invoices_path %>
@@ -1,29 +0,0 @@
1
- <h1>Listing invoices</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Title</th>
6
- <th>Total paid</th>
7
- <th>Total charged</th>
8
- <th>Paid</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
13
-
14
- <% @invoices.each do |invoice| %>
15
- <tr>
16
- <td><%= invoice.title %></td>
17
- <td><%= invoice.total_paid %></td>
18
- <td><%= invoice.total_charged %></td>
19
- <td><%= invoice.paid %></td>
20
- <td><%= link_to 'Show', invoice %></td>
21
- <td><%= link_to 'Edit', edit_invoice_path(invoice) %></td>
22
- <td><%= link_to 'Destroy', invoice, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
-
27
- <br />
28
-
29
- <%= link_to 'New Invoice', new_invoice_path %>
@@ -1,5 +0,0 @@
1
- <h1>New invoice</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', invoices_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Title:</b>
5
- <%= @invoice.title %>
6
- </p>
7
-
8
- <p>
9
- <b>Total paid:</b>
10
- <%= @invoice.total_paid %>
11
- </p>
12
-
13
- <p>
14
- <b>Total charged:</b>
15
- <%= @invoice.total_charged %>
16
- </p>
17
-
18
- <p>
19
- <b>Paid:</b>
20
- <%= @invoice.paid %>
21
- </p>
22
-
23
-
24
- <%= link_to 'Edit', edit_invoice_path(@invoice) %> |
25
- <%= link_to 'Back', invoices_path %>
@@ -1,14 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title>Dummy</title>
5
- <%= stylesheet_link_tag "application", :media => "all" %>
6
- <%= javascript_include_tag "application" %>
7
- <%= csrf_meta_tags %>
8
- </head>
9
- <body>
10
-
11
- <%= yield %>
12
-
13
- </body>
14
- </html>
@@ -1,33 +0,0 @@
1
- <%= form_for(@user) do |f| %>
2
- <% if @user.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@user.errors.count, "error") %> prohibited this user from being saved:</h2>
5
-
6
- <ul>
7
- <% @user.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= f.label :name %><br />
16
- <%= f.text_field :name %>
17
- </div>
18
- <div class="field">
19
- <%= f.label :email %><br />
20
- <%= f.text_field :email %>
21
- </div>
22
- <div class="field">
23
- <%= f.label :single %><br />
24
- <%= f.check_box :single %>
25
- </div>
26
- <div class="field">
27
- <%= f.label :dob %><br />
28
- <%= f.date_select :dob %>
29
- </div>
30
- <div class="actions">
31
- <%= f.submit %>
32
- </div>
33
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing user</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @user %> |
6
- <%= link_to 'Back', users_path %>
@@ -1,29 +0,0 @@
1
- <h1>Listing users</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Name</th>
6
- <th>Email</th>
7
- <th>Single</th>
8
- <th>Dob</th>
9
- <th></th>
10
- <th></th>
11
- <th></th>
12
- </tr>
13
-
14
- <% @users.each do |user| %>
15
- <tr>
16
- <td><%= user.name %></td>
17
- <td><%= user.email %></td>
18
- <td><%= user.single %></td>
19
- <td><%= user.dob %></td>
20
- <td><%= link_to 'Show', user %></td>
21
- <td><%= link_to 'Edit', edit_user_path(user) %></td>
22
- <td><%= link_to 'Destroy', user, method: :delete, data: { confirm: 'Are you sure?' } %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
-
27
- <br />
28
-
29
- <%= link_to 'New User', new_user_path %>
@@ -1,5 +0,0 @@
1
- <h1>New user</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', users_path %>
@@ -1,25 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Name:</b>
5
- <%= @user.name %>
6
- </p>
7
-
8
- <p>
9
- <b>Email:</b>
10
- <%= @user.email %>
11
- </p>
12
-
13
- <p>
14
- <b>Single:</b>
15
- <%= @user.single %>
16
- </p>
17
-
18
- <p>
19
- <b>Dob:</b>
20
- <%= @user.dob %>
21
- </p>
22
-
23
-
24
- <%= link_to 'Edit', edit_user_path(@user) %> |
25
- <%= link_to 'Back', users_path %>
data/test/dummy/config.ru DELETED
@@ -1,4 +0,0 @@
1
- # This file is used by Rack-based servers to start the application.
2
-
3
- require ::File.expand_path('../config/environment', __FILE__)
4
- run Dummy::Application
@@ -1,59 +0,0 @@
1
- require File.expand_path('../boot', __FILE__)
2
-
3
- require 'rails/all'
4
-
5
- Bundler.require(*Rails.groups)
6
- require "query_report"
7
-
8
- module Dummy
9
- class Application < Rails::Application
10
- # Settings in config/environments/* take precedence over those specified here.
11
- # Application configuration should go into files in config/initializers
12
- # -- all .rb files in that directory are automatically loaded.
13
-
14
- # Custom directories with classes and modules you want to be autoloadable.
15
- # config.autoload_paths += %W(#{config.root}/extras)
16
-
17
- # Only load the plugins named here, in the order given (default is alphabetical).
18
- # :all can be used as a placeholder for all plugins not explicitly named.
19
- # config.plugins = [ :exception_notification, :ssl_requirement, :all ]
20
-
21
- # Activate observers that should always be running.
22
- # config.active_record.observers = :cacher, :garbage_collector, :forum_observer
23
-
24
- # Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
25
- # Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
26
- # config.time_zone = 'Central Time (US & Canada)'
27
-
28
- # The default locale is :en and all translations from config/locales/*.rb,yml are auto loaded.
29
- # config.i18n.load_path += Dir[Rails.root.join('my', 'locales', '*.{rb,yml}').to_s]
30
- # config.i18n.default_locale = :de
31
-
32
- # Configure the default encoding used in templates for Ruby 1.9.
33
- config.encoding = "utf-8"
34
-
35
- # Configure sensitive parameters which will be filtered from the log file.
36
- config.filter_parameters += [:password]
37
-
38
- # Enable escaping HTML in JSON.
39
- config.active_support.escape_html_entities_in_json = true
40
-
41
- # Use SQL instead of Active Record's schema dumper when creating the database.
42
- # This is necessary if your schema can't be completely dumped by the schema dumper,
43
- # like if you have constraints or database-specific column types
44
- # config.active_record.schema_format = :sql
45
-
46
- # Enforce whitelist mode for mass assignment.
47
- # This will create an empty whitelist of attributes available for mass-assignment for all report
48
- # in your app. As such, your report will need to explicitly whitelist or blacklist accessible
49
- # parameters by using an attr_accessible or attr_protected declaration.
50
- config.active_record.whitelist_attributes = true
51
-
52
- # Enable the asset pipeline
53
- config.assets.enabled = true
54
-
55
- # Version of your assets, change this if you want to expire all your assets
56
- config.assets.version = '1.0'
57
- end
58
- end
59
-
@@ -1,10 +0,0 @@
1
- require 'rubygems'
2
- gemfile = File.expand_path('../../../../Gemfile', __FILE__)
3
-
4
- if File.exist?(gemfile)
5
- ENV['BUNDLE_GEMFILE'] = gemfile
6
- require 'bundler'
7
- Bundler.setup
8
- end
9
-
10
- $:.unshift File.expand_path('../../../../lib', __FILE__)