Skip to content

Instantly share code, notes, and snippets.

View francois-ferrandis's full-sized avatar

François Ferrandis francois-ferrandis

View GitHub Profile
@francois-ferrandis
francois-ferrandis / rails_helper.rb
Created December 7, 2022 15:58
Measure time spent in DB in a RSpec suite
RSpec.configure do |config|
config.before(:suite) do
$_events = []
end
config.around do |example|
callback = lambda do |*args|
$_events << ActiveSupport::Notifications::Event.new(*args)
end
@francois-ferrandis
francois-ferrandis / active_admin.rb
Created March 7, 2018 11:59
Customize the active admin layout
# config/initializers/active_admin.rb
# ...rest of the initializer here...
module AdminPageLayoutOverride
def build(*args)
# you can move the call to super at the end, if you wish
# to insert things at the begining of the page
super