Sha256: da6dc95dda0cd54cef70bf8d9a23b7dbffe61ba2075f82f661aff77d6e5c7eb5

Contents?: true

Size: 417 Bytes

Versions: 2

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true

# rubocop:disable ClassAndModuleChildren
# rubocop:disable Style/ClassVars
class ActiveRecord::Base
  mattr_accessor :shared_connection
  @@shared_connection = nil

  def self.connection
    @@shared_connection || retrieve_connection
  end
end
# rubocop:enable Style/ClassVars
# rubocop:enable ClassAndModuleChildren
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dynamic_fields_for_rails-1.0.1 test/config/active_record.rb
dynamic_fields_for_rails-1.0.0 test/config/active_record.rb