ActiveRecord dynamic finder methods

M

Mark Volkmann

I've received conflicting answers to this question and I'd like to
confirm the correct answer.

When an ActiveRecord dynamic finder method is invoked, does it create
a new method and save it so the method actually exists the next time
it is called OR does it just evaluate the query based on the method
name every time.

I don't have an opinion on which way is better, I just want to know
how it currently works.
 
J

James Edward Gray II

I've received conflicting answers to this question and I'd like to
confirm the correct answer.

When an ActiveRecord dynamic finder method is invoked, does it create
a new method and save it so the method actually exists the next time
it is called OR does it just evaluate the query based on the method
name every time.

I don't have an opinion on which way is better, I just want to know
how it currently works.

You can always ask Ruby:
=> false

James Edward Gray II
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,599
Members
45,175
Latest member
Vinay Kumar_ Nevatia
Top