[Rails] Re: rails 3 inflection
On Aug 6, 12:16 pm, gatopardo <gato.pa...@gmail.com> wrote:
> I am still confused by rails 3 new rules, and knowing so little about
> it,I want some help on a particular problem: inflection when creating
> models:
> what can I do in order to get rails generate model using words ending
> in 'a', so that the plural generated add an 's'
>
> If I edit config/initializers/inflections.rb and add the
> appropiate rule
> inflect.plural /(.*)a$/, '\1as'
> I solve the problem.
>
> What collateral effects is to expect ?
>
As far as I know, all this does is change inflections. This can have
consequences if it ends up changing the pluralization of existing,
models, resources etc. that were in your app. For example rails knows
that has_many :items means that the associated model is Item. if you
changed the pluralization rules such that when rails singularized
items it got something other than item then rails would guess the
wrong class name
That said, for me pluralizing words ending in 'a' does seem to just
add a s.
Fred
Fred
> GP
--
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 rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home