Skip to content

Commit

Permalink
Gems: drop devise_invitable
Browse files Browse the repository at this point in the history
This gem is blocking our Rails v7.2 upgrade path with an error that only appears when adding this gem via Rails Engine generator scripts.

Will document how to add this gem post-GBL Admin install as a local customization option.

Addresses #95
  • Loading branch information
ewlarson committed Oct 9, 2024
1 parent 1f37667 commit 19aab94
Show file tree
Hide file tree
Showing 16 changed files with 6 additions and 145 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ else
gem "awesome_print"
gem "blacklight_advanced_search"
gem "devise-bootstrap-views", "~> 1.0"
gem "devise_invitable", "~> 2.0.0"
gem "dotenv-rails"
gem "haml"
gem "inline_svg"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The gem is available as open source under the terms of the [Apache 2.0 License](
* ~~Send GBLADMIN JavaScript pack to NPM like Blacklight~~
* ~~Improve test coverage~~
* ~~Fix CI test runner~~
* Debug Rails 7.2 support
* Debug Rails 7.2 support (remove devise_invitable, see [#915](https://github.com/scambra/devise_invitable/issues/915))
* Separate dct_references_s support into a separate model
* Import/Export dct_references_s outside of the main document model
* Migrate our GBL api controllers to just RSolr-based models
Expand Down
3 changes: 1 addition & 2 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,7 @@ class User < ApplicationRecord

# Include default devise modules. Others available are:
# :confirmable, :lockable, :timeoutable, :trackable and :omniauthable
devise :invitable, :database_authenticatable,
:recoverable, :rememberable, :validatable
devise :database_authenticatable, :recoverable, :rememberable, :validatable

has_many :bookmarks, dependent: :destroy, as: :user
has_many :notifications, dependent: :destroy, as: :recipient
Expand Down
1 change: 0 additions & 1 deletion app/views/admin/users/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<h1 style="width:100%; margin-bottom:2rem;">
Users
<%= link_to '+ New User', new_user_invitation_path, {class: 'btn btn-primary float-right'} %>
</h1>

<table class="table table-striped table-bordered sortable">
Expand Down
31 changes: 0 additions & 31 deletions config/locales/devise_invitable.en.yml

This file was deleted.

2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
end

# @TODO - Users
# devise_for :users, controllers: {invitations: "devise/invitations"}, skip: [:registrations]
# devise_for :users, skip: [:registrations]
# as :user do
# get "/sign_in" => "devise/sessions#new" # custom path to login/sign_in
# get "/sign_up" => "devise/registrations#new", :as => "new_user_registration" # custom path to sign_up/registration
Expand Down
12 changes: 0 additions & 12 deletions db/migrate/20230316183001_add_geoblacklight_admin_gem.rb
Original file line number Diff line number Diff line change
Expand Up @@ -364,20 +364,8 @@ def change
t.datetime 'remember_created_at'
t.datetime 'created_at', precision: 6, null: false
t.datetime 'updated_at', precision: 6, null: false
t.string 'invitation_token'
t.datetime 'invitation_created_at'
t.datetime 'invitation_sent_at'
t.datetime 'invitation_accepted_at'
t.integer 'invitation_limit'
t.string 'invited_by_type'
t.bigint 'invited_by_id'
t.integer 'invitations_count', default: 0
t.boolean 'admin', default: false, null: false
t.index ['email'], name: 'index_users_on_email', unique: true
t.index ['invitation_token'], name: 'index_users_on_invitation_token', unique: true
t.index ['invitations_count'], name: 'index_users_on_invitations_count'
t.index ['invited_by_id'], name: 'index_users_on_invited_by_id'
t.index %w[invited_by_type invited_by_id], name: 'index_users_on_invited_by_type_and_invited_by_id'
t.index ['reset_password_token'], name: 'index_users_on_reset_password_token', unique: true
end

Expand Down
39 changes: 1 addition & 38 deletions db/structure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -349,15 +349,7 @@ CREATE TABLE public.users (
reset_password_sent_at timestamp without time zone,
remember_created_at timestamp without time zone,
created_at timestamp(6) without time zone NOT NULL,
updated_at timestamp(6) without time zone NOT NULL,
invitation_token character varying,
invitation_created_at timestamp without time zone,
invitation_sent_at timestamp without time zone,
invitation_accepted_at timestamp without time zone,
invitation_limit integer,
invited_by_type character varying,
invited_by_id bigint,
invitations_count integer DEFAULT 0
updated_at timestamp(6) without time zone NOT NULL
);


Expand Down Expand Up @@ -670,35 +662,6 @@ CREATE INDEX index_mappings_on_import_id ON public.mappings USING btree (import_

CREATE UNIQUE INDEX index_users_on_email ON public.users USING btree (email);


--
-- Name: index_users_on_invitation_token; Type: INDEX; Schema: public; Owner: -
--

CREATE UNIQUE INDEX index_users_on_invitation_token ON public.users USING btree (invitation_token);


--
-- Name: index_users_on_invitations_count; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_users_on_invitations_count ON public.users USING btree (invitations_count);


--
-- Name: index_users_on_invited_by_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_users_on_invited_by_id ON public.users USING btree (invited_by_id);


--
-- Name: index_users_on_invited_by_type_and_invited_by_id; Type: INDEX; Schema: public; Owner: -
--

CREATE INDEX index_users_on_invited_by_type_and_invited_by_id ON public.users USING btree (invited_by_type, invited_by_id);


--
-- Name: index_users_on_reset_password_token; Type: INDEX; Schema: public; Owner: -
--
Expand Down
3 changes: 1 addition & 2 deletions geoblacklight_admin.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ Gem::Specification.new do |s|
s.add_dependency "config", "~> 4.0"
s.add_dependency "devise", "~> 4.7"
s.add_dependency "devise-bootstrap-views", "~> 1.0"
s.add_dependency "devise_invitable", "~> 2.0"
s.add_dependency "dotenv-rails", "~> 2.8"
s.add_dependency "geoblacklight", "~> 4.4"
s.add_dependency "haml", "~> 5.2"
Expand All @@ -42,7 +41,7 @@ Gem::Specification.new do |s|
s.add_dependency "paper_trail", "~> 15.0"
s.add_dependency "pg", "~> 1.4"
s.add_dependency "qa", "~> 5.0"
s.add_dependency "rails", "~> 7.0", "< 7.2"
s.add_dependency "rails", "~> 7.0", "< 7.3"
s.add_dependency "ruby-progressbar"
s.add_dependency "simple_form", "~> 5.0"
s.add_dependency "sprockets", "~> 3.0"
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/geoblacklight_admin/config_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def set_routes
end
# Users
devise_for :users, controllers: {invitations: "devise/invitations"}, skip: [:registrations]
devise_for :users, skip: [:registrations]
as :user do
get "/sign_in" => "devise/sessions#new" # custom path to login/sign_in
get "/sign_up" => "devise/registrations#new", :as => "new_user_registration" # custom path to sign_up/registration
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
# frozen_string_literal: true

require "devise_invitable"

# Assuming you have not yet modified this file, each configuration option below
# is set to its default value. Note that some are commented out while others
# are not: uncommented lines are intended to protect your configuration from
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

1 change: 0 additions & 1 deletion spec/test_app_templates/Gemfile.extra
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ gem 'active_storage_validations'
gem 'awesome_print'
gem 'blacklight_advanced_search'
gem 'devise-bootstrap-views', '~> 1.0'
gem "devise_invitable", "~> 2.0.0"
gem 'dotenv-rails'
gem 'haml'
gem 'hashdiff'
Expand Down

0 comments on commit 19aab94

Please sign in to comment.