fine_print 6.0.0 → 6.0.1

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
  SHA256:
3
- metadata.gz: 64f40d2856e40bfa24ce81599a30f84c7676a2621975150b6c7ff3ebcb81317f
4
- data.tar.gz: d9d371c8bedd3c715f36c96a77492b15e44f4c2456523644790211e12dbf96fc
3
+ metadata.gz: 36c354c7847e144c71413d80b85ff33cd0c8557c56e962f4e52f76633b4736e1
4
+ data.tar.gz: 8ed54d4e8fe86be2fbe20d9a135e56328ede04d377625edfe21ec8a1c9431c2b
5
5
  SHA512:
6
- metadata.gz: d9dce1b1e6634bd60b9e5abf4f3ecf71b44f67e1e54b733101854f425827030bc9e623fd9f8b3cf75f520c75771c09c68d91eb9c2803975745c57875cfe5f925
7
- data.tar.gz: e210cc4cf986a86646300cbe6507309d228d648048c47ff5f5f8bc6d6ca189e6e89e041a1430523e90c03394a562e6bd2251dbc241d54a11739b8a0494f05e2d
6
+ metadata.gz: 119712381276c0e3b6d4980c35187dddfc730bbcd38af142b60a91136939f48aeb7d2d5c62bc057baa2b10702fe911ede772108818ca688fac2fcf501d096dc8
7
+ data.tar.gz: 5925eca798f95541aee4d54169155a69e30be2aa3ff026ad4dd6824ef79b7bb0ef3bc9f2a31094371a9285cead44d25087d254b58608ea79830ec62220c46d9d
@@ -5,7 +5,14 @@ module FinePrint
5
5
  before_action :get_contract, except: [:index, :new, :create]
6
6
 
7
7
  def index
8
- @contracts = Contract.includes(:signatures).all.to_a.group_by(&:name)
8
+ @contracts = Contract.select(
9
+ <<~EOS
10
+ "fine_print_contracts".*, (
11
+ SELECT COUNT(*) FROM "fine_print_signatures"
12
+ WHERE "fine_print_signatures"."contract_id" = "fine_print_contracts"."id"
13
+ ) AS "signatures_count"
14
+ EOS
15
+ ).all.to_a.group_by(&:name)
9
16
  end
10
17
 
11
18
  def new
@@ -17,7 +24,7 @@ module FinePrint
17
24
  @contract.name = params[:contract][:name]
18
25
  @contract.title = params[:contract][:title]
19
26
  @contract.content = params[:contract][:content]
20
-
27
+
21
28
  if @contract.save
22
29
  redirect_to @contract, notice: t('fine_print.contract.notices.created')
23
30
  else
@@ -9,7 +9,7 @@
9
9
 
10
10
  <ul class='fine_print'>
11
11
  <li><%= name %></li>
12
-
12
+
13
13
  <ul class='fine_print'>
14
14
  <% contracts.each do |contract| %>
15
15
  <li><%= link_to contract.title, contract, class: 'fine_print link' %>
@@ -17,7 +17,7 @@
17
17
  t('fine_print.contract.status.draft') : \
18
18
  t('fine_print.contract.status.version',
19
19
  version: contract.version.to_s) %>)
20
- <% if contract.signatures.empty? %>
20
+ <% if contract.signatures_count == 0 %>
21
21
  [<%= link_to t('fine_print.contract.actions.edit'),
22
22
  edit_contract_path(contract),
23
23
  class: 'fine_print link' %>]
@@ -63,7 +63,7 @@
63
63
  </li>
64
64
  <% end %>
65
65
  </ul>
66
-
66
+
67
67
  </ul>
68
68
 
69
69
  <% end %>
@@ -1,3 +1,3 @@
1
1
  module FinePrint
2
- VERSION = '6.0.0'
2
+ VERSION = '6.0.1'
3
3
  end
