Skip to content

Instantly share code, notes, and snippets.

View flozano's full-sized avatar

Francisco A. Lozano flozano

  • Kii corporation
  • Valencia, Spain
View GitHub Profile
@flozano
flozano / defer-FKs-and-validations-when-using-seed-dumps.rb
Created December 5, 2022 18:57
[Defer all foreign keys and validations in RoR after dumping seed]
# Assuming 'base.rb' contains a seed dump (https://github.com/rroblak/seed_dump)
# Disable validations
ApplicationRecord.class_eval do
def valid?(a=1)
true
end
end
# Not sure if the transactional code is needed...
@flozano
flozano / quartz-snippets.md
Created April 27, 2023 09:33
Quartz snippets

Force execution

update QRTZ_TRIGGERS set next_fire_time = (select unix_timestamp(date_add(now(), interval 1 minute)) * 1000) where job_name = 'myJob';

Pause execution of a trigger