Using Role::PermissionsAttributeCoder makes migration from 1.4 lose role permissions
Added by David Escala over 9 years ago.
Updated about 8 years ago.
Permissions and roles
In 1.4 permissions are serialized as
- !ruby/sym add_project
- !ruby/sym edit_project
fails to load it. next thing it is saved empty.
- Status changed from New to Needs feedback
- Resolution set to Cant reproduce
Please read SubmittingBugs. And what was the ruby version that you used with 1.4?
This is the old environment from which the database is coming from:
Ruby version 1.8.7 (x86_64-linux)
RubyGems version 1.8.24
Rails version 2.3.17
Database adapter mysql
And this is the target environment:
Redmine version 2.4.2.stable
Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux]
Rails version 3.2.16
Database adapter Mysql2
In the old environment a Symbol object is serialized as
=> "--- !ruby/sym add_project"
=> "--- :add_project\n"
I don't know the reason of this difference, though both are valid YAML representations of a Symbol object.
My setup is serializing this way because it uses a plugin which replaces YAML with ZAML
To avoid hitting this bug use this patch
@@ -58,7 +58,7 @@ class Role < ActiveRecord::Base
has_many :members, :through => :member_roles
- serialize :permissions, ::Role::PermissionsAttributeCoder
+ serialize :permissions
- Status changed from Needs feedback to Closed
- Resolution changed from Cant reproduce to Invalid
Thanks for providing details.
The cause of the error was plugin, not Redmine core. I close this issue.
Also available in: Atom