This repository has been archived by the owner on Jul 24, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Actually fix authentication initializer
Resolves #1324 (and #1282 for real) - ensures that authentication initializer actually runs - ensures that username is copied to cas_login during migration if necessary
- Loading branch information
Showing
2 changed files
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
class AddCasLoginToUsers < ActiveRecord::Migration | ||
def change | ||
add_column :users, :cas_login, :string | ||
|
||
# copy username to cas_login if you use CAS already | ||
if ENV['CAS_AUTH'] | ||
ActiveRecord::Base.connection | ||
.execute('update users set cas_login=username') | ||
end | ||
end | ||
end |