What exactly is Arel in Rails 3.0?

前端 未结 4 1852
旧时难觅i
旧时难觅i 2020-12-12 09:26

I understand that it is a replacement for ActiveRecord and that it uses objects instead of queries.

But...

why is this better?

will objects/queries

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-12 09:58

    Arel in Rails 3 makes relation objects where the db isn't queried until you need it. Much more efficient.

    It's also more natural (once you get used to it) which is really the great strength of Rails.

提交回复
热议问题