Re: Extending methods in the module Inflector ?

Radek Hnilica
2005-07-19T17:03:02Z

On Tue, Jul 19, 2005 at 12:32:03PM -0400, Sean T Allen
wrote:
> scaffold takes the class name as well...

I think it''s not true.

Scafold takes some unknown argument, do some black magic with it and
then takes class name from that magic and oraculum.

Try to prove.  I''ll be happy If I''m wrong.

>
> that should take care of your problem...

No.  Try to test it by yourself.


The black magic have to do something with Inflector.  So if I''m able
to kill that inflector, may be there will be a chance.


The code is:
class Pokus < ActiveRecord::Base
    set_table_name ''pokus''
end

class PokusController < ApplicationController
    scaffold :pokus
end

Table name is ''pokus''

As its displayed on error page.  The Rails strips the ending
''s'' from
the class name and try to work with class Poku which does not exist.

Imagine a databes with two tables:
tabulkas and tabulka

I think all those problems come from black magic with english plurals
and singulars.