Sha256: 198be436b8077b2fe1613babee9acb78beb409c44ffd873d870b45c1e69e8448
Contents?: true
Size: 510 Bytes
Versions: 10
Compression:
Stored size: 510 Bytes
Contents
module Spree::TokenResource module ClassMethods def token_resource has_one :tokenized_permission, :as => :permissable delegate :token, :to => :tokenized_permission, :allow_nil => true after_create :create_token end end module InstanceMethods def create_token create_tokenized_permission(:token => ::SecureRandom::hex(8)) token end end def self.included(receiver) receiver.extend ClassMethods receiver.send :include, InstanceMethods end end
Version data entries
10 entries across 10 versions & 1 rubygems