Sha256: 45389bdc8d3ba642a308ce9bab350e57f53925296632a15fb3f67ca1345087ee
Contents?: true
Size: 432 Bytes
Versions: 12
Compression:
Stored size: 432 Bytes
Contents
module Spree class RoleUser < ActiveRecord::Base self.table_name = "spree_roles_users" belongs_to :role, class_name: "Spree::Role" belongs_to :user, class_name: Spree::UserClassHandle.new after_save :generate_admin_api_key private def generate_admin_api_key if role.admin? && user.respond_to?(:spree_api_key) && !user.spree_api_key user.generate_spree_api_key! end end end end
Version data entries
12 entries across 12 versions & 1 rubygems