1

I am trying to add a custom method on one of my CFWheels Model but I am not able to do this. I have been reading the documentation but still not found an answer.

User.cfc

component extends="Component" {
    ...
    function getCustomSearch(){
        ...
    }
    ...
}

I want to change:

model("users").findAll(...)

To

model("users").getCustomSearch(...)

In order to refactor some function.

Is this possible? In that case, what I am doing wrong?

Thank you for your attention.

Regards.

Rodrigo R.
  • 25
  • 3

2 Answers2

1

It will need to be model('user') not users; Wheels looks for the singular variant to match the models/User.cfc file.

Neokoenig
  • 1,102
  • 7
  • 16
0

I have left my computer and when I came back it was working. Dan Roberts was right, it's necessary to reload.

Thanks to all for the help!

Rodrigo R.
  • 25
  • 3