Issue with custom inflections?

7 views
Skip to first unread message

Daro

unread,
Jan 8, 2011, 8:05:52 AM1/8/11
to Ruby on Rails: Core
Hi! I have a model called produccion_alternativa.
I added a new inflection rule in config/initializers/inflections.rb,
like this:
inflect.irregular('produccion_alternativa',
'producciones_alternativas')

I have other model called productor that has a relation with
produccion_alternativa:
class Productor < ActiveRecord::Base
has_many :producciones_alternativas

class ProduccionAlternativa < ActiveRecord::Base
belongs_to :productor

When a I try to get all the producciones_alternativas for a productor,
I get this error:
irb(main):010:0> Productor.first.producciones_alternativas
NameError: uninitialized constant Productor::ProduccionesAlternativa

Any ideas? Thank you very much

Ryan Bigg

unread,
Jan 8, 2011, 6:03:16 PM1/8/11
to rubyonra...@googlegroups.com
Please ask this on the rubyonrails-talk mailing list, as this list is reserved for core Rails issues.

> --
> 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 rubyonra...@googlegroups.com.
> To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.
>

Reply all
Reply to author
Forward
0 new messages