Sha256: 2d1b8628f1aa5f7908df705ef7a2094566a477ab6d84afd1cdd5835a86759aa4

Contents?: true

Size: 401 Bytes

Versions: 7

Compression:

Stored size: 401 Bytes

Contents

# frozen_string_literal: true

module TableSaw
  class InformationSchema
    %i(belongs_to constraint_names has_many).each do |method_name|
      define_method method_name do
        foreign_key_relationships.public_send method_name
      end
    end

    private

    def foreign_key_relationships
      @foreign_key_relationships ||= TableSaw::Queries::ForeignKeyRelationships.new
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
table_saw-2.6.0 lib/table_saw/information_schema.rb
table_saw-2.5.0 lib/table_saw/information_schema.rb
table_saw-2.4.3 lib/table_saw/information_schema.rb
table_saw-2.4.2 lib/table_saw/information_schema.rb
table_saw-2.4.1 lib/table_saw/information_schema.rb
table_saw-2.4.0 lib/table_saw/information_schema.rb
table_saw-2.3.0 lib/table_saw/information_schema.rb