Description:
fixed seed.db for mock valid?
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r333:6abae4dc17ba - - 1 file changed: 1 inserted, 1 deleted
@@ -167,25 +167,25 | |||||
|
167 | end |
|
167 | end |
|
168 |
|
168 | ||
|
169 | def seed_root |
|
169 | def seed_root |
|
170 | return if User.find_by_login('root') |
|
170 | return if User.find_by_login('root') |
|
171 |
|
171 | ||
|
172 | root = User.new(:login => 'root', |
|
172 | root = User.new(:login => 'root', |
|
173 | :full_name => 'Administrator', |
|
173 | :full_name => 'Administrator', |
|
174 | :alias => 'root') |
|
174 | :alias => 'root') |
|
175 | root.password = 'ioionrails'; |
|
175 | root.password = 'ioionrails'; |
|
176 |
|
176 | ||
|
177 | class << root |
|
177 | class << root |
|
178 | public :encrypt_new_password |
|
178 | public :encrypt_new_password |
|
179 | - def valid? |
|
179 | + def valid?(context=nil) |
|
180 | true |
|
180 | true |
|
181 | end |
|
181 | end |
|
182 | end |
|
182 | end |
|
183 |
|
183 | ||
|
184 | root.encrypt_new_password |
|
184 | root.encrypt_new_password |
|
185 |
|
185 | ||
|
186 | root.roles << Role.find_by_name('admin') |
|
186 | root.roles << Role.find_by_name('admin') |
|
187 |
|
187 | ||
|
188 | root.activated = true |
|
188 | root.activated = true |
|
189 | root.save |
|
189 | root.save |
|
190 | end |
|
190 | end |
|
191 |
|
191 |
You need to be logged in to leave comments.
Login now