Sha256: a53cb22b32f57ff7d12f3b8b4d12304d97871228e297455eae83c804ad303504

Contents?: true

Size: 687 Bytes

Versions: 18

Compression:

Stored size: 687 Bytes

Contents

# typed: true
# frozen_string_literal: true

begin
  require "active_support"
rescue LoadError
  return
end

module Tapioca
  module Dsl
    module Compilers
      module Extensions
        module FrozenRecord
          attr_reader :__tapioca_scope_names

          def scope(name, body)
            @__tapioca_scope_names ||= []
            @__tapioca_scope_names << name

            super
          end

          ::ActiveSupport.on_load(:before_configuration) do
            next unless defined?(::FrozenRecord::Base)

            ::FrozenRecord::Base.singleton_class.prepend(::Tapioca::Dsl::Compilers::Extensions::FrozenRecord)
          end
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
tapioca-0.16.8 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.7 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.6 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.5 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.4 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.3 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.2 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.1 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.16.0 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.15.1 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.15.0 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.14.4 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.14.3 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.13.3 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.13.2 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.13.1 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.13.0 lib/tapioca/dsl/extensions/frozen_record.rb
tapioca-0.12.0 lib/tapioca/dsl/extensions/frozen_record.rb