I think I've solved this... based on comments here -

http://spinach.andascarygoat.com/2008/7/9/inflector-fun-with-datamapper-and-merb

I added:

Extlib::Inflection.plural_word 'regatta', 'regattas'

to class Regatta instead of to init.rb.

Evidently the line added to init.rb gets executed before datamapper is
loaded. Seems to be working now.


On Feb 26, 4:49 pm, MarkMT <[email protected]> wrote:
> Not sure if this is a merb or datamapper issue, but I have the
> following situation...
>
> I have resource called 'Regatta'. I discovered early on that 'rake
> db:automigrate' wanted to create a db table called 'regattum', when
> what I really want is 'regattas'. So after a little digging around it
> seemed that the solution was to add 'Extlib::Inflection.plural_word
> 'regatta', 'regattas'' to init.rb.
>
> That seemed to work - I ended up with a regattas table in my db
> (mysql). All good, but now I come to actually access that table. In my
> controller action Regattas#index I have '@regattas = Regatta.all', but
> the action crashes because the SQL that is generated tries to retrieve
> records from the 'regattum' database.
>
> What's the right way to handle this?
>
> Mark.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"merb" 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/merb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to