Sha256: 3af6b37e8a2917ca34bfef1baff121709a2cde6491c1549b388354dc4964aef1

Contents?: true

Size: 501 Bytes

Versions: 4

Compression:

Stored size: 501 Bytes

Contents

module Faalis
  module Generators
    module Concerns
      module RequireFields

        def self.included(base)
          # Non optional fields, comma separated
          base.class_option :required, :type => :string, :default => "", :desc => "Non optional fields, comma separated"
        end

        private

        def required_fields
          if not options[:required].empty?
            return options[:required].split(",")
          end
          []
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faalis-0.19.0 lib/faalis/generators/concerns/required.rb
faalis-0.18.1 lib/faalis/generators/concerns/required.rb
faalis-0.18.0 lib/faalis/generators/concerns/required.rb
faalis-0.17.0 lib/faalis/generators/concerns/required.rb