How to override AR last method for one class


#1

I have Calculations class. It’s mysql view.
I want to get last record by:

def self.last
order(:custom_field).limit(1)
end

It’s work for Calculations.last
But don’t for Calculations.prepayed.last with err: