Rails models come with certain built-in methods like this:
Appointment.new
Appointment.find(1)
How do I add more methods to Appointment
? It's apparently not done by adding methods to app/models/appointment.rb
. Doing that adds methods to an instance of Appointment
, but I want to add methods to Appointment
itself. How do I do that?
def self.some_method
#do stuff
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With