salted_login_generator 1.0.8 → 1.0.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -20,7 +20,7 @@ class SaltedLoginGenerator < LocalizationGenerator #Rails::Generator::NamedBase
20
20
 
21
21
  m.template "user_test.rb", "test/unit/#{file_name}_test.rb"
22
22
  m.template "users.yml", "test/fixtures/#{plural_name}.yml"
23
- m.file "user_model.erbsql", "db/user_model.erbsql"
23
+ m.template "user_model.erbsql", "db/user_model.erbsql"
24
24
 
25
25
  # Configuration and miscellaneous
26
26
  m.template "login_environment.rb", "config/environments/#{file_name}_environment.rb"
data/templates/README CHANGED
@@ -48,13 +48,16 @@ error handling back.
48
48
 
49
49
  == Requirements
50
50
 
51
- You need a database table corresponding to the <%= class_name %> model.
51
+ You need a database table corresponding to the <%= class_name %> model. Note
52
+ the table type for MySQL. Whatever DB you use, it must support transactions.
53
+ If it does not, the functional tests will not work properly, nor will the
54
+ application in the face of failures during certain DB creates and updates.
52
55
 
53
56
  mysql syntax:
54
57
  CREATE TABLE <%= plural_name %> (
55
58
  id INTEGER UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
56
59
  login VARCHAR(80) NOT NULL,
57
- password VARCHAR(40) NOT NULL,
60
+ salted_password VARCHAR(40) NOT NULL,
58
61
  email VARCHAR(60) NOT NULL,
59
62
  firstname VARCHAR(40),
60
63
  lastname VARCHAR(40),
@@ -62,14 +65,16 @@ You need a database table corresponding to the <%= class_name %> model.
62
65
  verified INT default 0,
63
66
  role VARCHAR(40) default NULL,
64
67
  security_token CHAR(40) default NULL,
65
- token_expiry DATETIME default NULL
68
+ token_expiry DATETIME default NULL,
69
+ deleted INT default 0,
70
+ delete_after DATETIME default NULL
66
71
  ) TYPE=InnoDB DEFAULT CHARSET=utf8;
67
72
 
68
73
  postgres:
69
74
  CREATE TABLE "<%= plural_name %>" (
70
75
  id SERIAL PRIMARY KEY
71
76
  login VARCHAR(80) NOT NULL,
72
- password VARCHAR(40) NOT NULL,
77
+ salted_password VARCHAR(40) NOT NULL,
73
78
  email VARCHAR(60) NOT NULL,
74
79
  firstname VARCHAR(40),
75
80
  lastname VARCHAR(40),
@@ -77,14 +82,16 @@ You need a database table corresponding to the <%= class_name %> model.
77
82
  verified INT default 0,
78
83
  role VARCHAR(40) default NULL,
79
84
  security_token CHAR(40) default NULL,
80
- token_expiry TIMESTAMP default NULL
85
+ token_expiry TIMESTAMP default NULL,
86
+ deleted INT default 0,
87
+ delete_after TIMESTAMP default NULL
81
88
  ) WITH OIDS;
82
89
 
83
90
  sqlite:
84
91
  CREATE TABLE '<%= plural_name %>' (
85
92
  id INTEGER PRIMARY KEY,
86
93
  login VARCHAR(80) NOT NULL,
87
- password VARCHAR(40) NOT NULL,
94
+ salted_password VARCHAR(40) NOT NULL,
88
95
  email VARCHAR(60) NOT NULL,
89
96
  firstname VARCHAR(40),
90
97
  lastname VARCHAR(40),
@@ -92,7 +99,9 @@ You need a database table corresponding to the <%= class_name %> model.
92
99
  verified INT default 0,
93
100
  role VARCHAR(40) default NULL,
94
101
  security_token CHAR(40) default NULL,
95
- token_expiry DATETIME default NULL
102
+ token_expiry DATETIME default NULL,
103
+ deleted INT default 0,
104
+ delete_after DATETIME default NULL
96
105
  );
