You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to fire after_create callback in error model so I can delete older error records
I tried:
class Error < ApplicationRecord
after_create :delete_old
def delete_old
Error.order('id desc').offset(5).destroy_all
end
end
But didn't work
The text was updated successfully, but these errors were encountered:
I want to fire after_create callback in error model so I can delete older error records
I tried:
class Error < ApplicationRecord
after_create :delete_old
def delete_old
Error.order('id desc').offset(5).destroy_all
end
end
But didn't work
The text was updated successfully, but these errors were encountered: