xrforge/manyfold/usr/src/app/config/initializers/xrforge.rb

21 lines
621 B
Ruby
Raw Normal View History

2025-10-29 10:47:55 +01:00
Rails.application.config.to_prepare do
Model # Zeitwerk autoload model
# Reopen the Model class to add new functionality
# This must match the name of your ActiveRecord class exactly.
class Model
# The 'after_save' macro is now run within the context of the existing Model class.
after_save :execute_initializer_after_save
# Define the new method to be executed on save.
def execute_initializer_after_save
# Your custom logic to execute after Model.save or Model.update! goes here.
# 📝 Example Logic:
puts "\n-------- JA --------- #{self.id}\n\n"
end
end
end