When using Rails 5.0.2 or 5.1.0-rc, roles are being truncated when performing a batch add, or when retrieving all roles, I have tested this with a few configurations, using existing and new projects. As a sanity check I've tested the code below with my own models, and never experience issues, it is only with the 'Role' model.
For example, when initializing the roles for the first time, I iterate over an array of what roles are permitted, the last entry is always skipped ('standard' role will never be added):
ROLES = ['admin', 'supervisor', 'standard']
ROLES.each do |role|
Role.where(name: role).first_or_create!
end
Even after manually adding the 'standard' role using rails console, I can verify that all three roles exist, however the following code will fail to load the last entry, again, the 'standard' role in this case:
When using Rails 5.0.2 or 5.1.0-rc, roles are being truncated when performing a batch add, or when retrieving all roles, I have tested this with a few configurations, using existing and new projects. As a sanity check I've tested the code below with my own models, and never experience issues, it is only with the 'Role' model.
For example, when initializing the roles for the first time, I iterate over an array of what roles are permitted, the last entry is always skipped ('standard' role will never be added):
Even after manually adding the 'standard' role using rails console, I can verify that all three roles exist, however the following code will fail to load the last entry, again, the 'standard' role in this case: