Sha256: 70010453ba54685760c96e208e77b2b90eb4d62a3367294af6c6cffe50531d43
Contents?: true
Size: 640 Bytes
Versions: 11
Compression:
Stored size: 640 Bytes
Contents
# frozen_string_literal: true module TableSaw module DependencyGraph class AddDirective attr_reader :table_name, :partial, :has_many attr_accessor :ids def initialize(table_name, ids: [], partial: true, has_many: []) @table_name = table_name @ids = ids @partial = partial @has_many = has_many end alias partial? partial def selectable? partial? && Array(ids).size.positive? end def queryable? !partial || selectable? end def primary_key TableSaw.schema_cache.primary_keys(table_name) end end end end
Version data entries
11 entries across 11 versions & 1 rubygems