T
Tom
Hi everyone,
I'm seeing something I can't explain. I have an activerecord object
called a Gift which inherits from ActiveRecord::Base like a typical
rails model (which it is).
However, if I run Gift.find_by_sql I'm getting objects which, when I
call .class say "Gift" but when I call .instance_of?(Gift) one or two
of the 16 rows I get back say "true" and the rest say "false". This
leads me to believe that I'm getting back gift classes and not
instances of gift objects.
How is something like this possible? This problem has been making me
miss statically-typed languages
Any advice would be much appreciated.
Thanks,
Tom
I'm seeing something I can't explain. I have an activerecord object
called a Gift which inherits from ActiveRecord::Base like a typical
rails model (which it is).
However, if I run Gift.find_by_sql I'm getting objects which, when I
call .class say "Gift" but when I call .instance_of?(Gift) one or two
of the 16 rows I get back say "true" and the rest say "false". This
leads me to believe that I'm getting back gift classes and not
instances of gift objects.
How is something like this possible? This problem has been making me
miss statically-typed languages
Any advice would be much appreciated.
Thanks,
Tom