fine_print 1.2.0 → 1.3.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0ad3cdb6cc83d91c8ad70a79abd35a43159d3f99
4
- data.tar.gz: 1aa4cc47c9501d5fd816b6d5eddee4d71a4dbd52
3
+ metadata.gz: 1b2e32a76793d71e6cf6ac6971ba125269c52658
4
+ data.tar.gz: a95a87faf71c9aefb4bc80d7a7516dfc47c18c49
5
5
  SHA512:
6
- metadata.gz: 52bc3cdc2a6f0250b716f2401171ad06afc52dc6c34b8e0873037b71d60deb757b976d60310cdd95d9bf8c3be462a7fde7edfea24be698c8dc4372304950a2fe
7
- data.tar.gz: 54bbdde67d20c2795eac3679f43a00af2d3aad288add521ea908da2924a1c7a147b34674fb344171a75d1e761ce9dc7fd292b0efdefe201de805da8f06f62762
6
+ metadata.gz: 4362c6e678e9ce7eeeebf1f5553e6267b1c7a3a6285ac4663966763a58bca44ec0652b06af57c271c4ac81f654c6fa469e15d220c5780da92f133fb8df422cbe
7
+ data.tar.gz: b11890e37902d3e00c403ed3b4a6459cb76ff8827f54a99634e7086180124ab3db85d3f66176bc43f4f9f7fe96149bd8370d76f33db75955b274f2032670ea75
data/README.md CHANGED
@@ -97,10 +97,9 @@ class MyController < ApplicationController
97
97
  ```
98
98
 
99
99
  You should only try to get signatures when you have a user who is logged in
100
- (FinePrint will raise an exception if you try to get a non-logged in user to sign
101
- an agreement, as that does not make any sense). This normally means that before
102
- the call to `fine_print_get_signatures` you should call whatever `before_filter`
103
- gets a user to login.
100
+ (FinePrint will allow non-logged in users to pass right through without signing
101
+ anything). This normally means that before the call to `fine_print_get_signatures`
102
+ you should call whatever `before_filter` gets a user to login.
104
103
 
105
104
  Just like how rails provides a `skip_before_filter` method to offset `before_filter` calls,
106
105
  FinePrint provides a `fine_print_skip_signatures` method. This method takes the same
@@ -12,13 +12,14 @@ FinePrint.configure do |config|
12
12
  # Default: lambda { |user| false } (no admins)
13
13
  config.user_admin_proc = lambda { |user| false }
14
14
 
15
- # Proc called with user as argument that returns true iif the user is logged in.
16
- # In many systems, a non-logged-in user is represented by nil.
15
+ # Proc called with user as argument that returns true iif the argument is a user
16
+ # who can sign a contract. In many systems, a non-logged-in user is represented by nil.
17
17
  # However, some systems use something like an AnonymousUser class to represent this state.
18
- # This proc is mostly used to help the developer realize that they should only be asking
19
- # signed in users to sign contracts; without this, developers would get a cryptic SQL error.
18
+ # If this proc returns false, FinePrint will not ask for signatures and will allow access
19
+ # to any page, so it's up to the developer to make sure that unsigned users can't access
20
+ # pages that require a contract signature to use.
20
21
  # Default: lambda { |user| user }
21
- config.user_signed_in_proc = lambda { |user| user }
22
+ config.can_sign_contracts_proc = lambda { |user| user }
22
23
 
23
24
  # Path to redirect users to when an error occurs (e.g. permission denied on admin pages).
24
25
  # Default: '/'
@@ -4,7 +4,7 @@ FinePrint.configure do |config|
4
4
  # Engine Configuration
5
5
 
6
6
  # Proc called with controller as argument that returns the current user.
7
- # Default: 'current_user'
7
+ # Default: lambda { |controller| controller.current_user }
8
8
  config.current_user_proc = lambda { |controller| controller.current_user }
9
9
 
10
10
  # Proc called with user as argument that returns true iif the user is an admin.
@@ -12,13 +12,13 @@ FinePrint.configure do |config|
12
12
  # Default: lambda { |user| false } (no admins)
13
13
  config.user_admin_proc = lambda { |user| false }
14
14
 
15
- # Proc called with user as argument that returns true iif the user is logged in.
16
- # In many systems, a non-logged-in user is represented by nil.
15
+ # Proc called with user as argument that returns true iif the argument is a user
16
+ # who can sign a contract. In many systems, a non-logged-in user is represented by nil.
17
17
  # However, some systems use something like an AnonymousUser class to represent this state.
18
18
  # This proc is mostly used to help the developer realize that they should only be asking
19
19
  # signed in users to sign contracts; without this, developers would get a cryptic SQL error.
20
20
  # Default: lambda { |user| user }
21
- config.user_signed_in_proc = lambda { |user| user }
21
+ config.can_sign_contracts_proc = lambda { |user| user }
22
22
 
23
23
  # Path to redirect users to when an error occurs (e.g. permission denied on admin pages).
24
24
  # Default: '/'
@@ -30,16 +30,25 @@ module FinePrint
30
30
 
31
31
  class_eval do
32
32
  before_filter(filter_options) do |controller|
33
+ # If the user isn't signed in, they can't sign a contract. Since there
34
+ # may be some pages that logged in and non-logged in users can visit,
35
+ # just return quietly instead of raising an exception.
36
+ user = FinePrint.current_user_proc.call(self)
37
+ return true unless FinePrint.can_sign?(user)
38
+
33
39
  contract_names = names - fine_print_skipped_contract_names
34
40
 
35
41
  # Bail if nothing to do
36
42
  return true if contract_names.blank?
37
43
 
38
- user = FinePrint.current_user_proc.call(self)
39
- FinePrint.raise_unless_signed_in(user)
40
-
41
44
  unsigned_contract_names =
42
45
  FinePrint.get_unsigned_contract_names(user, contract_names)
46
+
47
+ # Ignore contracts that don't yet exist or aren't yet published (happens
48
+ # when adding code that requires a new contract but before that contract
49
+ # has been added and published)
50
+ unsigned_contract_names.reject!{|name| FinePrint.get_contract(name).blank?}
51
+
43
52
  return true if unsigned_contract_names.empty?
44
53
 
45
54
  # http://stackoverflow.com/a/2165727/1664216
@@ -30,16 +30,31 @@ module FinePrint
30
30
 
31
31
  class_eval do
32
32
  before_filter(filter_options) do |controller|
33
+ # If the user isn't signed in, they can't sign a contract. Since there
34
+ # may be some pages that logged in and non-logged in users can visit,
35
+ # just return quietly instead of raising an exception.
36
+ user = FinePrint.current_user_proc.call(self)
37
+ return true unless FinePrint.can_sign?(user)
38
+
33
39
  contract_names = names - fine_print_skipped_contract_names
34
40
 
35
41
  # Bail if nothing to do
36
42
  return true if contract_names.blank?
37
43
 
38
- user = send FinePrint.current_user_proc.call(self)
39
- FinePrint.raise_unless_signed_in(user)
44
+ <<<<<<< HEAD
45
+ =======
46
+ user = FinePrint.current_user_proc.call(self)
47
+ FinePrint.raise_unless_can_sign(user)
40
48
 
49
+ >>>>>>> a0cf8254c527fa9f44b9dae47c2a157221aa14ab
41
50
  unsigned_contract_names =
42
51
  FinePrint.get_unsigned_contract_names(user, contract_names)
52
+
53
+ # Ignore contracts that don't yet exist or aren't yet published (happens
54
+ # when adding code that requires a new contract but before that contract
55
+ # has been added and published)
56
+ unsigned_contract_names.reject!{|name| FinePrint.get_contract(name).blank?}
57
+
43
58
  return true if unsigned_contract_names.empty?
44
59
 
45
60
  # http://stackoverflow.com/a/2165727/1664216
@@ -1,3 +1,3 @@
1
1
  module FinePrint
2
- VERSION = '1.2.0'
2
+ VERSION = '1.3.0'
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module FinePrint
2
- VERSION = '1.1.1'
2
+ VERSION = '1.2.0'
3
3
  end
data/lib/fine_print.rb CHANGED
@@ -9,7 +9,7 @@ module FinePrint
9
9
  ENGINE_OPTIONS = [
10
10
  :current_user_proc,
11
11
  :user_admin_proc,
12
- :user_signed_in_proc,
12
+ :can_sign_contracts_proc,
13
13
  :pose_contracts_path,
14
14
  :redirect_path
15
15
  ]
@@ -48,7 +48,7 @@ module FinePrint
48
48
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
49
49
  #
50
50
  def self.sign_contract(user, contract)
51
- raise_unless_signed_in(user)
51
+ raise_unless_can_sign(user)
52
52
  contract = get_contract(contract)
53
53
  raise IllegalState, 'Contract not found' if contract.nil?
54
54
 
@@ -63,7 +63,7 @@ module FinePrint
63
63
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
64
64
  #
65
65
  def self.signed_contract?(user, contract)
66
- raise_unless_signed_in(user)
66
+ raise_unless_can_sign(user)
67
67
  contract = get_contract(contract)
68
68
 
69
69
  !contract.signatures.where(:user_id => user.id,
@@ -74,7 +74,7 @@ module FinePrint
74
74
  # - user -- the user in question
75
75
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
76
76
  def self.signed_any_contract_version?(user, contract)
77
- raise_unless_signed_in(user)
77
+ raise_unless_can_sign(user)
78
78
  contract = get_contract(contract)
79
79
  !Signature.joins(:contract)
80
80
  .where(:fine_print_contracts => {:name => contract.name},
@@ -88,7 +88,7 @@ module FinePrint
88
88
  # - names -- contract names to check
89
89
  #
90
90
  def self.get_unsigned_contract_names(user, *names)
91
- raise_unless_signed_in(user)
91
+ raise_unless_can_sign(user)
92
92
  names = names.flatten.collect{|name| name.to_s}
93
93
  return [] if names.blank?
94
94
 
@@ -102,16 +102,16 @@ module FinePrint
102
102
  return names - signed_contract_names
103
103
  end
104
104
 
105
- def self.is_signed_in?(user)
106
- user_signed_in_proc.call(user)
105
+ def self.can_sign?(user)
106
+ can_sign_contracts_proc.call(user)
107
107
  end
108
108
 
109
109
  def self.is_admin?(user)
110
- is_signed_in?(user) && user_admin_proc.call(user)
110
+ !user.nil? && user_admin_proc.call(user)
111
111
  end
112
112
 
113
- def self.raise_unless_signed_in(user)
114
- raise IllegalState, 'User not signed in' unless is_signed_in?(user)
113
+ def self.raise_unless_can_sign(user)
114
+ raise IllegalState, 'User cannot sign contracts' unless can_sign?(user)
115
115
  end
116
116
 
117
117
  def self.raise_unless_admin(user)
data/lib/fine_print.rb~ CHANGED
@@ -7,9 +7,9 @@ module FinePrint
7
7
 
8
8
  # Can be set in initializer only
9
9
  ENGINE_OPTIONS = [
10
- :current_user_method,
10
+ :current_user_proc,
11
11
  :user_admin_proc,
12
- :user_signed_in_proc,
12
+ :can_sign_contracts_proc,
13
13
  :pose_contracts_path,
14
14
  :redirect_path
15
15
  ]
@@ -48,7 +48,7 @@ module FinePrint
48
48
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
49
49
  #
50
50
  def self.sign_contract(user, contract)
51
- raise_unless_signed_in(user)
51
+ raise_unless_can_sign(user)
52
52
  contract = get_contract(contract)
53
53
  raise IllegalState, 'Contract not found' if contract.nil?
54
54
 
@@ -63,7 +63,7 @@ module FinePrint
63
63
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
64
64
  #
65
65
  def self.signed_contract?(user, contract)
66
- raise_unless_signed_in(user)
66
+ raise_unless_can_sign(user)
67
67
  contract = get_contract(contract)
68
68
 
69
69
  !contract.signatures.where(:user_id => user.id,
@@ -74,7 +74,7 @@ module FinePrint
74
74
  # - user -- the user in question
75
75
  # - contract -- can be a Contract object, its ID, or its name as a String or Symbol
76
76
  def self.signed_any_contract_version?(user, contract)
77
- raise_unless_signed_in(user)
77
+ raise_unless_can_sign(user)
78
78
  contract = get_contract(contract)
79
79
  !Signature.joins(:contract)
80
80
  .where(:fine_print_contracts => {:name => contract.name},
@@ -88,7 +88,7 @@ module FinePrint
88
88
  # - names -- contract names to check
89
89
  #
90
90
  def self.get_unsigned_contract_names(user, *names)
91
- raise_unless_signed_in(user)
91
+ raise_unless_can_sign(user)
92
92
  names = names.flatten.collect{|name| name.to_s}
93
93
  return [] if names.blank?
94
94
 
@@ -102,16 +102,16 @@ module FinePrint
102
102
  return names - signed_contract_names
103
103
  end
104
104
 
105
- def self.is_signed_in?(user)
106
- user_signed_in_proc.call(user)
105
+ def self.can_sign?(user)
106
+ can_sign_contracts_proc.call(user)
107
107
  end
108
108
 
109
109
  def self.is_admin?(user)
110
- is_signed_in?(user) && user_admin_proc.call(user)
110
+ !user.nil? && user_admin_proc.call(user)
111
111
  end
112
112
 
113
- def self.raise_unless_signed_in(user)
114
- raise IllegalState, 'User not signed in' unless is_signed_in?(user)
113
+ def self.raise_unless_can_sign(user)
114
+ raise IllegalState, 'User not signed in' unless can_sign?(user)
115
115
  end
116
116
 
117
117
  def self.raise_unless_admin(user)
@@ -12,13 +12,14 @@ FinePrint.configure do |config|
12
12
  # Default: lambda { |user| false } (no admins)
13
13
  config.user_admin_proc = lambda { |user| user.is_admin }
14
14
 
15
- # Proc called with user as argument that returns true iif the user is logged in.
16
- # In many systems, a non-logged-in user is represented by nil.
15
+ # Proc called with user as argument that returns true iif the argument is a user
16
+ # who can sign a contract. In many systems, a non-logged-in user is represented by nil.
17
17
  # However, some systems use something like an AnonymousUser class to represent this state.
18
- # This proc is mostly used to help the developer realize that they should only be asking
19
- # signed in users to sign contracts; without this, developers would get a cryptic SQL error.
18
+ # If this proc returns false, FinePrint will not ask for signatures and will allow access
19
+ # to any page, so it's up to the developer to make sure that unsigned users can't access
20
+ # pages that require a contract signature to use.
20
21
  # Default: lambda { |user| user }
21
- config.user_signed_in_proc = lambda { |user| user }
22
+ config.can_sign_contracts_proc = lambda { |user| user }
22
23
 
23
24
  # Path to redirect users to when an error occurs (e.g. permission denied on admin pages).
24
25
  # Default: '/'
@@ -3,22 +3,22 @@
3
3
  FinePrint.configure do |config|
4
4
  # Engine Configuration
5
5
 
6
- # Name of the ApplicationController helper method that returns the current user.
7
- # Default: 'current_user'
8
- config.current_user_method = 'current_user'
6
+ # Proc called with controller as argument that returns the current user.
7
+ # Default: lambda { |controller| controller.current_user }
8
+ config.current_user_proc = lambda { |controller| controller.current_user }
9
9
 
10
- # Proc called with user as argument that should return true if and only if the user is an admin.
10
+ # Proc called with user as argument that returns true iif the user is an admin.
11
11
  # Admins can create and edit agreements and terminate accepted agreements.
12
12
  # Default: lambda { |user| false } (no admins)
13
13
  config.user_admin_proc = lambda { |user| user.is_admin }
14
14
 
15
- # Proc that returns true if and only if the provided user is logged in.
15
+ # Proc called with user as argument that returns true iif the user is logged in.
16
16
  # In many systems, a non-logged-in user is represented by nil.
17
17
  # However, some systems use something like an AnonymousUser class to represent this state.
18
18
  # This proc is mostly used to help the developer realize that they should only be asking
19
19
  # signed in users to sign contracts; without this, developers would get a cryptic SQL error.
20
- # Default: lambda { |user| !user.nil? }
21
- config.user_signed_in_proc = lambda { |user| !user.nil? }
20
+ # Default: lambda { |user| user }
21
+ config.can_sign_contracts_proc = lambda { |user| user }
22
22
 
23
23
  # Path to redirect users to when an error occurs (e.g. permission denied on admin pages).
24
24
  # Default: '/'
Binary file
@@ -1785,3 +1785,68 @@ Connecting to database specified by database.yml
1785
1785
   (4.4ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1786
1786
   (3.8ms) 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")
1787
1787
   (0.1ms) SELECT version FROM "schema_migrations"
1788
+ Connecting to database specified by database.yml
1789
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1790
+  (0.1ms) select sqlite_version(*)
1791
+  (12.6ms) DROP TABLE "dummy_users"
1792
+  (5.0ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1793
+  (5.1ms) DROP TABLE "fine_print_contracts"
1794
+  (4.7ms) CREATE TABLE "fine_print_contracts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "version" integer, "title" varchar(255) NOT NULL, "content" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1795
+  (4.5ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
1796
+  (5.2ms) DROP TABLE "fine_print_signatures"
1797
+  (4.8ms) CREATE TABLE "fine_print_signatures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1798
+  (4.6ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1799
+  (4.5ms) 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")
1800
+  (0.1ms) SELECT version FROM "schema_migrations"
1801
+ Connecting to database specified by database.yml
1802
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1803
+  (0.2ms) select sqlite_version(*)
1804
+  (30.5ms) DROP TABLE "dummy_users"
1805
+  (6.0ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1806
+  (5.5ms) DROP TABLE "fine_print_contracts"
1807
+  (5.6ms) CREATE TABLE "fine_print_contracts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "version" integer, "title" varchar(255) NOT NULL, "content" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1808
+  (6.2ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
1809
+  (5.1ms) DROP TABLE "fine_print_signatures"
1810
+  (4.8ms) CREATE TABLE "fine_print_signatures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1811
+  (4.6ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1812
+  (4.5ms) 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")
1813
+  (0.1ms) SELECT version FROM "schema_migrations"
1814
+ Connecting to database specified by database.yml
1815
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1816
+  (0.1ms) select sqlite_version(*)
1817
+  (14.4ms) DROP TABLE "dummy_users"
1818
+  (6.0ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1819
+  (5.0ms) DROP TABLE "fine_print_contracts"
1820
+  (5.1ms) CREATE TABLE "fine_print_contracts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "version" integer, "title" varchar(255) NOT NULL, "content" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1821
+  (4.7ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
1822
+  (5.3ms) DROP TABLE "fine_print_signatures"
1823
+  (6.6ms) CREATE TABLE "fine_print_signatures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1824
+  (5.0ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1825
+  (4.7ms) 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")
1826
+  (0.1ms) SELECT version FROM "schema_migrations"
1827
+ Connecting to database specified by database.yml
1828
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1829
+  (0.1ms) select sqlite_version(*)
1830
+  (14.8ms) DROP TABLE "dummy_users"
1831
+  (5.2ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1832
+  (5.3ms) DROP TABLE "fine_print_contracts"
1833
+  (5.0ms) CREATE TABLE "fine_print_contracts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "version" integer, "title" varchar(255) NOT NULL, "content" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1834
+  (5.1ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
1835
+  (5.0ms) DROP TABLE "fine_print_signatures"
1836
+  (4.8ms) CREATE TABLE "fine_print_signatures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1837
+  (4.9ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1838
+  (4.5ms) 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")
1839
+  (0.1ms) SELECT version FROM "schema_migrations"
1840
+ Connecting to database specified by database.yml
1841
+  (0.0ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
1842
+  (0.1ms) select sqlite_version(*)
1843
+  (14.2ms) DROP TABLE "dummy_users"
1844
+  (5.0ms) CREATE TABLE "dummy_users" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "is_admin" boolean DEFAULT 'f' NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1845
+  (5.0ms) DROP TABLE "fine_print_contracts"
1846
+  (4.8ms) CREATE TABLE "fine_print_contracts" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255) NOT NULL, "version" integer, "title" varchar(255) NOT NULL, "content" text NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
1847
+  (4.7ms) CREATE UNIQUE INDEX "index_fine_print_contracts_on_name_and_version" ON "fine_print_contracts" ("name", "version")
1848
+  (4.1ms) DROP TABLE "fine_print_signatures"
1849
+  (4.1ms) CREATE TABLE "fine_print_signatures" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "contract_id" integer NOT NULL, "user_id" integer NOT NULL, "user_type" varchar(255) NOT NULL, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
1850
+  (4.2ms) CREATE INDEX "index_fine_print_signatures_on_contract_id" ON "fine_print_signatures" ("contract_id")
1851
+  (4.2ms) 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")
1852
+  (0.1ms) SELECT version FROM "schema_migrations"