Skip to content

Commit

Permalink
remove devise gem
Browse files Browse the repository at this point in the history
  • Loading branch information
o-200 committed Dec 30, 2024
1 parent d59e943 commit d7896c1
Show file tree
Hide file tree
Showing 35 changed files with 135 additions and 854 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ gem "jbuilder"
gem "cssbundling-rails", "~> 1.4"

gem "foreman", "~> 0.88.1"
gem "devise", "~> 4.9"

# Use Redis adapter to run Action Cable in production
# gem "redis", ">= 4.0.1"
Expand Down
14 changes: 0 additions & 14 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@ GEM
public_suffix (>= 2.0.2, < 7.0)
ast (2.4.2)
base64 (0.2.0)
bcrypt (3.1.20)
benchmark (0.4.0)
bigdecimal (3.1.9)
bindex (0.8.1)
Expand Down Expand Up @@ -107,12 +106,6 @@ GEM
debug (1.10.0)
irb (~> 1.10)
reline (>= 0.3.8)
devise (4.9.4)
bcrypt (~> 3.0)
orm_adapter (~> 0.1)
railties (>= 4.1.0)
responders
warden (~> 1.2.3)
diff-lcs (1.5.1)
drb (2.2.1)
error_highlight (0.7.0)
Expand Down Expand Up @@ -200,7 +193,6 @@ GEM
racc (~> 1.4)
nokogiri (1.18.0-x86_64-linux-musl)
racc (~> 1.4)
orm_adapter (0.5.0)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
Expand Down Expand Up @@ -255,9 +247,6 @@ GEM
regexp_parser (2.9.3)
reline (0.6.0)
io-console (~> 0.5)
responders (3.1.1)
actionpack (>= 5.2)
railties (>= 5.2)
rexml (3.4.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
Expand Down Expand Up @@ -347,8 +336,6 @@ GEM
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)
useragent (0.16.11)
warden (1.2.9)
rack (>= 2.0.9)
web-console (4.2.1)
actionview (>= 6.0.0)
activemodel (>= 6.0.0)
Expand Down Expand Up @@ -384,7 +371,6 @@ DEPENDENCIES
cssbundling-rails (~> 1.4)
database_cleaner-active_record (~> 2.2)
debug
devise (~> 4.9)
error_highlight (>= 0.7.0)
factory_bot_rails
faker (~> 3.5)
Expand Down
13 changes: 5 additions & 8 deletions app/controllers/podcasts_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
class PodcastsController < ApplicationController
# before_action :authenticate_user!, only: %i[update, destroy]

def index
podcasts = get_podcasts
render partial: "podcasts_list", locals: { podcasts: podcasts }
Expand All @@ -15,7 +13,7 @@ def new
end

def create
@podcast = current_user.podcasts.build(podcast_params)
@podcast = Podcast.build(podcast_params)

respond_to do |format|
if @podcast.save
Expand Down Expand Up @@ -45,7 +43,6 @@ def edit

def update
@podcast = Podcast.find_by(id: params[:id])
# @podcast = current_user.podcasts.find_by(id: params[:id]) TODO: исправить на это когда будет auth

respond_to do |format|
if @podcast.update(podcast_params)
Expand All @@ -70,7 +67,7 @@ def update
end

def destroy
podcast = current_user.podcasts.find(params[:id])
podcast = Podcast.find_by(id: params[:id])

if current_user.podcast.destroy
redirect_to root_path
Expand All @@ -83,9 +80,9 @@ def destroy
private

def get_podcasts
if current_user
return current_user.podcasts if params[:filter] == "my_podcasts"
end
# if current_user
# return current_user.podcasts if params[:filter] == "my_podcasts"
# end

Podcast.all
end
Expand Down
2 changes: 0 additions & 2 deletions app/models/podcast.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ class Podcast < ApplicationRecord
has_one_attached :photo
has_one_attached :audio

belongs_to :user

validates :title, presence: true
validates :title, length: { minimum: 2 }
end
8 changes: 0 additions & 8 deletions app/models/user.rb

This file was deleted.

16 changes: 0 additions & 16 deletions app/views/devise/confirmations/new.html.erb

This file was deleted.

5 changes: 0 additions & 5 deletions app/views/devise/mailer/confirmation_instructions.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/devise/mailer/email_changed.html.erb

This file was deleted.

3 changes: 0 additions & 3 deletions app/views/devise/mailer/password_change.html.erb

This file was deleted.

8 changes: 0 additions & 8 deletions app/views/devise/mailer/reset_password_instructions.html.erb

This file was deleted.

7 changes: 0 additions & 7 deletions app/views/devise/mailer/unlock_instructions.html.erb

This file was deleted.

25 changes: 0 additions & 25 deletions app/views/devise/passwords/edit.html.erb

This file was deleted.

16 changes: 0 additions & 16 deletions app/views/devise/passwords/new.html.erb

This file was deleted.

43 changes: 0 additions & 43 deletions app/views/devise/registrations/edit.html.erb

This file was deleted.

31 changes: 0 additions & 31 deletions app/views/devise/registrations/new.html.erb

This file was deleted.

28 changes: 0 additions & 28 deletions app/views/devise/sessions/new.html.erb

This file was deleted.

15 changes: 0 additions & 15 deletions app/views/devise/shared/_error_messages.html.erb

This file was deleted.

25 changes: 0 additions & 25 deletions app/views/devise/shared/_links.html.erb

This file was deleted.

16 changes: 0 additions & 16 deletions app/views/devise/unlocks/new.html.erb

This file was deleted.

Loading

0 comments on commit d7896c1

Please sign in to comment.