approval 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (166) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +38 -16
  3. data/Rakefile +9 -3
  4. data/lib/approval/config.rb +19 -0
  5. data/lib/approval/engine.rb +12 -0
  6. data/lib/approval/mixins/resource.rb +24 -0
  7. data/lib/approval/mixins/user.rb +36 -0
  8. data/lib/approval/mixins.rb +19 -0
  9. data/lib/approval/models/approval/comment.rb +10 -0
  10. data/lib/approval/models/approval/item.rb +60 -0
  11. data/lib/approval/models/approval/request.rb +43 -0
  12. data/lib/approval/models/approval/request_form/base.rb +37 -0
  13. data/lib/approval/models/approval/request_form/create.rb +22 -0
  14. data/lib/approval/models/approval/request_form/destroy.rb +22 -0
  15. data/lib/approval/models/approval/request_form/update.rb +23 -0
  16. data/lib/approval/models/approval/request_form.rb +4 -0
  17. data/lib/approval/models/approval/respond_form/approve.rb +19 -0
  18. data/lib/approval/models/approval/respond_form/base.rb +42 -0
  19. data/lib/approval/models/approval/respond_form/cancel.rb +16 -0
  20. data/lib/approval/models/approval/respond_form/reject.rb +18 -0
  21. data/lib/approval/models/approval/respond_form.rb +4 -0
  22. data/lib/approval/version.rb +1 -1
  23. data/lib/approval.rb +11 -3
  24. data/lib/generators/approval/USAGE +0 -0
  25. data/lib/generators/approval/install_generator.rb +45 -0
  26. data/lib/generators/approval/templates/create_approval_comments.rb.tt +14 -0
  27. data/lib/generators/approval/templates/create_approval_items.rb.tt +17 -0
  28. data/lib/generators/approval/templates/create_approval_requests.rb.tt +19 -0
  29. data/lib/generators/approval/templates/initializer.rb +4 -0
  30. data/spec/lib/config_spec.rb +10 -0
  31. data/spec/lib/version_spec.rb +7 -0
  32. data/spec/models/book_spec.rb +27 -0
  33. data/spec/models/comment_spec.rb +9 -0
  34. data/spec/models/item_spec.rb +114 -0
  35. data/spec/models/request_form/base_spec.rb +54 -0
  36. data/spec/models/request_form/create_spec.rb +23 -0
  37. data/spec/models/request_form/destroy_spec.rb +23 -0
  38. data/spec/models/request_form/update_spec.rb +23 -0
  39. data/spec/models/request_form_spec.rb +4 -0
  40. data/spec/models/request_spec.rb +40 -0
  41. data/spec/models/respond_form/approve_spec.rb +4 -0
  42. data/spec/models/respond_form/base_spec.rb +84 -0
  43. data/spec/models/respond_form/cancel_spec.rb +4 -0
  44. data/spec/models/respond_form/reject_spec.rb +4 -0
  45. data/spec/models/respond_form_spec.rb +4 -0
  46. data/spec/models/user_spec.rb +48 -0
  47. data/spec/rails/rails-4.2.9/README.rdoc +28 -0
  48. data/spec/rails/rails-4.2.9/Rakefile +6 -0
  49. data/spec/rails/rails-4.2.9/app/assets/javascripts/application.js +16 -0
  50. data/spec/rails/rails-4.2.9/app/assets/stylesheets/application.css +15 -0
  51. data/spec/rails/rails-4.2.9/app/controllers/application_controller.rb +5 -0
  52. data/spec/rails/rails-4.2.9/app/helpers/application_helper.rb +2 -0
  53. data/spec/rails/rails-4.2.9/app/models/book.rb +3 -0
  54. data/spec/rails/rails-4.2.9/app/models/user.rb +3 -0
  55. data/spec/rails/rails-4.2.9/app/views/layouts/application.html.erb +14 -0
  56. data/spec/rails/rails-4.2.9/bin/bundle +3 -0
  57. data/spec/rails/rails-4.2.9/bin/rails +4 -0
  58. data/spec/rails/rails-4.2.9/bin/rake +4 -0
  59. data/spec/rails/rails-4.2.9/bin/setup +29 -0
  60. data/spec/rails/rails-4.2.9/config/application.rb +35 -0
  61. data/spec/rails/rails-4.2.9/config/boot.rb +3 -0
  62. data/spec/rails/rails-4.2.9/config/database.yml +25 -0
  63. data/spec/rails/rails-4.2.9/config/environment.rb +8 -0
  64. data/spec/rails/rails-4.2.9/config/environments/development.rb +28 -0
  65. data/spec/rails/rails-4.2.9/config/environments/production.rb +67 -0
  66. data/spec/rails/rails-4.2.9/config/environments/test.rb +42 -0
  67. data/spec/rails/rails-4.2.9/config/initializers/approval.rb +4 -0
  68. data/spec/rails/rails-4.2.9/config/initializers/backtrace_silencers.rb +7 -0
  69. data/spec/rails/rails-4.2.9/config/initializers/cookies_serializer.rb +3 -0
  70. data/spec/rails/rails-4.2.9/config/initializers/filter_parameter_logging.rb +4 -0
  71. data/spec/rails/rails-4.2.9/config/initializers/inflections.rb +16 -0
  72. data/spec/rails/rails-4.2.9/config/initializers/mime_types.rb +4 -0
  73. data/spec/rails/rails-4.2.9/config/initializers/session_store.rb +3 -0
  74. data/spec/rails/rails-4.2.9/config/initializers/to_time_preserves_timezone.rb +10 -0
  75. data/spec/rails/rails-4.2.9/config/initializers/wrap_parameters.rb +14 -0
  76. data/spec/rails/rails-4.2.9/config/locales/en.yml +23 -0
  77. data/spec/rails/rails-4.2.9/config/routes.rb +56 -0
  78. data/spec/rails/rails-4.2.9/config/secrets.yml +22 -0
  79. data/spec/rails/rails-4.2.9/config.ru +4 -0
  80. data/spec/rails/rails-4.2.9/db/migrate/20170731151146_create_approval_requests.rb +19 -0
  81. data/spec/rails/rails-4.2.9/db/migrate/20170731151147_create_approval_comments.rb +14 -0
  82. data/spec/rails/rails-4.2.9/db/migrate/20170731151148_create_approval_items.rb +17 -0
  83. data/spec/rails/rails-4.2.9/db/migrate/20170731151149_create_users.rb +9 -0
  84. data/spec/rails/rails-4.2.9/db/migrate/20170731151150_create_books.rb +9 -0
  85. data/spec/rails/rails-4.2.9/db/schema.rb +68 -0
  86. data/spec/rails/rails-4.2.9/db/seeds.rb +7 -0
  87. data/spec/rails/rails-4.2.9/db/test.sqlite3 +0 -0
  88. data/spec/rails/rails-4.2.9/log/test.log +133 -0
  89. data/spec/rails/rails-4.2.9/public/404.html +67 -0
  90. data/spec/rails/rails-4.2.9/public/422.html +67 -0
  91. data/spec/rails/rails-4.2.9/public/500.html +66 -0
  92. data/spec/rails/rails-4.2.9/public/favicon.ico +0 -0
  93. data/spec/rails/rails-4.2.9/public/robots.txt +5 -0
  94. data/spec/rails/rails-5.1.2/README.md +24 -0
  95. data/spec/rails/rails-5.1.2/Rakefile +6 -0
  96. data/spec/rails/rails-5.1.2/app/assets/config/manifest.js +3 -0
  97. data/spec/rails/rails-5.1.2/app/assets/javascripts/application.js +15 -0
  98. data/spec/rails/rails-5.1.2/app/assets/javascripts/cable.js +13 -0
  99. data/spec/rails/rails-5.1.2/app/assets/stylesheets/application.css +15 -0
  100. data/spec/rails/rails-5.1.2/app/channels/application_cable/channel.rb +4 -0
  101. data/spec/rails/rails-5.1.2/app/channels/application_cable/connection.rb +4 -0
  102. data/spec/rails/rails-5.1.2/app/controllers/application_controller.rb +3 -0
  103. data/spec/rails/rails-5.1.2/app/helpers/application_helper.rb +2 -0
  104. data/spec/rails/rails-5.1.2/app/jobs/application_job.rb +2 -0
  105. data/spec/rails/rails-5.1.2/app/mailers/application_mailer.rb +4 -0
  106. data/spec/rails/rails-5.1.2/app/models/application_record.rb +3 -0
  107. data/spec/rails/rails-5.1.2/app/models/book.rb +3 -0
  108. data/spec/rails/rails-5.1.2/app/models/user.rb +3 -0
  109. data/spec/rails/rails-5.1.2/app/views/layouts/application.html.erb +14 -0
  110. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.html.erb +13 -0
  111. data/spec/rails/rails-5.1.2/app/views/layouts/mailer.text.erb +1 -0
  112. data/spec/rails/rails-5.1.2/bin/bundle +3 -0
  113. data/spec/rails/rails-5.1.2/bin/rails +4 -0
  114. data/spec/rails/rails-5.1.2/bin/rake +4 -0
  115. data/spec/rails/rails-5.1.2/bin/setup +38 -0
  116. data/spec/rails/rails-5.1.2/bin/update +29 -0
  117. data/spec/rails/rails-5.1.2/bin/yarn +11 -0
  118. data/spec/rails/rails-5.1.2/config/application.rb +31 -0
  119. data/spec/rails/rails-5.1.2/config/boot.rb +3 -0
  120. data/spec/rails/rails-5.1.2/config/cable.yml +10 -0
  121. data/spec/rails/rails-5.1.2/config/database.yml +25 -0
  122. data/spec/rails/rails-5.1.2/config/environment.rb +8 -0
  123. data/spec/rails/rails-5.1.2/config/environments/development.rb +47 -0
  124. data/spec/rails/rails-5.1.2/config/environments/production.rb +83 -0
  125. data/spec/rails/rails-5.1.2/config/environments/test.rb +42 -0
  126. data/spec/rails/rails-5.1.2/config/initializers/application_controller_renderer.rb +6 -0
  127. data/spec/rails/rails-5.1.2/config/initializers/approval.rb +4 -0
  128. data/spec/rails/rails-5.1.2/config/initializers/backtrace_silencers.rb +7 -0
  129. data/spec/rails/rails-5.1.2/config/initializers/cookies_serializer.rb +5 -0
  130. data/spec/rails/rails-5.1.2/config/initializers/filter_parameter_logging.rb +4 -0
  131. data/spec/rails/rails-5.1.2/config/initializers/inflections.rb +16 -0
  132. data/spec/rails/rails-5.1.2/config/initializers/mime_types.rb +4 -0
  133. data/spec/rails/rails-5.1.2/config/initializers/wrap_parameters.rb +14 -0
  134. data/spec/rails/rails-5.1.2/config/locales/en.yml +33 -0
  135. data/spec/rails/rails-5.1.2/config/puma.rb +56 -0
  136. data/spec/rails/rails-5.1.2/config/routes.rb +3 -0
  137. data/spec/rails/rails-5.1.2/config/secrets.yml +32 -0
  138. data/spec/rails/rails-5.1.2/config.ru +5 -0
  139. data/spec/rails/rails-5.1.2/db/migrate/20170731101409_create_approval_requests.rb +19 -0
  140. data/spec/rails/rails-5.1.2/db/migrate/20170731101410_create_approval_comments.rb +14 -0
  141. data/spec/rails/rails-5.1.2/db/migrate/20170731101411_create_approval_items.rb +17 -0
  142. data/spec/rails/rails-5.1.2/db/migrate/20170731101412_create_users.rb +9 -0
  143. data/spec/rails/rails-5.1.2/db/migrate/20170731101413_create_books.rb +9 -0
  144. data/spec/rails/rails-5.1.2/db/schema.rb +64 -0
  145. data/spec/rails/rails-5.1.2/db/seeds.rb +7 -0
  146. data/spec/rails/rails-5.1.2/db/test.sqlite3 +0 -0
  147. data/spec/rails/rails-5.1.2/log/test.log +3485 -0
  148. data/spec/rails/rails-5.1.2/package.json +5 -0
  149. data/spec/rails/rails-5.1.2/public/404.html +67 -0
  150. data/spec/rails/rails-5.1.2/public/422.html +67 -0
  151. data/spec/rails/rails-5.1.2/public/500.html +66 -0
  152. data/spec/rails/rails-5.1.2/public/apple-touch-icon-precomposed.png +0 -0
  153. data/spec/rails/rails-5.1.2/public/apple-touch-icon.png +0 -0
  154. data/spec/rails/rails-5.1.2/public/favicon.ico +0 -0
  155. data/spec/rails/rails-5.1.2/public/robots.txt +1 -0
  156. data/spec/spec_helper.rb +117 -0
  157. data/spec/support/rails_template.rb +24 -0
  158. metadata +287 -43
  159. data/.gitignore +0 -12
  160. data/.rspec +0 -2
  161. data/.travis.yml +0 -5
  162. data/Gemfile +0 -4
  163. data/LICENSE.txt +0 -21
  164. data/approval.gemspec +0 -26
  165. data/bin/console +0 -14
  166. data/bin/setup +0 -8
