clark_kent 0.8.7 → 0.8.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 076de1540311154237ad21335ca34c307b3b1032
4
- data.tar.gz: 71e9f029e66fee8f66527222e9b9591409e28bb2
3
+ metadata.gz: 0e6b35e00bd670e361ca050f25742b0b3a66ac8b
4
+ data.tar.gz: 1a180065525fe14dd534cbdf7ef327021049fd56
5
5
  SHA512:
6
- metadata.gz: 0f6bcf357d9f639a2fabab0d44b4ec6bea9304f9495409d8d36dab6c081bd648efd55120cd29ab671d3408de6c116bef339bf47d4805761864ef944db8a89b62
7
- data.tar.gz: 7cae50d4d8a778d2802be54ea0ae08f58bd3a6dd22095172b6ff991a534f706a81cb5f3b1a274029dedb37a740d4ce6275069587971fa215e6d8948dfdc76a5d
6
+ metadata.gz: 190cc984b4e95e9dda83d46b9b6b418f0150dbf50bac219835552757297a65bcae1e296c74a990a0474307e0b408f24184612e3524f75b13af7bfa3b3280c02d
7
+ data.tar.gz: e00255abff5d692f3a22ebe58d391db092dd910bd65fc7eff24595a1547f934b2d1795e34f53ff98d02316be70aa15475d919901ab9170d7aff11acd2fc4ee3e
@@ -66,8 +66,12 @@ class ClarkKent::ReportsController < ClarkKent::ApplicationController
66
66
 
67
67
  def update
68
68
  @report = ClarkKent::Report.find(params[:id])
69
- @report.update_attributes(report_params)
70
- render partial: 'show'
69
+ UpdateReport.new(@report,report_params).call
70
+ if @report.errors.empty?
71
+ render partial: 'show'
72
+ else
73
+ render partial: 'edit', status: :conflict
74
+ end
71
75
  end
72
76
 
73
77
  def clone
@@ -0,0 +1,21 @@
1
+ class ClarkKent::ReportsController::UpdateReport
2
+ def initialize(report, params)
3
+ @report, @params = report, params
4
+ end
5
+
6
+ def call
7
+ @report.assign_attributes(@params)
8
+ validate_resource_type or return false
9
+ @report.save
10
+ end
11
+
12
+ def validate_resource_type
13
+ if @report.report_columns.any? || @report.report_filters.any?
14
+ if @report.changes.keys.include? 'resource_type'
15
+ @report.errors[:resource_type] << "You can't change the type of report after adding columns or filters."
16
+ return false
17
+ end
18
+ end
19
+ return true
20
+ end
21
+ end
@@ -1,3 +1,3 @@
1
1
  module ClarkKent
2
- VERSION = "0.8.7"
2
+ VERSION = "0.8.8"
3
3
  end
Binary file
@@ -61934,3 +61934,1400 @@ ClarkKent::ReportColumnTest: test_0001_rejects report sort if no order_sql
61934
61934
  ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
61935
61935
   (0.0ms) RELEASE SAVEPOINT active_record_1
61936
61936
   (0.0ms) rollback transaction
