You can use this to
join on tables to which you don??™t have a defined Active Record relationship.
:from: Whereas the :joins option will let you specify extra tables to join to in the FROM
clause, the :from option allows you to specify the entire contents of the FROM clause of the
SQL statement.
:select: You can use the :select option to specify extra columns in the SELECT clause of
the resulting SQL statement. Any extra columns will be added as additional attributes on
the returned objects, called piggyback attributes. However, because Active Record doesn??™t
know how to save these extra attributes, the objects it returns will automatically be marked
as read only.
:readonly: Specifying true for this parameter will mark the records returned from this find
call as read only and prevent changes to the objects from being saved. Likewise, specifying
false for this parameter will ensure that the records returned will not be marked as read
only, regardless of whether they should (such as when the :select parameter is used).
Pages:
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494