Project

General

Profile

« Previous | Next » 

Revision 1f5d2516

Added by Tom Caspy over 8 years ago

refs #12147 - adding permissions setter to roles

Problem

Calling FactoryGirl.build(:role, :permissions => []) needs a setter
directly on role. Otherwise it fails on Rails 4 with:
ActiveRecord::HasManyThroughNestedAssociationsAreReadonly: Cannot modify
association 'Role#permissions' because it goes through more than one
other association.

Solution

Add a setter for permissions in role.rb. It's compatible with Rails 3
and 4.

  • added
  • modified
  • copied
  • renamed
  • deleted