rails/rails — pull request #13140 by mhenrixon (2013-12-03 08:57:13+00:00)
Title: Adds implicit conversion of regclass to text

In the following example

```ruby
class Transaction < ActiveRecord::Base
belongs_to :account
scope :with_type, -> do
select "#{self.name.underscore.pluralize}.*, #{self.name.underscore.pluralize}.tableoid::regclass as table_name"
end
end
```

Calling `Transaction.with_type` will generate a warning like:
> unknown OID: table_name(2205) (SELECT game_transactions.*, game_transactions.tableoid::regclass as table_name FROM "game_transactions" WHERE "game_transactions"."account_id" = $1 AND "game_transactions"."id" = 226 LIMIT 1)

This commit ensures that we implicitly just convert the regclass to text to get rid of this warning.