Sha256: 0acfed5e8459a61bfa80aa07076fdf585c461b8cd55037e965b455a89a9424dc

Contents?: true

Size: 807 Bytes

Versions: 5

Compression:

Stored size: 807 Bytes

Contents

# typed: true
# frozen_string_literal: true

begin
  require "active_record"
rescue LoadError
  return
end

module Tapioca
  module Dsl
    module Compilers
      module Extensions
        module ActiveRecord
          attr_reader :__tapioca_delegated_types

          def delegated_type(role, types:, **options)
            @__tapioca_delegated_types ||= {}
            @__tapioca_delegated_types[role] = { types: types, options: options }

            super
          end

          attr_reader :__tapioca_secure_tokens

          def has_secure_token(attribute = :token, **)
            @__tapioca_secure_tokens ||= []
            @__tapioca_secure_tokens << attribute

            super
          end

          ::ActiveRecord::Base.singleton_class.prepend(self)
        end
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
tapioca-0.11.9 lib/tapioca/dsl/extensions/active_record.rb
tapioca-0.11.8 lib/tapioca/dsl/extensions/active_record.rb
tapioca-0.11.7 lib/tapioca/dsl/extensions/active_record.rb
tapioca-0.11.6 lib/tapioca/dsl/extensions/active_record.rb
tapioca-0.11.5 lib/tapioca/dsl/extensions/active_record.rb