James Byrne wrote:
> 
> To preserve ARs default table naming and related conventions a model
> class MUST inherit directly from ActiveRecord.  This is apparently an
> artifact of how the AR class is actually assembled from modules "on-
> the-fly" as it were.  If you do use the generic_model class then you
> must provide in each descendant class the actual table name the class
> should use.  The project class should include this:
> 
> --->
> class Project < GenericModel
> 
>    set_table_name "projects"   # do not forget to pluralise the table
> name!
> 
>    # project-specific methods
>    # project has only 5, 2 of which override GenericModel
>    # definitions
>  end
> <---
> 

Interesting... I haven't encountered any issues, and I haven't set the 
table name in any of my classes.  And a test I just did reported the 
proper name:

C:\railsworkspace\testbase_sdrndlinuxapp>ruby script/console
Loading development environment (Rails 2.3.2)
>> Project.table_name
=> "projects"
>>
-- 
Posted via http://www.ruby-forum.com/.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to