Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
first: #role_list could not operate on model new_record with troles field equal to nil. I've added this simplest case.
You UserSetup had only Factory with :troles => [] which is not like real case with User.new => having troles field nil.
second: about thing of my last email: Adding .list (#add_roles) resolved email's issue and led me to the next break:
I enabled Common Write API specs and one of them is falling on:
5) Troles::Strategy::RefMany it should behave like Common API behaves like Common Write API#set_roles should set set roles to :user only
Failure/Error: user.set_roles(:admin)
NameError:
undefined local variable or method
role_model' for #<Troles::Storage::RefMany:0x8705c30> Shared Example Group: "Common Write API" called from ./spec/troles/common/api_spec.rb:36 # ./lib/troles/storage/base_many.rb:14:in
find_roles'# ./lib/troles/storage/ref_many.rb:25:in
set_roles' # ./lib/troles/common/api/write.rb:39:in
set_roles'# ./spec/troles/common/api/write_api_spec.rb:11:in `block (3 levels) in <top (required)>'
'''''
This is up to you.
The first thing I want to make work is simply adding roles ;)