diff --git a/app/models/user.rb b/app/models/user.rb index 9a76d53..e43f6c3 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -3,7 +3,7 @@ # Collect all the available Omniauth Schemes omniauth_schemes = IdentifierScheme.all.collect{ |scheme| scheme.name.downcase.to_sym } - + # Include default devise modules. Others available are: # :token_authenticatable, :confirmable, # :lockable, :timeoutable and :omniauthable diff --git a/app/views/devise/registrations/_external_identifier.html.erb b/app/views/devise/registrations/_external_identifier.html.erb index 38533d4..6249e55 100644 --- a/app/views/devise/registrations/_external_identifier.html.erb +++ b/app/views/devise/registrations/_external_identifier.html.erb @@ -17,7 +17,7 @@ title: t("identifier_schemes.#{scheme.name}.tooltip") %> <%= link_to '', destroy_user_identifier_path(id), method: :delete, - title: t("identifier_schemes.#{scheme.name}.disconnect"), - class: 'remove' %> + title: t("identifier_schemes.#{scheme.name}.disconnect") %> + <% end %> <% end %> diff --git a/config/routes.rb b/config/routes.rb index 6e63fd9..7dc078f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,15 +1,20 @@ Rails.application.routes.draw do - devise_for :users, controllers: { - registrations: "registrations", - confirmations: 'confirmations', - passwords: 'passwords', - sessions: 'sessions', - omniauth_callbacks: 'users/omniauth_callbacks'} do + # Table check to prevent conflicts running 'rake db:migrate' which initializes + # the Rails app before the migrations have actually run which in turn causes + # an error to be thrown because the identifier_schemes table does not yet exist + if ActiveRecord::Base.connection.table_exists?('identifier_schemes') + devise_for :users, controllers: { + registrations: "registrations", + confirmations: 'confirmations', + passwords: 'passwords', + sessions: 'sessions', + omniauth_callbacks: 'users/omniauth_callbacks'} do - get "/users/sign_out", :to => "devise/sessions#destroy" + get "/users/sign_out", :to => "devise/sessions#destroy" + end end - + # WAYFless access point - use query param idp get 'auth/shibboleth' => 'users/omniauth_shibboleth_request#redirect', :as => 'user_omniauth_shibboleth' get 'auth/shibboleth/assoc' => 'users/omniauth_shibboleth_request#associate', :as => 'user_shibboleth_assoc' diff --git a/db/schema.rb b/db/schema.rb index e275c51..2c77110 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -114,28 +114,25 @@ add_index "guidance_in_group", ["guidance_id", "guidance_group_id"], name: "index_guidance_in_group_on_guidance_id_and_guidance_group_id" create_table "guidances", force: :cascade do |t| - t.text "text", limit: 65535 - t.integer "guidance_group_id", limit: 4 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.integer "question_id", limit: 4 - t.boolean "published" - end - - create_table "identifier_schemes", force: :cascade do |t| - t.string "name", limit: 255 - t.string "logo", limit: 255 - t.string "api_key", limit: 255 - t.string "api_secret", limit: 255 - t.string "authorization_uri", limit: 255 - t.string "landing_page_uri", limit: 255 - t.string "params", limit: 255 + t.text "text" + t.integer "guidance_group_id" t.datetime "created_at" t.datetime "updated_at" t.integer "question_id" t.boolean "published" end + create_table "identifier_schemes", force: :cascade do |t| + t.string "name" + t.string "logo" + t.string "api_key" + t.string "api_secret" + t.string "landing_page_uri" + t.string "params" + t.datetime "created_at" + t.datetime "updated_at" + end + create_table "languages", force: :cascade do |t| t.string "abbreviation" t.string "description" @@ -369,6 +366,14 @@ t.datetime "updated_at" end + create_table "user_identifiers", force: :cascade do |t| + t.string "identifier" + t.datetime "created_at" + t.datetime "updated_at" + t.integer "user_id" + t.integer "identifier_scheme_id" + end + create_table "user_statuses", force: :cascade do |t| t.string "name" t.text "description"