Binary file
Binary file
@@ -0,0 +1,95 @@
1
+  (0.1ms) SELECT sqlite_version(*)
2
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
3
+  (1.9ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
4
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
5
+  (1.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
6
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
7
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
8
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
9
+ Migrating to InstallFinePrint (0)
10
+  (0.0ms) begin transaction
11
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
12
+  (0.5ms) CREATE TABLE "fine_print_contracts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "version" integer, "title" varchar NOT NULL, "content" text NOT NULL, "created_at" datetime, "updated_at" datetime)
13
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/0_install_fine_print.rb:3
14
+  (0.1ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
15
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/0_install_fine_print.rb:12
16
+  (0.1ms) CREATE TABLE "fine_print_signatures" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_type" varchar NOT NULL, "user_id" integer NOT NULL, "created_at" datetime, "updated_at" datetime)
17
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/0_install_fine_print.rb:14
18
+  (0.1ms) CREATE UNIQUE INDEX "index_fine_print_s_on_u_id_and_u_type_and_c_id" ON "fine_print_signatures" ("user_id", "user_type", "contract_id")
19
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/0_install_fine_print.rb:21
20
+  (0.1ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
21
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/0_install_fine_print.rb:24
22
+ ActiveRecord::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
23
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
24
+  (1.1ms) commit transaction
25
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
26
+ Migrating to AddImplicitSignatures (1)
27
+  (0.0ms) begin transaction
28
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
29
+  (0.6ms) ALTER TABLE "fine_print_signatures" ADD "is_implicit" boolean DEFAULT 0 NOT NULL
30
+ ↳ /Users/dante/Desktop/fine_print/db/migrate/1_add_implicit_signatures.rb:3
31
+ ActiveRecord::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
32
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
33
+  (0.8ms) commit transaction
34
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
35
+ Migrating to CreateDummyUsers (1000)
36
+  (0.0ms) begin transaction
37
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
38
+  (0.4ms) CREATE TABLE "dummy_users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 0 NOT NULL, "created_at" datetime, "updated_at" datetime)
39
+ ↳ db/migrate/1000_create_dummy_users.rb:3
40
+ ActiveRecord::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1000"]]
41
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
42
+  (0.9ms) commit transaction
43
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
44
+ ActiveRecord::InternalMetadata Load (0.1ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
45
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
46
+  (0.0ms) begin transaction
47
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
48
+ ActiveRecord::InternalMetadata Create (0.3ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2023-03-21 17:29:24.804592"], ["updated_at", "2023-03-21 17:29:24.804592"]]
49
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
50
+  (0.9ms) commit transaction
51
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
52
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
53
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
54
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
55
+ ↳ /Users/dante/.rbenv/versions/2.7.2/bin/rake:23
56
+  (1.2ms) SELECT sqlite_version(*)
57
+  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
58
+  (1.0ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
59
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
60
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
61
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
62
+  (0.1ms) SELECT "ar_internal_metadata"."value" FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? [["key", "environment"]]
63
+  (0.1ms) SELECT sqlite_version(*)
64
+  (0.0ms) SELECT sqlite_version(*)
65
+  (0.0ms) SELECT sqlite_version(*)
66
+  (1.7ms) CREATE TABLE "schema_migrations" ("version" varchar NOT NULL PRIMARY KEY)
67
+  (1.5ms) CREATE TABLE "ar_internal_metadata" ("key" varchar NOT NULL PRIMARY KEY, "value" varchar, "created_at" datetime(6) NOT NULL, "updated_at" datetime(6) NOT NULL)
68
+  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
69
+ Migrating to InstallFinePrint (0)
70
+ TRANSACTION (0.1ms) begin transaction
71
+  (0.4ms) CREATE TABLE "fine_print_contracts" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar NOT NULL, "version" integer, "title" varchar NOT NULL, "content" text NOT NULL, "created_at" datetime, "updated_at" datetime)
72
+  (0.1ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
73
+  (0.1ms) CREATE TABLE "fine_print_signatures" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_type" varchar NOT NULL, "user_id" integer NOT NULL, "created_at" datetime, "updated_at" datetime)
74
+  (0.1ms) CREATE UNIQUE INDEX "index_fine_print_s_on_u_id_and_u_type_and_c_id" ON "fine_print_signatures" ("user_id", "user_type", "contract_id")
75
+  (0.1ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
76
+ ActiveRecord::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "0"]]
77
+ TRANSACTION (1.2ms) commit transaction
78
+ Migrating to AddImplicitSignatures (1)
79
+ TRANSACTION (0.0ms) begin transaction
80
+  (0.6ms) ALTER TABLE "fine_print_signatures" ADD "is_implicit" boolean DEFAULT 0 NOT NULL
81
+ ActiveRecord::SchemaMigration Create (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1"]]
82
+ TRANSACTION (0.9ms) commit transaction
83
+ Migrating to CreateDummyUsers (1000)
84
+ TRANSACTION (0.1ms) begin transaction
85
+  (0.4ms) CREATE TABLE "dummy_users" ("id" integer PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 0 NOT NULL, "created_at" datetime, "updated_at" datetime)
86
+ ActiveRecord::SchemaMigration Create (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "1000"]]
87
+ TRANSACTION (1.0ms) commit transaction
88
+ ActiveRecord::InternalMetadata Load (0.2ms) SELECT "ar_internal_metadata".* FROM "ar_internal_metadata" WHERE "ar_internal_metadata"."key" = ? LIMIT ? [["key", "environment"], ["LIMIT", 1]]
89
+ TRANSACTION (0.1ms) begin transaction
90
+ ActiveRecord::InternalMetadata Create (0.7ms) INSERT INTO "ar_internal_metadata" ("key", "value", "created_at", "updated_at") VALUES (?, ?, ?, ?) [["key", "environment"], ["value", "development"], ["created_at", "2023-03-21 17:38:35.575933"], ["updated_at", "2023-03-21 17:38:35.575933"]]
91
+ TRANSACTION (0.9ms) commit transaction
92
+  (0.1ms) SELECT sqlite_version(*)
93
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC
94
+  (0.0ms) SELECT sqlite_version(*)
95
+  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" ORDER BY "schema_migrations"."version" ASC