I did this and the (canned) test failed.
My setup is just like Sam’s except class and table names are different.
I have a model class where set_table_name sets the legacy table name. I
created a fixture yml file named with the actual table name and refer to
that in my test. Nevertheless, I got an error running the test.
My class is called Externaldoc instead of UserReq. This line:
assert_kind_of Externaldoc, externaldocs(:first)
I read the ticket you submitted and the followups to it that resulted in
a patch. Unfortunately I was not able to install the patch without
breaking my system. This may be because I really don’t know what I’m
doing.
Anyway, it sounds like tests were passing for sam…what am I missing?
BTW, the problem I am trying to solve could perhaps be solved another
way, and maybe y’all could point out that way, and then all this would
be moot, for me at least.
I am working with a legacy postgresql database. One of the issues is
that there are four types of data stored in the same table. Call them
types a thru d. To get all type a rows, add a “where url is not null”
clause to the sql. And so forth. We used to handle this in our java ORM
(iBATIS) but since Rails uses such a different paradigm, I’m not sure
what to do.
I want to end up with four different objects and override find_all in
each of them so that calling find_all on, say the b object, returns all
rows that match a certain SQL where clause. But so far that doesn’t seem
to be testable.
I am open to suggestions about what might better. Thanks!
D
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.