Find instance method "where" in Rails Docs

Hello Experts.

It seems impossible to make a simple task, find given method for given class in Ruby on Rails 3.1.3 docs.

For example, I need to find ActiveRecord#where.

Using link "Methods" in http://rubydoc.info/gems/activerecord/frames
gives the source code, but no description:

def where(opts, *rest)
  return self if opts.blank?

  relation = clone
  relation.where_values += build_where(opts, rest)
  relation
end


Apparently, the principal site: http://api.rubyonrails.org/
has no link to "Methods" or to index at all.

Can you help please?

I just would like to know, can be this call signature used:

User.where activated: true
or
User.where :activated => true
instead of longly:

User.where("activated == TRUE")

"activated" is a field in table "users".

Thank you.
LVL 2
BitlabAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

BitlabAuthor Commented:
PS. I found reference to where in "principal site" using seach.
It gave: where(opts, *rest)
But there is no description of signature.
0
JESiiCommented:
You're right; my favorite site is http://apidock.com/rails/ActiveRecord/QueryMethods/where but no documentation there as well.

Check out http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html - 'where' is referenced in an example with a brief discussion.

Notice that 'where' is an arel (A Relational Algebra) method, so try here: https://github.com/brynary/arel#readme
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
JESiiCommented:
Here's the Arel version used in Rails: https://github.com/rails/arel
0
BitlabAuthor Commented:
Thank you.

Despite there is no doc yet, for me, apidoc is a discovery of nicely usable doc-site.
And ... ARel is looks like a discovery of a huge horizon ... "algebra" is a great way
shape a mind ...
0
BitlabAuthor Commented:
correction: "ARel is looks" meant "ARel looks"
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Ruby

From novice to tech pro — start learning today.