Skip to content

Commit

Permalink
remove useless queries
Browse files Browse the repository at this point in the history
  • Loading branch information
adrienpoly committed Nov 24, 2024
1 parent 46ec7e4 commit a526076
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions app/controllers/speakers_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ def index

# GET /speakers/1
def show
@talks = @speaker.talks.with_essential_card_data.order(date: :desc)
@back_path = speakers_path
set_meta_tags(@speaker)
end
Expand Down Expand Up @@ -56,7 +55,7 @@ def user_kind
end

def set_speaker
@speaker = Speaker.includes(:talks).find_by!(slug: params[:slug])
@speaker = Speaker.find_by!(slug: params[:slug])
redirect_to speaker_path(@speaker.canonical) if @speaker.canonical.present?
end

Expand Down
5 changes: 0 additions & 5 deletions app/controllers/topics_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ def index

def show
@topic = Topic.find_by!(slug: params[:slug])
@pagy, @talks = pagy(
@topic.talks.with_essential_card_data.order(date: :desc),
limit: 12,
page: params[:page]&.to_i || 1
)
end

def set_user_favorites
Expand Down

0 comments on commit a526076

Please sign in to comment.