97
106
 
98
107
  Of course your <%= singular_name %> model can have any amount of extra fields.
@@ -176,6 +185,7 @@ automatically on startup.
176
185
 
177
186
  == Changelog
178
187
 
188
+ 1.0.9 Fixed hardcoded generator name (in controller test) and README fixes
179
189
  1.0.8 Generator/schema fixes and some README fixes/improvements
180
190
  1.0.7 Fixed bad bug with missing attr_accessor :new_password in user class
181
191
  1.0.6 Proper delete support and bug fixes
@@ -122,7 +122,7 @@ class <%= class_name %>ControllerTest < Test::Unit::TestCase
122
122
  post :edit, "<%= singular_name %>" => { "form" => "delete" }
123
123
  assert_equal 1, ActionMailer::Base.deliveries.size
124
124
  mail = ActionMailer::Base.deliveries[0]
125
- mail.encoded =~ /user\[id\]=(.*?)&key=(.*?)"/
125
+ mail.encoded =~ /<%= singular_name%>\[id\]=(.*?)&key=(.*?)"/
126
126
  id = $1
127
127
  key = $2
128
128
  post :restore_deleted, "<%= singular_name %>" => { "id" => "#{id}" }, "key" => "badkey"
@@ -214,7 +214,7 @@ class <%= class_name %>ControllerTest < Test::Unit::TestCase
214
214
  assert_equal 1, ActionMailer::Base.deliveries.size
215
215
  mail = ActionMailer::Base.deliveries[0]
216
216
  assert_equal "bob@test.com", mail.to_addrs[0].to_s
217
- mail.encoded =~ /user\[id\]=(.*?)&key=(.*?)"/
217
+ mail.encoded =~ /<%= singular_name %>\[id\]=(.*?)&key=(.*?)"/
218
218
  id = $1
219
219
  key = $2
220
220
  post :change_password, "<%= singular_name %>" => { "password" => "#{password}", "password_confirmation" => "#{password}", "id" => "#{id}" }, "key" => "#{key}"
@@ -1,5 +1,5 @@
1
- CREATE TABLE users (
2
- id <%= @pk %>,
1
+ CREATE TABLE <%= plural_name %> (
2
+ id <%%= @pk %>,
3
3
  login VARCHAR(80) NOT NULL,
4
4
  salted_password VARCHAR(40) NOT NULL,
5
5
  email VARCHAR(60) NOT NULL,
@@ -9,10 +9,10 @@ CREATE TABLE users (
9
9
  verified INT default 0,
10
10
  role VARCHAR(40) default NULL,
11
11
  security_token CHAR(40) default NULL,
12
- token_expiry <%= @datetime %> default NULL,
13
- created_at <%= @datetime %> default NULL,
14
- updated_at <%= @datetime %> default NULL,
15
- logged_in_at <%= @datetime %> default NULL,
12
+ token_expiry <%%= @datetime %> default NULL,
13
+ created_at <%%= @datetime %> default NULL,
14
+ updated_at <%%= @datetime %> default NULL,
15
+ logged_in_at <%%= @datetime %> default NULL,
16
16
  deleted INT default 0,
17
- delete_after <%= @datetime %> default NULL
18
- ) <%= @options %>;
17
+ delete_after <%%= @datetime %> default NULL
18
+ ) <%%= @options %>;
metadata CHANGED
@@ -3,8 +3,8 @@ rubygems_version: 0.8.8
3
3
  specification_version: 1
4
4
  name: salted_login_generator
5
5
  version: !ruby/object:Gem::Version
6
- version: 1.0.8
7
- date: 2005-05-11
6
+ version: 1.0.9
7
+ date: 2005-05-19
8
8
  summary: "[Rails] Login generator with salted passwords."
9
9
  require_paths:
10
10
  - "."