On Thu, Apr 10, 2014 at 7:06 PM, Dheeraj Kumar <[email protected]>wrote:
#to_sql + #execute is widely used, because it's a legitimate, and popular > use case. Sometimes, we just need pure ruby objects. AR models become an > overhead in those situations. > AR::Base#connection and its API are totally public, but #to_sql wasn't intended to be. AR is not a SQL builder, it is a layer between Ruby and databases. That's why guides have never covered Arel etc., those are tools used by AR to build SQL *internally*, not to be exposed to end-users. I'd bet #to_sql ended up in api.rubyonrails.org because nobody nodoc'ed it, I doubt it was intentional. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/rubyonrails-core. For more options, visit https://groups.google.com/d/optout.
