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
-
Tom Locke August 20th, 2008 @ 03:10 PM
- Milestone set to Hobo 0.8
- State changed from new to open
-
Tom Locke August 20th, 2008 @ 03:18 PM
- State changed from open to resolved
Fixed in fc842b37f195c60e23.
Thanks Matt
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป