Browse Source

add pghero

main
Christoph Marzell 3 weeks ago
parent
commit
988b160e65
  1. 3
      Gemfile
  2. 3
      Gemfile.lock
  3. 1
      config/initializers/init_postgres.rb
  4. 9
      config/routes.rb

3
Gemfile

@ -58,4 +58,5 @@ group :development do
end
gem 'devise'
gem 'rufus-scheduler'
gem 'rufus-scheduler'
gem 'pghero'

3
Gemfile.lock

@ -177,6 +177,8 @@ GEM
orm_adapter (0.5.0)
pg (1.6.2-x64-mingw32)
pg (1.6.2-x86_64-linux)
pghero (3.5.0)
activerecord (>= 6)
pp (0.6.3)
prettyprint
prettyprint (0.2.0)
@ -294,6 +296,7 @@ DEPENDENCIES
jquery-rails
jquery-ui-rails
pg (~> 1.1)
pghero
puma (>= 5.0)
rails (~> 7.1.5, >= 7.1.5.2)
rufus-scheduler

1
config/initializers/init_postgres.rb

@ -0,0 +1 @@
puts ActiveRecord::Base.connection.execute("CREATE EXTENSION IF NOT EXISTS pg_stat_statements;")

9
config/routes.rb

@ -3,8 +3,17 @@ Rails.application.routes.draw do
resources :entries
resources :users
root to: "entries#index"
end
authenticate :user, ->(u) { u.is_admin? } do
scope :admin do
mount PgHero::Engine, at: "pghero", as: :pghero
end
end
resources :entries do
post :start_timer, on: :collection
member do

Loading…
Cancel
Save