@@ -0,0 +1,133 @@
1
+  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL) 
2
+  (0.3ms) select sqlite_version(*)
3
+  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
+ Migrating to CreateApprovalRequests (20170731151146)
6
+  (0.1ms) begin transaction
7
+  (0.4ms) CREATE TABLE "approval_requests" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "request_user_id" integer NOT NULL, "respond_user_id" integer, "state" integer(1) DEFAULT 0 NOT NULL, "requested_at" datetime NOT NULL, "cancelled_at" datetime, "approved_at" datetime, "rejected_at" datetime, "created_at" datetime, "updated_at" datetime)
8
+  (0.1ms) CREATE INDEX "index_approval_requests_on_request_user_id" ON "approval_requests" ("request_user_id")
9
+  (0.1ms) SELECT sql
10
+ FROM sqlite_master
11
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
12
+ UNION ALL
13
+ SELECT sql
14
+ FROM sqlite_temp_master
15
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
16
+
17
+  (0.1ms) CREATE INDEX "index_approval_requests_on_respond_user_id" ON "approval_requests" ("respond_user_id")
18
+  (0.1ms) SELECT sql
19
+ FROM sqlite_master
20
+ WHERE name='index_approval_requests_on_respond_user_id' AND type='index'
21
+ UNION ALL
22
+ SELECT sql
23
+ FROM sqlite_temp_master
24
+ WHERE name='index_approval_requests_on_respond_user_id' AND type='index'
25
+
26
+  (0.0ms)  SELECT sql
27
+ FROM sqlite_master
28
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
29
+ UNION ALL
30
+ SELECT sql
31
+ FROM sqlite_temp_master
32
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
33
+ 
34
+  (0.1ms) CREATE INDEX "index_approval_requests_on_state" ON "approval_requests" ("state")
35
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170731151146"]]
36
+  (0.5ms) commit transaction
37
+ Migrating to CreateApprovalComments (20170731151147)
38
+  (0.0ms) begin transaction
39
+  (0.3ms) CREATE TABLE "approval_comments" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "request_id" integer NOT NULL, "user_id" integer NOT NULL, "content" text NOT NULL, "created_at" datetime, "updated_at" datetime)
40
+  (0.1ms) CREATE INDEX "index_approval_comments_on_request_id" ON "approval_comments" ("request_id")
41
+  (0.0ms) SELECT sql
42
+ FROM sqlite_master
43
+ WHERE name='index_approval_comments_on_request_id' AND type='index'
44
+ UNION ALL
45
+ SELECT sql
46
+ FROM sqlite_temp_master
47
+ WHERE name='index_approval_comments_on_request_id' AND type='index'
48
+
49
+  (0.1ms) CREATE INDEX "index_approval_comments_on_user_id" ON "approval_comments" ("user_id")
50
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170731151147"]]
51
+  (0.5ms) commit transaction
52
+ Migrating to CreateApprovalItems (20170731151148)
53
+  (0.0ms) begin transaction
54
+  (0.3ms) CREATE TABLE "approval_items" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "request_id" integer NOT NULL, "resource_id" integer, "resource_type" varchar NOT NULL, "event" varchar NOT NULL, "params" text, "created_at" datetime, "updated_at" datetime) 
55
+  (0.1ms) CREATE INDEX "index_approval_items_on_request_id" ON "approval_items" ("request_id")
56
+  (0.0ms)  SELECT sql
57
+ FROM sqlite_master
58
+ WHERE name='index_approval_items_on_request_id' AND type='index'
59
+ UNION ALL
60
+ SELECT sql
61
+ FROM sqlite_temp_master
62
+ WHERE name='index_approval_items_on_request_id' AND type='index'
63
+ 
64
+  (0.1ms) CREATE INDEX "index_approval_items_on_resource_id_and_resource_type" ON "approval_items" ("resource_id", "resource_type")
65
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170731151148"]]
66
+  (0.5ms) commit transaction
67
+ Migrating to CreateUsers (20170731151149)
68
+  (0.0ms) begin transaction
69
+  (0.2ms) CREATE TABLE "users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
70
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170731151149"]]
71
+  (0.5ms) commit transaction
72
+ Migrating to CreateBooks (20170731151150)
73
+  (0.0ms) begin transaction
74
+  (0.2ms) CREATE TABLE "books" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
75
+ SQL (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20170731151150"]]
76
+  (0.5ms) commit transaction
77
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
78
+  (0.1ms) SELECT sql
79
+ FROM sqlite_master
80
+ WHERE name='index_approval_comments_on_user_id' AND type='index'
81
+ UNION ALL
82
+ SELECT sql
83
+ FROM sqlite_temp_master
84
+ WHERE name='index_approval_comments_on_user_id' AND type='index'
85
+
86
+  (0.1ms)  SELECT sql
87
+ FROM sqlite_master
88
+ WHERE name='index_approval_comments_on_request_id' AND type='index'
89
+ UNION ALL
90
+ SELECT sql
91
+ FROM sqlite_temp_master
92
+ WHERE name='index_approval_comments_on_request_id' AND type='index'
93
+ 
94
+  (0.1ms) SELECT sql
95
+ FROM sqlite_master
96
+ WHERE name='index_approval_items_on_resource_id_and_resource_type' AND type='index'
97
+ UNION ALL
98
+ SELECT sql
99
+ FROM sqlite_temp_master
100
+ WHERE name='index_approval_items_on_resource_id_and_resource_type' AND type='index'
101
+
102
+  (0.1ms)  SELECT sql
103
+ FROM sqlite_master
104
+ WHERE name='index_approval_items_on_request_id' AND type='index'
105
+ UNION ALL
106
+ SELECT sql
107
+ FROM sqlite_temp_master
108
+ WHERE name='index_approval_items_on_request_id' AND type='index'
109
+ 
110
+  (0.1ms) SELECT sql
111
+ FROM sqlite_master
112
+ WHERE name='index_approval_requests_on_state' AND type='index'
113
+ UNION ALL
114
+ SELECT sql
115
+ FROM sqlite_temp_master
116
+ WHERE name='index_approval_requests_on_state' AND type='index'
117
+
118
+  (0.1ms)  SELECT sql
119
+ FROM sqlite_master
120
+ WHERE name='index_approval_requests_on_respond_user_id' AND type='index'
121
+ UNION ALL
122
+ SELECT sql
123
+ FROM sqlite_temp_master
124
+ WHERE name='index_approval_requests_on_respond_user_id' AND type='index'
125
+ 
126
+  (0.1ms) SELECT sql
127
+ FROM sqlite_master
128
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
129
+ UNION ALL
130
+ SELECT sql
131
+ FROM sqlite_temp_master
132
+ WHERE name='index_approval_requests_on_request_user_id' AND type='index'
133
+
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The page you were looking for doesn't exist (404)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/404.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The page you were looking for doesn't exist.</h1>
62
+ <p>You may have mistyped the address or the page may have moved.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,67 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>The change you wanted was rejected (422)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/422.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>The change you wanted was rejected.</h1>
62
+ <p>Maybe you tried to change something you didn't have access to.</p>
63
+ </div>
64
+ <p>If you are the application owner check the logs for more information.</p>
65
+ </div>
66
+ </body>
67
+ </html>
@@ -0,0 +1,66 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>We're sorry, but something went wrong (500)</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <style>
7
+ body {
8
+ background-color: #EFEFEF;
9
+ color: #2E2F30;
10
+ text-align: center;
11
+ font-family: arial, sans-serif;
12
+ margin: 0;
13
+ }
14
+
15
+ div.dialog {
16
+ width: 95%;
17
+ max-width: 33em;
18
+ margin: 4em auto 0;
19
+ }
20
+
21
+ div.dialog > div {
22
+ border: 1px solid #CCC;
23
+ border-right-color: #999;
24
+ border-left-color: #999;
25
+ border-bottom-color: #BBB;
26
+ border-top: #B00100 solid 4px;
27
+ border-top-left-radius: 9px;
28
+ border-top-right-radius: 9px;
29
+ background-color: white;
30
+ padding: 7px 12% 0;
31
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
32
+ }
33
+
34
+ h1 {
35
+ font-size: 100%;
36
+ color: #730E15;
37
+ line-height: 1.5em;
38
+ }
39
+
40
+ div.dialog > p {
41
+ margin: 0 0 1em;
42
+ padding: 1em;
43
+ background-color: #F7F7F7;
44
+ border: 1px solid #CCC;
45
+ border-right-color: #999;
46
+ border-left-color: #999;
47
+ border-bottom-color: #999;
48
+ border-bottom-left-radius: 4px;
49
+ border-bottom-right-radius: 4px;
50
+ border-top-color: #DADADA;
51
+ color: #666;
52
+ box-shadow: 0 3px 8px rgba(50, 50, 50, 0.17);
53
+ }
54
+ </style>
55
+ </head>
56
+
57
+ <body>
58
+ <!-- This file lives in public/500.html -->
59
+ <div class="dialog">
60
+ <div>
61
+ <h1>We're sorry, but something went wrong.</h1>
62
+ </div>
63
+ <p>If you are the application owner check the logs for more information.</p>
64
+ </div>
65
+ </body>
66
+ </html>
File without changes
@@ -0,0 +1,5 @@
1
+ # See http://www.robotstxt.org/robotstxt.html for documentation on how to use the robots.txt file
2
+ #
3
+ # To ban all spiders from the entire site uncomment the next two lines:
4
+ # User-agent: *
5
+ # Disallow: /
@@ -0,0 +1,24 @@
1
+ # README
2
+
3
+ This README would normally document whatever steps are necessary to get the
4
+ application up and running.
5
+
6
+ Things you may want to cover:
7
+
8
+ * Ruby version
9
+
10
+ * System dependencies
11
+
12
+ * Configuration
13
+
14
+ * Database creation
15
+
16
+ * Database initialization
17
+
18
+ * How to run the test suite
19
+
20
+ * Services (job queues, cache servers, search engines, etc.)
21
+
22
+ * Deployment instructions
23
+
24
+ * ...
@@ -0,0 +1,6 @@
1
+ # Add your own tasks in files placed in lib/tasks ending in .rake,
2
+ # for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.
3
+
4
+ require_relative 'config/application'
5
+
6
+ Rails.application.load_tasks
@@ -0,0 +1,3 @@
1
+ //= link_tree ../images
2
+ //= link_directory ../javascripts .js
3
+ //= link_directory ../stylesheets .css
@@ -0,0 +1,15 @@
1
+ // This is a manifest file that'll be compiled into application.js, which will include all the files
2
+ // listed below.
3
+ //
4
+ // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's
5
+ // vendor/assets/javascripts directory can be referenced here using a relative path.
6
+ //
7
+ // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
8
+ // compiled file. JavaScript code in this file should be added after the last require_* statement.
9
+ //
10
+ // Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details
11
+ // about supported directives.
12
+ //
13
+ //= require rails-ujs
14
+ //= require turbolinks
15
+ //= require_tree .
@@ -0,0 +1,13 @@
1
+ // Action Cable provides the framework to deal with WebSockets in Rails.
2
+ // You can generate new channels where WebSocket features live using the `rails generate channel` command.
3
+ //
4
+ //= require action_cable
5
+ //= require_self
6
+ //= require_tree ./channels
7
+
8
+ (function() {
9
+ this.App || (this.App = {});
10
+
11
+ App.cable = ActionCable.createConsumer();
12
+
13
+ }).call(this);
@@ -0,0 +1,15 @@
1
+ /*
2
+ * This is a manifest file that'll be compiled into application.css, which will include all the files
3
+ * listed below.
4
+ *
5
+ * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's
6
+ * vendor/assets/stylesheets directory can be referenced here using a relative path.
7
+ *
8
+ * You're free to add application-wide styles to this file and they'll appear at the bottom of the
9
+ * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS
10
+ * files in this directory. Styles in this file should be added after the last require_* statement.
11
+ * It is generally better to create a new file per style scope.
12
+ *
13
+ *= require_tree .
14
+ *= require_self
15
+ */
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Channel < ActionCable::Channel::Base
3
+ end
4
+ end
@@ -0,0 +1,4 @@
1
+ module ApplicationCable
2
+ class Connection < ActionCable::Connection::Base
3
+ end
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationController < ActionController::Base
2
+ protect_from_forgery with: :exception
3
+ end
@@ -0,0 +1,2 @@
1
+ module ApplicationHelper
2
+ end
@@ -0,0 +1,2 @@
1
+ class ApplicationJob < ActiveJob::Base
2
+ end
@@ -0,0 +1,4 @@
1
+ class ApplicationMailer < ActionMailer::Base
2
+ default from: 'from@example.com'
3
+ layout 'mailer'
4
+ end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -0,0 +1,3 @@
1
+ class Book < ApplicationRecord
2
+ acts_as_approval_resource
3
+ end
@@ -0,0 +1,3 @@
1
+ class User < ApplicationRecord
2
+ acts_as_approval_user
3
+ end
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Rails512</title>
5
+ <%= csrf_meta_tags %>
6
+
7
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
8
+ <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
9
+ </head>
10
+
11
+ <body>
12
+ <%= yield %>
13
+ </body>
14
+ </html>
@@ -0,0 +1,13 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <style>
6
+ /* Email styles need to be inline */
7
+ </style>
8
+ </head>
9
+
10
+ <body>
11
+ <%= yield %>
12
+ </body>
13
+ </html>
@@ -0,0 +1 @@
1
+ <%= yield %>
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
3
+ load Gem.bin_path('bundler', 'bundle')
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ APP_PATH = File.expand_path('../config/application', __dir__)
3
+ require_relative '../config/boot'
4
+ require 'rails/commands'
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative '../config/boot'
3
+ require 'rake'
4
+ Rake.application.run
@@ -0,0 +1,38 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a starting point to setup your application.
15
+ # Add necessary setup steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ # Install JavaScript dependencies if using Yarn
22
+ # system('bin/yarn')
23
+
24
+
25
+ # puts "\n== Copying sample files =="
26
+ # unless File.exist?('config/database.yml')
27
+ # cp 'config/database.yml.sample', 'config/database.yml'
28
+ # end
29
+
30
+ puts "\n== Preparing database =="
31
+ system! 'bin/rails db:setup'
32
+
33
+ puts "\n== Removing old logs and tempfiles =="
34
+ system! 'bin/rails log:clear tmp:clear'
35
+
36
+ puts "\n== Restarting application server =="
37
+ system! 'bin/rails restart'
38
+ end
@@ -0,0 +1,29 @@
1
+ #!/usr/bin/env ruby
2
+ require 'pathname'
3
+ require 'fileutils'
4
+ include FileUtils
5
+
6
+ # path to your application root.
7
+ APP_ROOT = Pathname.new File.expand_path('../../', __FILE__)
8
+
9
+ def system!(*args)
10
+ system(*args) || abort("\n== Command #{args} failed ==")
11
+ end
12
+
13
+ chdir APP_ROOT do
14
+ # This script is a way to update your development environment automatically.
15
+ # Add necessary update steps to this file.
16
+
17
+ puts '== Installing dependencies =='
18
+ system! 'gem install bundler --conservative'
19
+ system('bundle check') || system!('bundle install')
20
+
21
+ puts "\n== Updating database =="
22
+ system! 'bin/rails db:migrate'
23
+
24
+ puts "\n== Removing old logs and tempfiles =="
25
+ system! 'bin/rails log:clear tmp:clear'
26
+
27
+ puts "\n== Restarting application server =="
28
+ system! 'bin/rails restart'
29
+ end
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env ruby
2
+ VENDOR_PATH = File.expand_path('..', __dir__)
3
+ Dir.chdir(VENDOR_PATH) do
4
+ begin
5
+ exec "yarnpkg #{ARGV.join(" ")}"
6
+ rescue Errno::ENOENT
7
+ $stderr.puts "Yarn executable was not detected in the system."
8
+ $stderr.puts "Download Yarn at https://yarnpkg.com/en/docs/install"
9
+ exit 1
10
+ end
11
+ end
@@ -0,0 +1,31 @@
1
+ require_relative 'boot'
2
+
3
+ require "rails"
4
+ # Pick the frameworks you want:
5
+ require "active_model/railtie"
6
+ require "active_job/railtie"
7
+ require "active_record/railtie"
8
+ require "action_controller/railtie"
9
+ require "action_mailer/railtie"
10
+ require "action_view/railtie"
11
+ require "action_cable/engine"
12
+ # require "sprockets/railtie"
13
+ # require "rails/test_unit/railtie"
14
+
15
+ # Require the gems listed in Gemfile, including any gems
16
+ # you've limited to :test, :development, or :production.
17
+ Bundler.require(*Rails.groups)
18
+
19
+ module Rails512
20
+ class Application < Rails::Application
21
+ # Initialize configuration defaults for originally generated Rails version.
22
+ config.load_defaults 5.1
23
+
24
+ # Settings in config/environments/* take precedence over those specified here.
25
+ # Application configuration should go into files in config/initializers
26
+ # -- all .rb files in that directory are automatically loaded.
27
+
28
+ # Don't generate system test files.
29
+ config.generators.system_tests = nil
30
+ end
31
+ end
@@ -0,0 +1,3 @@
1
+ ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../Gemfile', __dir__)
2
+
3
+ require 'bundler/setup' # Set up gems listed in the Gemfile.
@@ -0,0 +1,10 @@
1
+ development:
2
+ adapter: async
3
+
4
+ test:
5
+ adapter: async
6
+
7
+ production:
8
+ adapter: redis
9
+ url: redis://localhost:6379/1
10
+ channel_prefix: rails-5_1_2_production