Forum: Rails Engines Model's table names

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Nuno (Guest)
on 2006-04-06 12:43
Hello, I would like to have all the tables referenced by my engine
prefixed with "something"

I can't use the set_table_name function because unfortunately this break
fixtures usage (fixtures are not found if fixture name != model name !=
table name)

I've tried to have a look inside engines code but I'm not (yet ;-)) able
to touch something without the risk of injecting bugs.

is there a patch somewhere ?

Thanks
James A. (Guest)
on 2006-04-06 12:57
(Received via mailing list)
There is *preliminary* support (see
ActiveRecord::Base#wrapped_table_name) for prefixes in the latest
(1.1) release of the Engines plugin, although I'm not sure how they'll
interact with the fixtures method. One thing to bear in mind is that
the testing extensions provided with Engines let you specify the class
and table names for your fixtures (see the login/user engines for an
example of one way to achieve this, although I don't believe that what
I've done there is perfect).

However, as I said at the start, support is basic at the moment - the
relevant ticket is http://dev.rails-engines.org/tickets/67, if you can
contribute in any way, please re-open it and add your debug
info/patches there.

It's a bit of a tangled web with prefixes, migrations and fixtures all
influencing the right table name and affecting the class inference
mechanisms.

My best advice is to go ahead and change the engines code until you
have something you feel works, and then submit the diff as a patch,
where it will be double-checked and tested :)

- james

On 4/6/06, Nuno <removed_email_address@domain.invalid> wrote:
> is there a patch somewhere ?
>
> Thanks
>
> --
> Posted via http://www.ruby-forum.com/.
> _______________________________________________
> engine-users mailing list
> removed_email_address@domain.invalid
> http://lists.rails-engines.org/listinfo.cgi/engine...
>


--
* J *
  ~
Nuno (Guest)
on 2006-04-06 14:07
James A. wrote:
> There is *preliminary* support (see
> ActiveRecord::Base#wrapped_table_name) for prefixes in the latest
> (1.1) release of the Engines plugin, although I'm not sure how they'll
> interact with the fixtures method. One thing to bear in mind is that
> the testing extensions provided with Engines let you specify the class
> and table names for your fixtures (see the login/user engines for an
> example of one way to achieve this, although I don't believe that what
> I've done there is perfect).

I've had a look to these source files, seems to be fine for me... I'll
give it a try

>
> My best advice is to go ahead and change the engines code until you
> have something you feel works, and then submit the diff as a patch,
> where it will be double-checked and tested :)
>

Ahem, why not ? But I've not finished the 1st chapter of "Ruby for the
Super Super newbies" :-)
This topic is locked and can not be replied to.