Files
openfoodnetwork/app/models/spree/role.rb
Maikel Linke a7140d1f60 Use only admin role, on demand
We are now creating the role on demand which removes the need for
seeding it as well.
2024-12-19 09:02:04 +11:00

14 lines
340 B
Ruby

# frozen_string_literal: true
module Spree
class Role < ApplicationRecord
has_and_belongs_to_many :users, join_table: 'spree_roles_users',
class_name: "Spree::User"
# The only role we have at the moment:
def self.admin
Spree::Role.find_or_create_by(name: 'admin')
end
end
end