views/users/user.haml in ditty-0.9.1 vs views/users/user.haml in ditty-0.10.1
- old
+ new
@@ -1,4 +1,4 @@
= form_control(:name, user)
= form_control(:surname, user)
- if policy(user).permitted_attributes.include? :role_id
- = form_control(:role_id, user, type: 'select', options: Ditty::Role.order(:name).as_hash(:id, :name), name: 'user[role_id][]', field: :roles, multiple: true)
+ = form_control(:role_id, user, type: 'select', options: Ditty::Role.order(:name).as_hash(:id, :name), name: 'user[role_id][]', value: user.new? ? [] : user.roles_dataset.map(:id), multiple: true)