#885 ✓resolved
Don Ziesig

wrong model name - extracted from translation key - has_many through

Reported by Don Ziesig | December 13th, 2010 @ 03:45 PM | in Hobo 1.3 (Rails 3)

When using a has_many :through association with :accessible => true, I get the following error when trying to create a new permission record:

wrong model name: "roles" (extracted from translation key: "roles.form.select_many.prompt"). You might want to use the translate/t tag/method instead.

the offending code in the permission model is:

has_many :roles, :through => :permission_roles, :accessible => true

which causes the backtrace.

the following code does not backtrace, but it doesn't do what it is supposed to do either

has_many :roles, :through => :permission_roles, :accessible => false

or

has_many :roles, :through => :permission_roles

The same problem occurs in reverse (Creating new role record with has_many :permissions ... :accessible => true) due to the need for mirroring code in the two models.

This used to work on Hobo < 1 and Rails < 3.

Comments and changes to this ticket

  • Domizio Demichelis

    Domizio Demichelis December 19th, 2010 @ 03:59 PM

    • Milestone set to Hobo 1.3 (Rails 3)
    • State changed from “new” to “resolved”
    • Assigned user set to “Domizio Demichelis”
    • Milestone order changed from “197930” to “0”

    This has been fixed in the commit e94a56cb2526c35b293373a6c1f4bd437430beef
    included in pre24.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages