Hey Robert,

This is a good solution to the generated code but my concern is why is
this solution needed at all. This file isn't generated via the
scaffold which means without knowledge of it after you generate the
scaffold the code is broken by default
Edit: I was wrong. Rails 3 does generate the ecom.rb file accordingly
with the scaffold. Rails 2.3.10 does not.

Even so, if the scaffold knows how to generate the proper table name
from Ecom::Cart. Why does active record need us to explicitly define a
table_name_prefix. Shouldn't it have the same ability to work out that
the Ecom::Cart table is ecom_carts? and If not I'm really just
wondering the design reasoning behind deciding to go with the ecom.rb
method. I'm mainly interested in the process of decision making I
think.

Cheers,
Brian

On Jun 27, 12:37 am, Robert Pankowecki <[email protected]>
wrote:
> Works fine for me thanx to ecom.rb
>
> module Ecom
>   def self.table_name_prefix
>     'ecom_'
>   end
> end
>
> make sure that you have
>
> class Ecom::Cart < ActiveRecord::Base
> end
>
> instead of
>
> module Ecom
>  class Cart < ActiveRecord::Base
>  end
> end
>
> in your ecom/cart.rb
>
> Robert Pankoweckihttp://robert.pankowecki.pl

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-core?hl=en.

Reply via email to