module Spree
  User.class_eval do
    has_many :devices, class_name: "Devices"
  end
end

module Spree
  User.class_eval do
    after_create :set_default_role
    
    has_many :devices, class_name: "Devices"
    
    def set_default_role
      self.spree_roles << Spree::Role.find_or_create_by(name: "user")
    end
  end
end

Set default role for new user to "user".
Set default role for new user to "user".

