开发者

Where are activerecord object APIs located?

开发者 https://www.devze.com 2023-03-15 23:41 出处:网络
I\'m looking at some ruby code in rails, which looks like: user.jobs.order(\'created_at\').not_closed.page(5)

I'm looking at some ruby code in rails, which looks like:

user.jobs.order('created_at').not_closed.page(5)

In ActiveRecord::Base, I don't see any any "not_closed", "page", or "order" methods in the API. Wha开发者_如何学编程t possible places can these methods originate?


order is a core ActiveRecord method.

not_closed most likely, should be in the Job model (apps/models/job.rb).

page could be in the Jobs model, or in an external gem/plugin (probably pagination related).

0

精彩评论

暂无评论...
验证码 换一张
取 消