61937
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
61938
+  (1.2ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar, "column_order" integer, "report_sort" varchar, "summary_method" varchar)
61939
+  (0.1ms) select sqlite_version(*)
61940
+  (0.9ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
61941
+  (0.9ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar, "name" varchar)
61942
+  (0.7ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar DEFAULT 'ClarkKent::Report', "string" varchar DEFAULT 'ClarkKent::Report', "filter_name" varchar, "filter_value" varchar, "type" varchar, "duration" varchar, "kind_of_day" varchar, "offset" varchar, "created_at" datetime, "updated_at" datetime)
61943
+  (0.9ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
61944
+  (0.1ms)  SELECT sql
61945
+ FROM sqlite_master
61946
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
61947
+ UNION ALL
61948
+ SELECT sql
61949
+ FROM sqlite_temp_master
61950
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
61951
+ 
61952
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
61953
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "resource_type" varchar, "sharing_scope_type" varchar, "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime)
61954
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
61955
+  (0.1ms)  SELECT sql
61956
+ FROM sqlite_master
61957
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
61958
+ UNION ALL
61959
+ SELECT sql
61960
+ FROM sqlite_temp_master
61961
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
61962
+ 
61963
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
61964
+  (1.0ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer)
61965
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar)
61966
+  (1.0ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar, "created_at" datetime, "updated_at" datetime)
61967
+  (0.9ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "age" integer, "department_id" integer)
61968
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
61969
+  (0.1ms) SELECT version FROM "schema_migrations"
61970
+  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
61971
+  (0.9ms) INSERT INTO schema_migrations (version) VALUES
61972
+ ('20131226170042'),
61973
+ ('20131226170112'),
61974
+ ('20140114010048'),
61975
+ ('20140129051754'),
61976
+ ('20150304233739');
61977
+
61978
+ 
61979
+  (1.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
61980
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]]
61981
+  (0.1ms) begin transaction
61982
+ SQL (0.4ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
61983
+  (0.8ms) commit transaction
61984
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]]
61985
+  (0.1ms) begin transaction
61986
+  (0.0ms) commit transaction
61987
+  (0.1ms) begin transaction
61988
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("resource_type", "created_at", "updated_at") VALUES (?, ?, ?) [["resource_type", "Order"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
61989
+  (0.8ms) commit transaction
61990
+  (0.0ms) begin transaction
61991
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "user_name"], ["column_order", 1]]
61992
+  (0.8ms) commit transaction
61993
+  (0.0ms) begin transaction
61994
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "id"], ["column_order", 2]]
61995
+  (0.6ms) commit transaction
61996
+  (0.0ms) begin transaction
61997
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "amount"], ["column_order", 3]]
61998
+  (0.6ms) commit transaction
61999
+  (0.0ms) begin transaction
62000
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "description"], ["column_order", 4]]
62001
+  (0.7ms) commit transaction
62002
+  (0.0ms) begin transaction
62003
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
62004
+  (0.7ms) commit transaction
62005
+  (0.1ms) begin transaction
62006
+ SQL (0.3ms) INSERT INTO "users" ("name", "email", "department_id") VALUES (?, ?, ?) [["name", "Michael Hedges"], ["email", "taproot@gmail.com"], ["department_id", 1]]
62007
+  (0.7ms) commit transaction
62008
+  (0.0ms) begin transaction
62009
+ SQL (0.3ms) INSERT INTO "orders" ("user_id", "amount", "description", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["user_id", 1], ["amount", 1], ["description", "Guitar strings"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
62010
+  (0.8ms) commit transaction
62011
+  (0.1ms) begin transaction
62012
+ -------------------------
62013
+ ClarkKentTest: test_truth
62014
+ -------------------------
62015
+  (0.0ms) rollback transaction
62016
+  (0.0ms) begin transaction
62017
+ -----------------------------------------------------
62018
+ ClarkKent::ReportsHelperTest: test_it_displays_a_date
62019
+ -----------------------------------------------------
62020
+  (0.1ms) rollback transaction
62021
+  (0.1ms) begin transaction
62022
+ --------------------------------------------------------------------------
62023
+ ClarkKent::ReportColumnTest: test_0001_rejects report sort if no order_sql
62024
+ --------------------------------------------------------------------------
62025
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62026
+  (0.0ms) SAVEPOINT active_record_1
62027
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62028
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62029
+  (0.1ms) rollback transaction
62030
+  (0.1ms) begin transaction
62031
+ --------------------------------------------------------------------------
62032
+ ClarkKent::ReportableTest: test_0002_it works without any required filters
62033
+ --------------------------------------------------------------------------
62034
+  (0.0ms) SAVEPOINT active_record_1
62035
+ SQL (0.8ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
62036
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62037
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62038
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62039
+  (0.5ms) rollback transaction
62040
+  (0.1ms) begin transaction
62041
+ ------------------------------------------------------------------------
62042
+ ClarkKent::ReportableTest: test_0001_it adds required filters if present
62043
+ ------------------------------------------------------------------------
62044
+  (0.1ms) SAVEPOINT active_record_1
62045
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "Order"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
62046
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62047
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62048
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62049
+  (0.4ms) rollback transaction
62050
+  (0.1ms) begin transaction
62051
+ --------------------------------------------------------------------------
62052
+ ClarkKent::ReportableTest: test_0003_doesn't blow up if order_sql is blank
62053
+ --------------------------------------------------------------------------
62054
+  (0.0ms) SAVEPOINT active_record_1
62055
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", 2017-03-22 01:01:24 UTC], ["updated_at", 2017-03-22 01:01:24 UTC]]
62056
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62057
+  (0.0ms) SAVEPOINT active_record_1
62058
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
62059
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62060
+ ClarkKent::ReportColumn Load (0.3ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62061
+ ClarkKent::ReportFilter Load (0.3ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62062
+  (0.8ms) rollback transaction
62063
+  (0.3ms) begin transaction
62064
+ -----------------------------------------------------------------------------------------
62065
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
62066
+ -----------------------------------------------------------------------------------------
62067
+ User Load (0.3ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "taproot@gmail.com"], ["LIMIT", 1]]
62068
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62069
+ SQL (0.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
62070
+  (0.1ms) SAVEPOINT active_record_1
62071
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("report_id", "name") VALUES (?, ?) [["report_id", 1], ["name", "test_emailer"]]
62072
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62073
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62074
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62075
+ Department Load (0.4ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62076
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62077
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62078
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62079
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62080
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62081
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62082
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62083
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/report_mailer/report_error.html.erb
62084
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_mailer/report_error.html.erb (1.8ms)
62085
+ ClarkKent::ReportMailer#report_error: processed outbound mail in 191.9ms
62086
+ Sent mail to taproot@gmail.com (7.2ms)
62087
+ Date: Tue, 21 Mar 2017 19:01:25 -0600
62088
+ From: reservations@invitedhome.com
62089
+ To: taproot@gmail.com
62090
+ Message-ID: <58d1cce57e0ec_8d1f3ffbfb43f9f488448@Erics-MacBook-Pro.local.mail>
62091
+ Subject: Your report has a problem
62092
+ Mime-Version: 1.0
62093
+ Content-Type: text/html;
62094
+ charset=UTF-8
62095
+ Content-Transfer-Encoding: 7bit
62096
+
62097
+ Your report could not be created due to the following problem:
62098
+ <strong>At least one date range is required.</strong>
62099
+  (0.4ms) rollback transaction
62100
+  (0.1ms) begin transaction
62101
+ ---------------------------------------------------
62102
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
62103
+ ---------------------------------------------------
62104
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "taproot@gmail.com"], ["LIMIT", 1]]
62105
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62106
+ SQL (0.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
62107
+  (0.0ms) SAVEPOINT active_record_1
62108
+ SQL (0.1ms) INSERT INTO "clark_kent_report_emails" ("report_id", "name") VALUES (?, ?) [["report_id", 1], ["name", "test_emailer"]]
62109
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62110
+  (0.0ms) SAVEPOINT active_record_1
62111
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62112
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62113
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62114
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62115
+ Department Load (0.0ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62116
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62117
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62118
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62119
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62120
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62121
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
62122
+  (0.5ms) rollback transaction
62123
+  (0.1ms) begin transaction
62124
+ --------------------------------------------------------------------------------------------------
62125
+ ClarkKent::ReportColumnsControllerTest: test_0003_should reject a report column with unusable sort
62126
+ --------------------------------------------------------------------------------------------------
62127
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62128
+ Processing by ClarkKent::ReportColumnsController#create as JS
62129
+ Parameters: {"report_column"=>{"column_name"=>"user_name", "report_id"=>"1", "report_sort"=>"ascending"}}
62130
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62131
+  (0.0ms) SAVEPOINT active_record_1
62132
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62133
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
62134
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62135
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62136
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_form.html.erb (61.4ms)
62137
+ Completed 409 Conflict in 93ms (Views: 90.5ms | ActiveRecord: 0.5ms)
62138
+  (0.1ms) rollback transaction
62139
+  (0.1ms) begin transaction
62140
+ ---------------------------------------------------------------------------------------------------
62141
+ ClarkKent::ReportColumnsControllerTest: test_0002_should reject a report column with no column_name
62142
+ ---------------------------------------------------------------------------------------------------
62143
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62144
+ Processing by ClarkKent::ReportColumnsController#create as JS
62145
+ Parameters: {"report_column"=>{"report_id"=>"1"}}
62146
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62147
+  (0.0ms) SAVEPOINT active_record_1
62148
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
62149
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62150
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62151
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62152
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_form.html.erb (8.4ms)
62153
+ Completed 409 Conflict in 11ms (Views: 8.4ms | ActiveRecord: 0.5ms)
62154
+  (0.1ms) rollback transaction
62155
+  (0.1ms) begin transaction
62156
+ -------------------------------------------------------------------------------
62157
+ ClarkKent::ReportColumnsControllerTest: test_0001_should create a report column
62158
+ -------------------------------------------------------------------------------
62159
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62160
+ Processing by ClarkKent::ReportColumnsController#create as JS
62161
+ Parameters: {"report_column"=>{"column_name"=>"user_name", "report_id"=>"1"}}
62162
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62163
+  (0.1ms) SAVEPOINT active_record_1
62164
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name") VALUES (?, ?) [["report_id", 1], ["column_name", "user_name"]]
62165
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62166
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
62167
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (34.2ms)
62168
+ Completed 200 OK in 65ms (Views: 62.5ms | ActiveRecord: 0.6ms)
62169
+  (0.5ms) rollback transaction
62170
+  (0.1ms) begin transaction
62171
+ ------------------------------------------------------------------------------------------------
62172
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
62173
+ ------------------------------------------------------------------------------------------------
62174
+  (0.1ms) SAVEPOINT active_record_1
62175
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
62176
+  (0.0ms) rollback transaction
62177
+  (0.0ms) begin transaction
62178
+ ------------------------------------------------------------------------------------------
62179
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_an_object_filter
62180
+ ------------------------------------------------------------------------------------------
62181
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62182
+  (0.1ms) SAVEPOINT active_record_1
62183
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62184
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62185
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62186
+  (0.1ms) SAVEPOINT active_record_1
62187
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62188
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62189
+ Processing by ClarkKent::ReportFiltersController#show as HTML
62190
+ Parameters: {"id"=>"1"}
62191
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62192
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62193
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62194
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62195
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_show.html.erb (0.9ms)
62196
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (5.9ms)
62197
+ Completed 200 OK in 14ms (Views: 8.6ms | ActiveRecord: 0.3ms)
62198
+  (0.4ms) rollback transaction
62199
+  (0.1ms) begin transaction
62200
+ -----------------------------------------------------------------------------
62201
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_a_report_filter
62202
+ -----------------------------------------------------------------------------
62203
+ ClarkKent::Report Load (0.3ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62204
+  (0.1ms) SAVEPOINT active_record_1
62205
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62206
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62207
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62208
+ Processing by ClarkKent::ReportFiltersController#create as HTML
62209
+ Parameters: {"report_filter"=>{"filter_name"=>"user_email", "filter_value"=>"taproot@gmail.com", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report"}}
62210
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62211
+  (0.1ms) SAVEPOINT active_record_1
62212
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62213
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62214
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62215
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_show.html.erb (0.5ms)
62216
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (5.7ms)
62217
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (6.2ms)
62218
+ Completed 200 OK in 22ms (Views: 9.1ms | ActiveRecord: 0.4ms)
62219
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
62220
+  (0.4ms) rollback transaction
62221
+  (0.2ms) begin transaction
62222
+ -----------------------------------------------------------------------------------------
62223
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_a_string_filter
62224
+ -----------------------------------------------------------------------------------------
62225
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62226
+  (0.0ms) SAVEPOINT active_record_1
62227
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62228
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62229
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62230
+  (0.1ms) SAVEPOINT active_record_1
62231
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62232
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62233
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
62234
+ Parameters: {"id"=>"1"}
62235
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62236
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62237
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62238
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_edit.html.erb (0.4ms)
62239
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (11.8ms)
62240
+ Completed 200 OK in 17ms (Views: 14.6ms | ActiveRecord: 0.2ms)
62241
+  (0.5ms) rollback transaction
62242
+  (0.1ms) begin transaction
62243
+ ---------------------------------------------------------------------------------------
62244
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_a_date_filter
62245
+ ---------------------------------------------------------------------------------------
62246
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62247
+  (0.0ms) SAVEPOINT active_record_1
62248
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62249
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62250
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62251
+  (0.0ms) SAVEPOINT active_record_1
62252
+ SQL (0.1ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62253
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62254
+ Processing by ClarkKent::ReportFiltersController#show as HTML
62255
+ Parameters: {"id"=>"1"}
62256
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62257
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62258
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62259
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_show.html.erb (0.6ms)
62260
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (5.3ms)
62261
+ Completed 200 OK in 9ms (Views: 5.7ms | ActiveRecord: 0.2ms)
62262
+  (0.6ms) rollback transaction
62263
+  (0.1ms) begin transaction
62264
+ ------------------------------------------------------------------------------------------
62265
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_an_object_filter
62266
+ ------------------------------------------------------------------------------------------
62267
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62268
+  (0.0ms) SAVEPOINT active_record_1
62269
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62270
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62271
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62272
+  (0.0ms) SAVEPOINT active_record_1
62273
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62274
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62275
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
62276
+ Parameters: {"id"=>"1"}
62277
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62278
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62279
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62280
+ User Load (0.2ms) SELECT "users".* FROM "users"
62281
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_edit.html.erb (3.0ms)
62282
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (9.9ms)
62283
+ Completed 200 OK in 12ms (Views: 10.0ms | ActiveRecord: 0.3ms)
62284
+  (0.5ms) rollback transaction
62285
+  (0.1ms) begin transaction
62286
+ -------------------------------------------------------------------------------------
62287
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_an_object_report_filter
62288
+ -------------------------------------------------------------------------------------
62289
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62290
+  (0.1ms) SAVEPOINT active_record_1
62291
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62292
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62293
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62294
+ Processing by ClarkKent::ReportFiltersController#create as HTML
62295
+ Parameters: {"report_filter"=>{"filter_name"=>"user_id", "filter_value"=>"1", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report"}}
62296
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62297
+  (0.0ms) SAVEPOINT active_record_1
62298
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62299
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62300
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62301
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62302
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_show.html.erb (0.5ms)
62303
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (2.2ms)
62304
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (2.4ms)
62305
+ Completed 200 OK in 6ms (Views: 2.6ms | ActiveRecord: 0.5ms)
62306
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
62307
+  (0.4ms) rollback transaction
62308
+  (0.1ms) begin transaction
62309
+ ---------------------------------------------------------------------------------------
62310
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_a_date_filter
62311
+ ---------------------------------------------------------------------------------------
62312
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62313
+  (0.0ms) SAVEPOINT active_record_1
62314
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62315
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62316
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62317
+  (0.1ms) SAVEPOINT active_record_1
62318
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62319
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62320
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
62321
+ Parameters: {"id"=>"1"}
62322
+ ClarkKent::ReportFilter Load (0.3ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62323
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62324
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62325
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_edit.html.erb (4.0ms)
62326
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (11.4ms)
62327
+ Completed 200 OK in 14ms (Views: 11.9ms | ActiveRecord: 0.3ms)
62328
+  (0.4ms) rollback transaction
62329
+  (0.1ms) begin transaction
62330
+ -----------------------------------------------------------------------------------------
62331
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_a_string_filter
62332
+ -----------------------------------------------------------------------------------------
62333
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62334
+  (0.0ms) SAVEPOINT active_record_1
62335
+ SQL (0.5ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62336
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62337
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62338
+  (0.0ms) SAVEPOINT active_record_1
62339
+ SQL (0.1ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:25 UTC], ["updated_at", 2017-03-22 01:01:25 UTC]]
62340
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62341
+ Processing by ClarkKent::ReportFiltersController#show as HTML
62342
+ Parameters: {"id"=>"1"}
62343
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62344
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62345
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62346
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_show.html.erb (0.1ms)
62347
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (2.0ms)
62348
+ Completed 200 OK in 4ms (Views: 2.3ms | ActiveRecord: 0.2ms)
62349
+  (0.4ms) rollback transaction
62350
+  (0.1ms) begin transaction
62351
+ ----------------------------------------------------------------------------------
62352
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_a_date_report_filter
62353
+ ----------------------------------------------------------------------------------
62354
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62355
+  (0.2ms) SAVEPOINT active_record_1
62356
+ SQL (0.5ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62357
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62358
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62359
+ Processing by ClarkKent::ReportFiltersController#create as HTML
62360
+ Parameters: {"report_filter"=>{"duration"=>"week", "filter_name"=>"created_at", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report", "kind_of_day"=>"Monday", "offset"=>"last_week"}}
62361
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62362
+  (0.0ms) SAVEPOINT active_record_1
62363
+ SQL (0.1ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:26 UTC], ["updated_at", 2017-03-22 01:01:26 UTC]]
62364
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62365
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62366
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_show.html.erb (0.1ms)
62367
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (1.9ms)
62368
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (2.1ms)
62369
+ Completed 200 OK in 5ms (Views: 2.3ms | ActiveRecord: 0.3ms)
62370
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
62371
+  (0.5ms) rollback transaction
62372
+  (0.0ms) begin transaction
62373
+ ----------------------------------------------------------------------
62374
+ ClarkKent::ReportsControllerTest: test_0006_should show report results
62375
+ ----------------------------------------------------------------------
62376
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62377
+  (0.1ms) SAVEPOINT active_record_1
62378
+ SQL (0.6ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62379
+  (0.3ms) RELEASE SAVEPOINT active_record_1
62380
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62381
+ Processing by ClarkKent::ReportsController#show as HTML
62382
+ Parameters: {"created_at_from"=>"2017-03-21", "created_at_until"=>"2017-03-21", "current_user_id"=>"1", "run_report"=>"true", "id"=>"1"}
62383
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62384
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
62385
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62386
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
62387
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (1.2ms)
62388
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62389
+ User Load (0.0ms) SELECT "users".* FROM "users"
62390
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.8ms)
62391
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
62392
+  (0.2ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
62393
+  (0.1ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ?) subquery_for_count [["LIMIT", 10], ["OFFSET", 0]]
62394
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.4ms)
62395
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62396
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
62397
+ (SELECT u.name
62398
+ FROM users u
62399
+ WHERE u.id = orders.user_id)
62400
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ? [["LIMIT", 10], ["OFFSET", 0]]
62401
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62402
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62403
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62404
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62405
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.1ms)
62406
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (37.4ms)
62407
+ Completed 200 OK in 251ms (Views: 236.4ms | ActiveRecord: 1.3ms)
62408
+  (0.5ms) rollback transaction
62409
+  (0.1ms) begin transaction
62410
+ -----------------------------------------------------------------
62411
+ ClarkKent::ReportsControllerTest: test_0010_should destroy report
62412
+ -----------------------------------------------------------------
62413
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62414
+  (0.1ms) SAVEPOINT active_record_1
62415
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62416
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62417
+  (0.0ms) SAVEPOINT active_record_1
62418
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["created_at", 2017-03-22 01:01:26 UTC], ["updated_at", 2017-03-22 01:01:26 UTC]]
62419
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62420
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
62421
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62422
+ Processing by ClarkKent::ReportsController#destroy as HTML
62423
+ Parameters: {"current_user_id"=>"1", "id"=>"2"}
62424
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
62425
+  (0.0ms) SAVEPOINT active_record_1
62426
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62427
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62428
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62429
+ SQL (0.1ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
62430
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62431
+ Redirected to http://test.host/reports/reports
62432
+ Completed 302 Found in 7ms (ActiveRecord: 0.5ms)
62433
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
62434
+  (0.7ms) rollback transaction
62435
+  (0.1ms) begin transaction
62436
+ ------------------------------------------------------------
62437
+ ClarkKent::ReportsControllerTest: test_0001_should get index
62438
+ ------------------------------------------------------------
62439
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62440
+  (0.0ms) SAVEPOINT active_record_1
62441
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62442
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62443
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62444
+ Processing by ClarkKent::ReportsController#index as HTML
62445
+ Parameters: {"current_user_id"=>"1"}
62446
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application
62447
+ User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62448
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT ? [["sharing_scope_id", 1], ["sharing_scope_type", "User"], ["LIMIT", 1]]
62449
+ Department Load (0.3ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62450
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["LIMIT", 1]]
62451
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
62452
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
62453
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application (20.6ms)
62454
+ Completed 200 OK in 26ms (Views: 21.7ms | ActiveRecord: 1.0ms)
62455
+  (0.5ms) rollback transaction
62456
+  (0.1ms) begin transaction
62457
+ --------------------------------------------------------------
62458
+ ClarkKent::ReportsControllerTest: test_0005_should show report
62459
+ --------------------------------------------------------------
62460
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62461
+  (0.0ms) SAVEPOINT active_record_1
62462
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62463
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62464
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62465
+ Processing by ClarkKent::ReportsController#show as HTML
62466
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
62467
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62468
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
62469
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
62470
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62471
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.2ms)
62472
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62473
+ User Load (0.0ms) SELECT "users".* FROM "users"
62474
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.2ms)
62475
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
62476
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
62477
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (4.8ms)
62478
+ Completed 200 OK in 11ms (Views: 7.2ms | ActiveRecord: 0.4ms)
62479
+  (0.4ms) rollback transaction
62480
+  (0.1ms) begin transaction
62481
+ ----------------------------------------------------------
62482
+ ClarkKent::ReportsControllerTest: test_0002_should get new
62483
+ ----------------------------------------------------------
62484
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62485
+  (0.0ms) SAVEPOINT active_record_1
62486
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62487
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62488
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62489
+ Processing by ClarkKent::ReportsController#new as HTML
62490
+ Parameters: {"current_user_id"=>"1"}
62491
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application
62492
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62493
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62494
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (12.6ms)
62495
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (16.2ms)
62496
+ Completed 200 OK in 22ms (Views: 18.7ms | ActiveRecord: 0.1ms)
62497
+  (0.4ms) rollback transaction
62498
+  (0.1ms) begin transaction
62499
+ -------------------------------------------------------------------------
62500
+ ClarkKent::ReportsControllerTest: test_0007_should show report run errors
62501
+ -------------------------------------------------------------------------
62502
+ ClarkKent::Report Load (0.5ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62503
+  (0.1ms) SAVEPOINT active_record_1
62504
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62505
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62506
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62507
+ Processing by ClarkKent::ReportsController#show as HTML
62508
+ Parameters: {"current_user_id"=>"1", "run_report"=>"true", "id"=>"1"}
62509
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62510
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
62511
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62512
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
62513
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.5ms)
62514
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62515
+ User Load (0.0ms) SELECT "users".* FROM "users"
62516
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (0.9ms)
62517
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.3ms)
62518
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
62519
+  (0.1ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ?) subquery_for_count [["LIMIT", 10], ["OFFSET", 0]]
62520
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (1.0ms)
62521
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62522
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
62523
+ (SELECT u.name
62524
+ FROM users u
62525
+ WHERE u.id = orders.user_id)
62526
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ? [["LIMIT", 10], ["OFFSET", 0]]
62527
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62528
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62529
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62530
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62531
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (0.3ms)
62532
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (10.6ms)
62533
+ Completed 200 OK in 20ms (Views: 12.5ms | ActiveRecord: 1.0ms)
62534
+  (0.4ms) rollback transaction
62535
+  (0.3ms) begin transaction
62536
+ -----------------------------------------------------------
62537
+ ClarkKent::ReportsControllerTest: test_0008_should get edit
62538
+ -----------------------------------------------------------
62539
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62540
+  (0.0ms) SAVEPOINT active_record_1
62541
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62542
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62543
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62544
+ Processing by ClarkKent::ReportsController#edit as HTML
62545
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
62546
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62547
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application
62548
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (3.5ms)
62549
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62550
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (8.1ms)
62551
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62552
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.7ms)
62553
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (3.4ms)
62554
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
62555
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.6ms)
62556
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.2ms)
62557
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.4ms)
62558
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.2ms)
62559
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
62560
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (30.7ms)
62561
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
62562
+ ClarkKent::ReportDateFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62563
+ User Load (0.2ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 1]]
62564
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (19.3ms)
62565
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (22.5ms)
62566
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (27.5ms)
62567
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (93.0ms)
62568
+ Completed 200 OK in 100ms (Views: 94.2ms | ActiveRecord: 0.8ms)
62569
+  (0.6ms) rollback transaction
62570
+  (0.1ms) begin transaction
62571
+ ----------------------------------------------------------------
62572
+ ClarkKent::ReportsControllerTest: test_0003_should create report
62573
+ ----------------------------------------------------------------
62574
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62575
+  (0.1ms) SAVEPOINT active_record_1
62576
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62577
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62578
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62579
+ Processing by ClarkKent::ReportsController#create as HTML
62580
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"", "sharing_scope_type"=>""}}
62581
+  (0.1ms) SAVEPOINT active_record_1
62582
+ SQL (0.1ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "sharing_scope_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_type", ""], ["created_at", 2017-03-22 01:01:26 UTC], ["updated_at", 2017-03-22 01:01:26 UTC]]
62583
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62584
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application
62585
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (0.9ms)
62586
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62587
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.9ms)
62588
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62589
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (1.6ms)
62590
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62591
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (1.1ms)
62592
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (7.4ms)
62593
+ Completed 200 OK in 12ms (Views: 9.2ms | ActiveRecord: 0.5ms)
62594
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = ? LIMIT ? [["name", "delete me"], ["LIMIT", 1]]
62595
+  (0.0ms) SAVEPOINT active_record_1
62596
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62597
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62598
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62599
+ SQL (0.1ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
62600
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62601
+  (0.5ms) rollback transaction
62602
+  (0.1ms) begin transaction
62603
+ --------------------------------------------------------------------------------
62604
+ ClarkKent::ReportsControllerTest: test_0004_should render errors during creation
62605
+ --------------------------------------------------------------------------------
62606
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62607
+  (0.1ms) SAVEPOINT active_record_1
62608
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62609
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62610
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62611
+ Processing by ClarkKent::ReportsController#create as HTML
62612
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"delete me", "resource_type"=>"", "sharing_scope_id"=>"", "sharing_scope_type"=>""}}
62613
+  (0.0ms) SAVEPOINT active_record_1
62614
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
62615
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application
62616
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62617
+ Department Load (0.0ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62618
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (5.9ms)
62619
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (6.5ms)
62620
+ Completed 409 Conflict in 10ms (Views: 8.3ms | ActiveRecord: 0.2ms)
62621
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = ? LIMIT ? [["name", "delete me"], ["LIMIT", 1]]
62622
+  (0.4ms) rollback transaction
62623
+  (0.1ms) begin transaction
62624
+ ----------------------------------------------------------------
62625
+ ClarkKent::ReportsControllerTest: test_0009_should update report
62626
+ ----------------------------------------------------------------
62627
+ ClarkKent::Report Load (0.5ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62628
+  (0.1ms) SAVEPOINT active_record_1
62629
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62630
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62631
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62632
+ Processing by ClarkKent::ReportsController#update as HTML
62633
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"", "resource_type"=>"Order", "sharing_scope_id"=>"", "sharing_scope_type"=>""}, "id"=>"1"}
62634
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62635
+ ClarkKent::ReportColumn Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? LIMIT ? [["report_id", 1], ["LIMIT", 1]]
62636
+  (0.0ms) SAVEPOINT active_record_1
62637
+ SQL (0.2ms) UPDATE "clark_kent_reports" SET "name" = ?, "sharing_scope_type" = ?, "updated_at" = ? WHERE "clark_kent_reports"."id" = ? [["name", ""], ["sharing_scope_type", ""], ["updated_at", 2017-03-22 01:01:26 UTC], ["id", 1]]
62638
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62639
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.1ms)
62640
+ Completed 200 OK in 8ms (Views: 1.5ms | ActiveRecord: 0.4ms)
62641
+  (0.4ms) rollback transaction
62642
+ ActiveRecord::SchemaMigration Load (0.2ms) SELECT "schema_migrations".* FROM "schema_migrations"
62643
+  (1.9ms) CREATE TABLE "clark_kent_report_columns" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "column_name" varchar, "column_order" integer, "report_sort" varchar, "summary_method" varchar)
62644
+  (0.1ms) select sqlite_version(*)
62645
+  (1.6ms) CREATE INDEX "index_clark_kent_report_columns_on_report_id" ON "clark_kent_report_columns" ("report_id")
62646
+  (1.1ms) CREATE TABLE "clark_kent_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "report_id" integer, "when_to_send" varchar, "name" varchar)
62647
+  (1.0ms) CREATE TABLE "clark_kent_report_filters" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "filterable_id" integer, "filterable_type" varchar DEFAULT 'ClarkKent::Report', "string" varchar DEFAULT 'ClarkKent::Report', "filter_name" varchar, "filter_value" varchar, "type" varchar, "duration" varchar, "kind_of_day" varchar, "offset" varchar, "created_at" datetime, "updated_at" datetime)
62648
+  (0.8ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_id" ON "clark_kent_report_filters" ("filterable_id")
62649
+  (0.1ms)  SELECT sql
62650
+ FROM sqlite_master
62651
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
62652
+ UNION ALL
62653
+ SELECT sql
62654
+ FROM sqlite_temp_master
62655
+ WHERE name='index_clark_kent_report_filters_on_filterable_id' AND type='index'
62656
+ 
62657
+  (1.1ms) CREATE INDEX "index_clark_kent_report_filters_on_filterable_type" ON "clark_kent_report_filters" ("filterable_type")
62658
+  (0.9ms) CREATE TABLE "clark_kent_reports" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "resource_type" varchar, "sharing_scope_type" varchar, "sharing_scope_id" integer, "created_at" datetime, "updated_at" datetime)
62659
+  (0.9ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_id" ON "clark_kent_reports" ("sharing_scope_id")
62660
+  (0.1ms)  SELECT sql
62661
+ FROM sqlite_master
62662
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
62663
+ UNION ALL
62664
+ SELECT sql
62665
+ FROM sqlite_temp_master
62666
+ WHERE name='index_clark_kent_reports_on_sharing_scope_id' AND type='index'
62667
+ 
62668
+  (0.8ms) CREATE INDEX "index_clark_kent_reports_on_sharing_scope_type" ON "clark_kent_reports" ("sharing_scope_type")
62669
+  (0.8ms) CREATE TABLE "clark_kent_user_report_emails" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "report_email_id" integer)
62670
+  (0.9ms) CREATE TABLE "departments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar)
62671
+  (0.9ms) CREATE TABLE "orders" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "user_id" integer, "amount" integer, "description" varchar, "created_at" datetime, "updated_at" datetime)
62672
+  (0.8ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "email" varchar, "age" integer, "department_id" integer)
62673
+  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
62674
+  (0.1ms) SELECT version FROM "schema_migrations"
62675
+  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20150313144015')
62676
+  (0.7ms) INSERT INTO schema_migrations (version) VALUES
62677
+ ('20131226170042'),
62678
+ ('20131226170112'),
62679
+ ('20140114010048'),
62680
+ ('20140129051754'),
62681
+ ('20150304233739');
62682
+
62683
+ 
62684
+  (1.1ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
62685
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]]
62686
+  (0.1ms) begin transaction
62687
+ SQL (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "test"], ["created_at", 2017-03-22 01:01:34 UTC], ["updated_at", 2017-03-22 01:01:34 UTC]]
62688
+  (0.6ms) commit transaction
62689
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", :environment], ["LIMIT", 1]]
62690
+  (0.0ms) begin transaction
62691
+  (0.0ms) commit transaction
62692
+  (0.1ms) begin transaction
62693
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("resource_type", "created_at", "updated_at") VALUES (?, ?, ?) [["resource_type", "Order"], ["created_at", 2017-03-22 01:01:34 UTC], ["updated_at", 2017-03-22 01:01:34 UTC]]
62694
+  (0.8ms) commit transaction
62695
+  (0.1ms) begin transaction
62696
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "user_name"], ["column_order", 1]]
62697
+  (0.7ms) commit transaction
62698
+  (0.0ms) begin transaction
62699
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "id"], ["column_order", 2]]
62700
+  (0.7ms) commit transaction
62701
+  (0.1ms) begin transaction
62702
+ SQL (0.3ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "amount"], ["column_order", 3]]
62703
+  (0.8ms) commit transaction
62704
+  (0.0ms) begin transaction
62705
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name", "column_order") VALUES (?, ?, ?) [["report_id", 1], ["column_name", "description"], ["column_order", 4]]
62706
+  (0.8ms) commit transaction
62707
+  (0.0ms) begin transaction
62708
+ SQL (0.3ms) INSERT INTO "departments" ("name") VALUES (?) [["name", "silly walks"]]
62709
+  (0.8ms) commit transaction
62710
+  (0.0ms) begin transaction
62711
+ SQL (0.3ms) INSERT INTO "users" ("name", "email", "department_id") VALUES (?, ?, ?) [["name", "Michael Hedges"], ["email", "taproot@gmail.com"], ["department_id", 1]]
62712
+  (0.7ms) commit transaction
62713
+  (0.1ms) begin transaction
62714
+ SQL (0.3ms) INSERT INTO "orders" ("user_id", "amount", "description", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["user_id", 1], ["amount", 1], ["description", "Guitar strings"], ["created_at", 2017-03-22 01:01:34 UTC], ["updated_at", 2017-03-22 01:01:34 UTC]]
62715
+  (0.7ms) commit transaction
62716
+  (0.1ms) begin transaction
62717
+ ---------------------------------------------------
62718
+ ClarkKent::ReportEmailTest: test_sends_report_to_s3
62719
+ ---------------------------------------------------
62720
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "taproot@gmail.com"], ["LIMIT", 1]]
62721
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62722
+ SQL (0.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
62723
+  (0.1ms) SAVEPOINT active_record_1
62724
+ SQL (0.2ms) INSERT INTO "clark_kent_report_emails" ("report_id", "name") VALUES (?, ?) [["report_id", 1], ["name", "test_emailer"]]
62725
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62726
+  (0.1ms) SAVEPOINT active_record_1
62727
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "this_week"], ["created_at", 2017-03-22 01:01:34 UTC], ["updated_at", 2017-03-22 01:01:34 UTC]]
62728
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62729
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62730
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62731
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62732
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62733
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62734
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62735
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62736
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62737
+  (0.3ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
62738
+  (1.2ms) rollback transaction
62739
+  (0.1ms) begin transaction
62740
+ -----------------------------------------------------------------------------------------
62741
+ ClarkKent::ReportEmailTest: test_throws_an_error_if_required_date_filters_are_not_present
62742
+ -----------------------------------------------------------------------------------------
62743
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."email" = ? LIMIT ? [["email", "taproot@gmail.com"], ["LIMIT", 1]]
62744
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62745
+ SQL (0.3ms) UPDATE "clark_kent_reports" SET "sharing_scope_type" = 'Department', "sharing_scope_id" = 1 WHERE "clark_kent_reports"."id" = ? [["id", 1]]
62746
+  (0.0ms) SAVEPOINT active_record_1
62747
+ SQL (0.1ms) INSERT INTO "clark_kent_report_emails" ("report_id", "name") VALUES (?, ?) [["report_id", 1], ["name", "test_emailer"]]
62748
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62749
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62750
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62751
+ Department Load (0.0ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62752
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62753
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62754
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62755
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62756
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62757
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62758
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62759
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/report_mailer/report_error.html.erb
62760
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_mailer/report_error.html.erb (1.2ms)
62761
+ ClarkKent::ReportMailer#report_error: processed outbound mail in 162.5ms
62762
+ Sent mail to taproot@gmail.com (4.6ms)
62763
+ Date: Tue, 21 Mar 2017 19:01:35 -0600
62764
+ From: reservations@invitedhome.com
62765
+ To: taproot@gmail.com
62766
+ Message-ID: <58d1ccef1343d_8d2e3fefe903fa0c61261@Erics-MacBook-Pro.local.mail>
62767
+ Subject: Your report has a problem
62768
+ Mime-Version: 1.0
62769
+ Content-Type: text/html;
62770
+ charset=UTF-8
62771
+ Content-Transfer-Encoding: 7bit
62772
+
62773
+ Your report could not be created due to the following problem:
62774
+ <strong>At least one date range is required.</strong>
62775
+  (1.2ms) rollback transaction
62776
+  (0.1ms) begin transaction
62777
+ -----------------------------------------------------
62778
+ ClarkKent::ReportsHelperTest: test_it_displays_a_date
62779
+ -----------------------------------------------------
62780
+  (0.1ms) rollback transaction
62781
+  (0.1ms) begin transaction
62782
+ ----------------------------------------------------------
62783
+ ClarkKent::ReportsControllerTest: test_0002_should get new
62784
+ ----------------------------------------------------------
62785
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62786
+  (0.1ms) SAVEPOINT active_record_1
62787
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62788
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62789
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62790
+ Processing by ClarkKent::ReportsController#new as HTML
62791
+ Parameters: {"current_user_id"=>"1"}
62792
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application
62793
+ User Load (0.2ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62794
+ Department Load (0.0ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62795
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (43.3ms)
62796
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (49.0ms)
62797
+ Completed 200 OK in 209ms (Views: 205.4ms | ActiveRecord: 0.2ms)
62798
+  (1.2ms) rollback transaction
62799
+  (0.1ms) begin transaction
62800
+ ------------------------------------------------------------
62801
+ ClarkKent::ReportsControllerTest: test_0001_should get index
62802
+ ------------------------------------------------------------
62803
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62804
+  (0.1ms) SAVEPOINT active_record_1
62805
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62806
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62807
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62808
+ Processing by ClarkKent::ReportsController#index as HTML
62809
+ Parameters: {"current_user_id"=>"1"}
62810
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application
62811
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62812
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT ? [["sharing_scope_id", 1], ["sharing_scope_type", "User"], ["LIMIT", 1]]
62813
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62814
+ ClarkKent::Report Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" = ? AND "clark_kent_reports"."sharing_scope_type" = ? LIMIT ? [["sharing_scope_id", 1], ["sharing_scope_type", "Department"], ["LIMIT", 1]]
62815
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
62816
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."sharing_scope_id" IS NULL
62817
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/index.html.erb within layouts/application (12.4ms)
62818
+ Completed 200 OK in 17ms (Views: 13.8ms | ActiveRecord: 0.4ms)
62819
+  (0.6ms) rollback transaction
62820
+  (0.1ms) begin transaction
62821
+ -------------------------------------------------------------------------
62822
+ ClarkKent::ReportsControllerTest: test_0007_should show report run errors
62823
+ -------------------------------------------------------------------------
62824
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62825
+  (0.0ms) SAVEPOINT active_record_1
62826
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62827
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62828
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62829
+ Processing by ClarkKent::ReportsController#show as HTML
62830
+ Parameters: {"current_user_id"=>"1", "run_report"=>"true", "id"=>"1"}
62831
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62832
+ ClarkKent::ReportColumn Load (0.4ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
62833
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62834
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
62835
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (2.0ms)
62836
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62837
+ User Load (0.1ms) SELECT "users".* FROM "users"
62838
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.9ms)
62839
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.5ms)
62840
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.6ms)
62841
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (17.7ms)
62842
+ Completed 200 OK in 31ms (Views: 19.4ms | ActiveRecord: 0.8ms)
62843
+  (0.6ms) rollback transaction
62844
+  (0.1ms) begin transaction
62845
+ --------------------------------------------------------------------------------
62846
+ ClarkKent::ReportsControllerTest: test_0004_should render errors during creation
62847
+ --------------------------------------------------------------------------------
62848
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62849
+  (0.1ms) SAVEPOINT active_record_1
62850
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62851
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62852
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62853
+ Processing by ClarkKent::ReportsController#create as HTML
62854
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"delete me", "resource_type"=>"", "sharing_scope_id"=>"", "sharing_scope_type"=>""}}
62855
+  (0.1ms) SAVEPOINT active_record_1
62856
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
62857
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application
62858
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? ORDER BY "users"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62859
+ Department Load (0.1ms) SELECT "departments".* FROM "departments" WHERE "departments"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62860
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_edit.html.erb (7.4ms)
62861
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/new.html.erb within layouts/application (8.1ms)
62862
+ Completed 409 Conflict in 13ms (Views: 10.2ms | ActiveRecord: 0.3ms)
62863
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = ? LIMIT ? [["name", "delete me"], ["LIMIT", 1]]
62864
+  (0.5ms) rollback transaction
62865
+  (0.1ms) begin transaction
62866
+ ----------------------------------------------------------------
62867
+ ClarkKent::ReportsControllerTest: test_0009_should update report
62868
+ ----------------------------------------------------------------
62869
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62870
+  (0.0ms) SAVEPOINT active_record_1
62871
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62872
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62873
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62874
+ Processing by ClarkKent::ReportsController#update as HTML
62875
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"", "resource_type"=>"Order", "sharing_scope_id"=>"", "sharing_scope_type"=>""}, "id"=>"1"}
62876
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62877
+ ClarkKent::ReportColumn Exists (0.1ms) SELECT 1 AS one FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? LIMIT ? [["report_id", 1], ["LIMIT", 1]]
62878
+  (0.0ms) SAVEPOINT active_record_1
62879
+ SQL (0.2ms) UPDATE "clark_kent_reports" SET "name" = ?, "sharing_scope_type" = ?, "updated_at" = ? WHERE "clark_kent_reports"."id" = ? [["name", ""], ["sharing_scope_type", ""], ["updated_at", 2017-03-22 01:01:35 UTC], ["id", 1]]
62880
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62881
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (2.7ms)
62882
+ Completed 200 OK in 14ms (Views: 5.8ms | ActiveRecord: 0.4ms)
62883
+  (0.4ms) rollback transaction
62884
+  (0.1ms) begin transaction
62885
+ --------------------------------------------------------------
62886
+ ClarkKent::ReportsControllerTest: test_0005_should show report
62887
+ --------------------------------------------------------------
62888
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62889
+  (0.0ms) SAVEPOINT active_record_1
62890
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62891
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62892
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62893
+ Processing by ClarkKent::ReportsController#show as HTML
62894
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
62895
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
62896
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
62897
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
62898
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62899
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.5ms)
62900
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62901
+ User Load (0.0ms) SELECT "users".* FROM "users"
62902
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.0ms)
62903
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
62904
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (0.0ms)
62905
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (4.0ms)
62906
+ Completed 200 OK in 9ms (Views: 6.6ms | ActiveRecord: 0.4ms)
62907
+  (0.4ms) rollback transaction
62908
+  (0.1ms) begin transaction
62909
+ -----------------------------------------------------------------
62910
+ ClarkKent::ReportsControllerTest: test_0010_should destroy report
62911
+ -----------------------------------------------------------------
62912
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62913
+  (0.0ms) SAVEPOINT active_record_1
62914
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62915
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62916
+  (0.1ms) SAVEPOINT active_record_1
62917
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
62918
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62919
+  (0.0ms) SELECT COUNT(*) FROM "clark_kent_reports"
62920
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62921
+ Processing by ClarkKent::ReportsController#destroy as HTML
62922
+ Parameters: {"current_user_id"=>"1", "id"=>"2"}
62923
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
62924
+  (0.0ms) SAVEPOINT active_record_1
62925
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62926
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62927
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62928
+ SQL (0.1ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
62929
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62930
+ Redirected to http://test.host/reports/reports
62931
+ Completed 302 Found in 7ms (ActiveRecord: 0.5ms)
62932
+  (0.1ms) SELECT COUNT(*) FROM "clark_kent_reports"
62933
+  (0.4ms) rollback transaction
62934
+  (0.1ms) begin transaction
62935
+ ----------------------------------------------------------------
62936
+ ClarkKent::ReportsControllerTest: test_0003_should create report
62937
+ ----------------------------------------------------------------
62938
+ ClarkKent::Report Load (0.4ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62939
+  (0.1ms) SAVEPOINT active_record_1
62940
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62941
+  (0.1ms) RELEASE SAVEPOINT active_record_1
62942
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62943
+ Processing by ClarkKent::ReportsController#create as HTML
62944
+ Parameters: {"current_user_id"=>"1", "report"=>{"name"=>"delete me", "resource_type"=>"Order", "sharing_scope_id"=>"", "sharing_scope_type"=>""}}
62945
+  (0.0ms) SAVEPOINT active_record_1
62946
+ SQL (0.2ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "sharing_scope_type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?) [["name", "delete me"], ["resource_type", "Order"], ["sharing_scope_type", ""], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
62947
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62948
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application
62949
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.0ms)
62950
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62951
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (4.8ms)
62952
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62953
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (2.6ms)
62954
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62955
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (2.7ms)
62956
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (20.1ms)
62957
+ Completed 200 OK in 29ms (Views: 26.4ms | ActiveRecord: 0.6ms)
62958
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."name" = ? LIMIT ? [["name", "delete me"], ["LIMIT", 1]]
62959
+  (0.0ms) SAVEPOINT active_record_1
62960
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
62961
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
62962
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 2]]
62963
+ SQL (0.1ms) DELETE FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? [["id", 2]]
62964
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62965
+  (0.5ms) rollback transaction
62966
+  (0.1ms) begin transaction
62967
+ -----------------------------------------------------------
62968
+ ClarkKent::ReportsControllerTest: test_0008_should get edit
62969
+ -----------------------------------------------------------
62970
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
62971
+  (0.0ms) SAVEPOINT active_record_1
62972
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
62973
+  (0.0ms) RELEASE SAVEPOINT active_record_1
62974
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
62975
+ Processing by ClarkKent::ReportsController#edit as HTML
62976
+ Parameters: {"current_user_id"=>"1", "id"=>"1"}
62977
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
62978
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application
62979
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_show.html.erb (1.5ms)
62980
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
62981
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_index.html.erb (2.8ms)
62982
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
62983
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
62984
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (4.5ms)
62985
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
62986
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
62987
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.4ms)
62988
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
62989
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (0.3ms)
62990
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (0.5ms)
62991
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_index.html.erb (11.9ms)
62992
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."report_id" = ? [["report_id", 1]]
62993
+ ClarkKent::ReportDateFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."type" IN ('ClarkKent::ReportDateFilter') AND "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"]]
62994
+ User Load (0.2ms) SELECT "users".* FROM "users" INNER JOIN "clark_kent_user_report_emails" ON "users"."id" = "clark_kent_user_report_emails"."user_id" WHERE "clark_kent_user_report_emails"."report_email_id" = ? [["report_email_id", 1]]
62995
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show.html.erb (35.7ms)
62996
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_show_wrapper.html.erb (38.6ms)
62997
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_emails/_index.html.erb (43.1ms)
62998
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/edit.html.erb within layouts/application (60.5ms)
62999
+ Completed 200 OK in 64ms (Views: 62.8ms | ActiveRecord: 0.7ms)
63000
+  (0.5ms) rollback transaction
63001
+  (0.1ms) begin transaction
63002
+ ----------------------------------------------------------------------
63003
+ ClarkKent::ReportsControllerTest: test_0006_should show report results
63004
+ ----------------------------------------------------------------------
63005
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63006
+  (0.1ms) SAVEPOINT active_record_1
63007
+ SQL (0.4ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63008
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63009
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63010
+ Processing by ClarkKent::ReportsController#show as HTML
63011
+ Parameters: {"created_at_from"=>"2017-03-21", "created_at_until"=>"2017-03-21", "current_user_id"=>"1", "run_report"=>"true", "id"=>"1"}
63012
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["id", 1], ["LIMIT", 1]]
63013
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = 1 ORDER BY clark_kent_report_columns.column_order
63014
+ ClarkKent::ReportFilter Load (0.4ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 1], ["filterable_type", "ClarkKent::Report"]]
63015
+ Rendering /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application
63016
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_date_filter.html.erb (0.6ms)
63017
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63018
+ User Load (0.0ms) SELECT "users".* FROM "users"
63019
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_object_filter.html.erb (1.2ms)
63020
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_string_filter.html.erb (0.1ms)
63021
+  (0.1ms) SELECT COUNT(*) FROM "orders" WHERE (orders.user_id > 0)
63022
+  (0.2ms) SELECT COUNT(count_column) FROM (SELECT "orders"."id" AS count_column FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ?) subquery_for_count [["LIMIT", 10], ["OFFSET", 0]]
63023
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_print_report.html.erb (5.9ms)
63024
+ ClarkKent::ReportColumn Load (0.7ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
63025
+ Order Load (0.1ms) SELECT DISTINCT orders.id, orders.user_id, orders.amount, orders.description, orders.created_at, orders.updated_at,
63026
+ (SELECT u.name
63027
+ FROM users u
63028
+ WHERE u.id = orders.user_id)
63029
+ as user_name FROM "orders" WHERE (orders.user_id > 0) LIMIT ? OFFSET ? [["LIMIT", 10], ["OFFSET", 0]]
63030
+ ClarkKent::Report Load (0.5ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63031
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63032
+ ClarkKent::Report Load (0.8ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63033
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63034
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/_download_link.html.erb (1.4ms)
63035
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/reports/show.html.erb within layouts/application (30.7ms)
63036
+ Completed 200 OK in 42ms (Views: 31.2ms | ActiveRecord: 3.3ms)
63037
+  (0.6ms) rollback transaction
63038
+  (0.4ms) begin transaction
63039
+ ---------------------------------------------------------------------------------------
63040
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_a_date_filter
63041
+ ---------------------------------------------------------------------------------------
63042
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63043
+  (0.1ms) SAVEPOINT active_record_1
63044
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63045
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63046
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63047
+  (0.0ms) SAVEPOINT active_record_1
63048
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63049
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63050
+ Processing by ClarkKent::ReportFiltersController#show as HTML
63051
+ Parameters: {"id"=>"1"}
63052
+ ClarkKent::ReportFilter Load (0.2ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63053
+ ClarkKent::ReportEmail Load (0.1ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63054
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63055
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_show.html.erb (0.4ms)
63056
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (7.2ms)
63057
+ Completed 200 OK in 16ms (Views: 10.5ms | ActiveRecord: 0.3ms)
63058
+  (0.5ms) rollback transaction
63059
+  (0.1ms) begin transaction
63060
+ ------------------------------------------------------------------------------------------
63061
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_an_object_filter
63062
+ ------------------------------------------------------------------------------------------
63063
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63064
+  (0.1ms) SAVEPOINT active_record_1
63065
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63066
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63067
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63068
+  (0.0ms) SAVEPOINT active_record_1
63069
+ SQL (0.5ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63070
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63071
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
63072
+ Parameters: {"id"=>"1"}
63073
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63074
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63075
+ ClarkKent::Report Load (0.5ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63076
+ User Load (0.1ms) SELECT "users".* FROM "users"
63077
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_edit.html.erb (4.7ms)
63078
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (21.0ms)
63079
+ Completed 200 OK in 27ms (Views: 23.4ms | ActiveRecord: 0.7ms)
63080
+  (1.1ms) rollback transaction
63081
+  (0.1ms) begin transaction
63082
+ ------------------------------------------------------------------------------------------
63083
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_an_object_filter
63084
+ ------------------------------------------------------------------------------------------
63085
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63086
+  (0.0ms) SAVEPOINT active_record_1
63087
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63088
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63089
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63090
+  (0.0ms) SAVEPOINT active_record_1
63091
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63092
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63093
+ Processing by ClarkKent::ReportFiltersController#show as HTML
63094
+ Parameters: {"id"=>"1"}
63095
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63096
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63097
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63098
+ User Load (0.1ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63099
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_show.html.erb (0.8ms)
63100
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (5.2ms)
63101
+ Completed 200 OK in 7ms (Views: 5.4ms | ActiveRecord: 0.2ms)
63102
+  (0.4ms) rollback transaction
63103
+  (0.1ms) begin transaction
63104
+ -----------------------------------------------------------------------------------------
63105
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_a_string_filter
63106
+ -----------------------------------------------------------------------------------------
63107
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63108
+  (0.1ms) SAVEPOINT active_record_1
63109
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63110
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63111
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63112
+  (0.0ms) SAVEPOINT active_record_1
63113
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63114
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63115
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
63116
+ Parameters: {"id"=>"1"}
63117
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63118
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63119
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63120
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_edit.html.erb (0.3ms)
63121
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (7.7ms)
63122
+ Completed 200 OK in 10ms (Views: 8.0ms | ActiveRecord: 0.2ms)
63123
+  (0.6ms) rollback transaction
63124
+  (0.1ms) begin transaction
63125
+ ----------------------------------------------------------------------------------
63126
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_a_date_report_filter
63127
+ ----------------------------------------------------------------------------------
63128
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63129
+  (0.0ms) SAVEPOINT active_record_1
63130
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63131
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63132
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63133
+ Processing by ClarkKent::ReportFiltersController#create as HTML
63134
+ Parameters: {"report_filter"=>{"duration"=>"week", "filter_name"=>"created_at", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report", "kind_of_day"=>"Monday", "offset"=>"last_week"}}
63135
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63136
+  (0.1ms) SAVEPOINT active_record_1
63137
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63138
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63139
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63140
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_show.html.erb (0.0ms)
63141
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (2.1ms)
63142
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (2.6ms)
63143
+ Completed 200 OK in 9ms (Views: 5.5ms | ActiveRecord: 0.4ms)
63144
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
63145
+  (0.5ms) rollback transaction
63146
+  (0.1ms) begin transaction
63147
+ -------------------------------------------------------------------------------------
63148
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_an_object_report_filter
63149
+ -------------------------------------------------------------------------------------
63150
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63151
+  (0.0ms) SAVEPOINT active_record_1
63152
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63153
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63154
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63155
+ Processing by ClarkKent::ReportFiltersController#create as HTML
63156
+ Parameters: {"report_filter"=>{"filter_name"=>"user_id", "filter_value"=>"1", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report"}}
63157
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63158
+  (0.1ms) SAVEPOINT active_record_1
63159
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "user_id"], ["filter_value", "1"], ["type", "ClarkKent::ReportObjectFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63160
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63161
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63162
+ User Load (0.0ms) SELECT "users".* FROM "users" WHERE "users"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63163
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_object_filter_show.html.erb (0.4ms)
63164
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (2.5ms)
63165
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (2.6ms)
63166
+ Completed 200 OK in 7ms (Views: 2.9ms | ActiveRecord: 0.5ms)
63167
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
63168
+  (0.4ms) rollback transaction
63169
+  (0.1ms) begin transaction
63170
+ ---------------------------------------------------------------------------------------
63171
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_edit_form_for_a_date_filter
63172
+ ---------------------------------------------------------------------------------------
63173
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63174
+  (0.0ms) SAVEPOINT active_record_1
63175
+ SQL (0.5ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63176
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63177
+ User Load (0.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63178
+  (0.1ms) SAVEPOINT active_record_1
63179
+ SQL (0.2ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "type", "duration", "kind_of_day", "offset", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "created_at"], ["type", "ClarkKent::ReportDateFilter"], ["duration", "week"], ["kind_of_day", "Monday"], ["offset", "last_week"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63180
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63181
+ Processing by ClarkKent::ReportFiltersController#edit as HTML
63182
+ Parameters: {"id"=>"1"}
63183
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63184
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63185
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63186
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_date_filter_edit.html.erb (6.2ms)
63187
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_form.html.erb (13.1ms)
63188
+ Completed 200 OK in 16ms (Views: 13.4ms | ActiveRecord: 0.1ms)
63189
+  (0.5ms) rollback transaction
63190
+  (0.1ms) begin transaction
63191
+ -----------------------------------------------------------------------------------------
63192
+ ClarkKent::ReportFiltersControllerTest: test_should_get_the_show_view_for_a_string_filter
63193
+ -----------------------------------------------------------------------------------------
63194
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63195
+  (0.1ms) SAVEPOINT active_record_1
63196
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63197
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63198
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63199
+  (0.0ms) SAVEPOINT active_record_1
63200
+ SQL (0.1ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filterable_type", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filterable_type", "ClarkKent::ReportEmail"], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63201
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63202
+ Processing by ClarkKent::ReportFiltersController#show as HTML
63203
+ Parameters: {"id"=>"1"}
63204
+ ClarkKent::ReportFilter Load (0.0ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63205
+ ClarkKent::ReportEmail Load (0.0ms) SELECT "clark_kent_report_emails".* FROM "clark_kent_report_emails" WHERE "clark_kent_report_emails"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63206
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63207
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_show.html.erb (0.4ms)
63208
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (5.6ms)
63209
+ Completed 200 OK in 8ms (Views: 6.0ms | ActiveRecord: 0.1ms)
63210
+  (0.5ms) rollback transaction
63211
+  (0.1ms) begin transaction
63212
+ -----------------------------------------------------------------------------
63213
+ ClarkKent::ReportFiltersControllerTest: test_it_should_create_a_report_filter
63214
+ -----------------------------------------------------------------------------
63215
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63216
+  (0.0ms) SAVEPOINT active_record_1
63217
+ SQL (0.3ms) INSERT INTO "clark_kent_report_emails" ("report_id", "when_to_send", "name") VALUES (?, ?, ?) [["report_id", 1], ["when_to_send", "Monday"], ["name", "Owner Arrival"]]
63218
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63219
+ User Load (0.0ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT ? [["LIMIT", 1]]
63220
+ Processing by ClarkKent::ReportFiltersController#create as HTML
63221
+ Parameters: {"report_filter"=>{"filter_name"=>"user_email", "filter_value"=>"taproot@gmail.com", "filterable_id"=>"1", "filterable_type"=>"ClarkKent::Report"}}
63222
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63223
+  (0.0ms) SAVEPOINT active_record_1
63224
+ SQL (0.1ms) INSERT INTO "clark_kent_report_filters" ("filterable_id", "filter_name", "filter_value", "type", "created_at", "updated_at") VALUES (?, ?, ?, ?, ?, ?) [["filterable_id", 1], ["filter_name", "user_email"], ["filter_value", "taproot@gmail.com"], ["type", "ClarkKent::ReportStringFilter"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63225
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63226
+ ClarkKent::Report Load (0.0ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63227
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_string_filter_show.html.erb (0.0ms)
63228
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show.html.erb (1.8ms)
63229
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_filters/_show_wrapper.html.erb (2.0ms)
63230
+ Completed 200 OK in 5ms (Views: 2.3ms | ActiveRecord: 0.3ms)
63231
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" ORDER BY "clark_kent_report_filters"."id" DESC LIMIT ? [["LIMIT", 1]]
63232
+  (0.4ms) rollback transaction
63233
+  (0.1ms) begin transaction
63234
+ ------------------------------------------------------------------------------------------------
63235
+ ClarkKent::ReportTest: test_can't_save_without_a_sharing_scope_id_if_the_sharing_scope_is_custom
63236
+ ------------------------------------------------------------------------------------------------
63237
+  (0.0ms) SAVEPOINT active_record_1
63238
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
63239
+  (0.0ms) rollback transaction
63240
+  (0.0ms) begin transaction
63241
+ --------------------------------------------------------------------------
63242
+ ClarkKent::ReportableTest: test_0003_doesn't blow up if order_sql is blank
63243
+ --------------------------------------------------------------------------
63244
+  (0.0ms) SAVEPOINT active_record_1
63245
+ SQL (0.3ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63246
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63247
+  (0.1ms) SAVEPOINT active_record_1
63248
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 2], ["LIMIT", 1]]
63249
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63250
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
63251
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
63252
+  (0.4ms) rollback transaction
63253
+  (0.1ms) begin transaction
63254
+ ------------------------------------------------------------------------
63255
+ ClarkKent::ReportableTest: test_0001_it adds required filters if present
63256
+ ------------------------------------------------------------------------
63257
+  (0.0ms) SAVEPOINT active_record_1
63258
+ SQL (0.5ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "Order"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63259
+  (0.2ms) RELEASE SAVEPOINT active_record_1
63260
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
63261
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
63262
+  (0.4ms) rollback transaction
63263
+  (0.1ms) begin transaction
63264
+ --------------------------------------------------------------------------
63265
+ ClarkKent::ReportableTest: test_0002_it works without any required filters
63266
+ --------------------------------------------------------------------------
63267
+  (0.0ms) SAVEPOINT active_record_1
63268
+ SQL (0.4ms) INSERT INTO "clark_kent_reports" ("name", "resource_type", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["name", "test one"], ["resource_type", "TestReportable"], ["created_at", 2017-03-22 01:01:35 UTC], ["updated_at", 2017-03-22 01:01:35 UTC]]
63269
+  (0.0ms) RELEASE SAVEPOINT active_record_1
63270
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 2]]
63271
+ ClarkKent::ReportFilter Load (0.1ms) SELECT "clark_kent_report_filters".* FROM "clark_kent_report_filters" WHERE "clark_kent_report_filters"."filterable_id" = ? AND "clark_kent_report_filters"."filterable_type" = ? [["filterable_id", 2], ["filterable_type", "ClarkKent::Report"]]
63272
+  (0.4ms) rollback transaction
63273
+  (0.1ms) begin transaction
63274
+ --------------------------------------------------------------------------------------------------
63275
+ ClarkKent::ReportColumnsControllerTest: test_0003_should reject a report column with unusable sort
63276
+ --------------------------------------------------------------------------------------------------
63277
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63278
+ Processing by ClarkKent::ReportColumnsController#create as JS
63279
+ Parameters: {"report_column"=>{"column_name"=>"user_name", "report_id"=>"1", "report_sort"=>"ascending"}}
63280
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63281
+  (0.1ms) SAVEPOINT active_record_1
63282
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63283
+  (0.1ms) ROLLBACK TO SAVEPOINT active_record_1
63284
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
63285
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
63286
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_form.html.erb (21.8ms)
63287
+ Completed 409 Conflict in 68ms (Views: 62.5ms | ActiveRecord: 0.7ms)
63288
+  (0.1ms) rollback transaction
63289
+  (0.1ms) begin transaction
63290
+ -------------------------------------------------------------------------------
63291
+ ClarkKent::ReportColumnsControllerTest: test_0001_should create a report column
63292
+ -------------------------------------------------------------------------------
63293
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63294
+ Processing by ClarkKent::ReportColumnsController#create as JS
63295
+ Parameters: {"report_column"=>{"column_name"=>"user_name", "report_id"=>"1"}}
63296
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63297
+  (0.1ms) SAVEPOINT active_record_1
63298
+ SQL (0.4ms) INSERT INTO "clark_kent_report_columns" ("report_id", "column_name") VALUES (?, ?) [["report_id", 1], ["column_name", "user_name"]]
63299
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63300
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show.html.erb (1.1ms)
63301
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_show_wrapper.html.erb (36.9ms)
63302
+ Completed 200 OK in 73ms (Views: 70.0ms | ActiveRecord: 0.6ms)
63303
+  (2.1ms) rollback transaction
63304
+  (0.2ms) begin transaction
63305
+ ---------------------------------------------------------------------------------------------------
63306
+ ClarkKent::ReportColumnsControllerTest: test_0002_should reject a report column with no column_name
63307
+ ---------------------------------------------------------------------------------------------------
63308
+ ClarkKent::Report Load (0.2ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63309
+ Processing by ClarkKent::ReportColumnsController#create as JS
63310
+ Parameters: {"report_column"=>{"report_id"=>"1"}}
63311
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63312
+  (0.1ms) SAVEPOINT active_record_1
63313
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
63314
+ ClarkKent::ReportColumn Load (0.2ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
63315
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63316
+ ClarkKent::ReportColumn Load (0.1ms) SELECT "clark_kent_report_columns".* FROM "clark_kent_report_columns" WHERE "clark_kent_report_columns"."report_id" = ? ORDER BY clark_kent_report_columns.column_order [["report_id", 1]]
63317
+ Rendered /Users/eric/projects/clark_kent/app/views/clark_kent/report_columns/_form.html.erb (8.5ms)
63318
+ Completed 409 Conflict in 11ms (Views: 8.4ms | ActiveRecord: 0.6ms)
63319
+  (0.1ms) rollback transaction
63320
+  (0.0ms) begin transaction
63321
+ --------------------------------------------------------------------------
63322
+ ClarkKent::ReportColumnTest: test_0001_rejects report sort if no order_sql
63323
+ --------------------------------------------------------------------------
63324
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" ORDER BY "clark_kent_reports"."id" ASC LIMIT ? [["LIMIT", 1]]
63325
+  (0.0ms) SAVEPOINT active_record_1
63326
+ ClarkKent::Report Load (0.1ms) SELECT "clark_kent_reports".* FROM "clark_kent_reports" WHERE "clark_kent_reports"."id" = ? LIMIT ? [["id", 1], ["LIMIT", 1]]
63327
+  (0.1ms) RELEASE SAVEPOINT active_record_1
63328
+  (0.1ms) rollback transaction
63329
+  (0.0ms) begin transaction
63330
+ -------------------------
63331
+ ClarkKentTest: test_truth
63332
+ -------------------------
63333
+  (0.0ms) rollback transaction