#231 ✓resolved
Matt Jones

Set type metadata on find_by_sql results

Reported by Matt Jones | August 8th, 2008 @ 03:13 PM | in Hobo 0.8

Calls to findbysql lead to problems, as member_class is not set for the result. Example:


User.find(:all).member_class => User
vs
User.find_by_sql('select * from users').member_class => nil

hobo.rb needs to add:


def find_by_sql(*args, &b)
  result = super(*args)
  result.member_class = self # find_by_sql always returns array
  result
end

--Matt

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages