Invoking an activerecord relation method on the result of a calculation method, which returns a FixN

I was seeing these examples in a book:

Person.minimum(:age).where(‘last_name <> ?’, ‘Drake’)
Person.minimum(:age).having(‘min(age) > 17’).group(:last_name)

The thing is minimum is returning a FixNum. When invoking the relation
methods (e.g. where, having) on a fixnum will raise an exception:

undefined method `where’ for 1:Fixnum

So am I missing something here?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs