Sha256: 8775b4dc1479f88634130bc7b909e338903313263967eca4798662d9fa10231d

Contents?: true

Size: 433 Bytes

Versions: 6

Compression:

Stored size: 433 Bytes

Contents

module GraphQL
  module Sugar
    module Define
      module Attributes
        def self.call(type_defn, *field_names)
          model_class = Sugar.get_model_class(type_defn)

          field_names = model_class.columns_hash.keys.map(&:to_sym) if field_names.count == 0
          field_names.each do |field_name|
            Sugar::Define::Attribute.call(type_defn, field_name)
          end
        end
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
graphql-sugar-0.1.6 lib/graphql/sugar/define/attributes.rb
graphql-sugar-0.1.5 lib/graphql/sugar/define/attributes.rb
graphql-sugar-0.1.4 lib/graphql/sugar/define/attributes.rb
graphql-sugar-0.1.3 lib/graphql/sugar/define/attributes.rb
graphql-sugar-0.1.2 lib/graphql/sugar/define/attributes.rb
graphql-sugar-0.1.1 lib/graphql/sugar/define/attributes.rb