Sha256: 62a23f41ae1e8d14d01d6fb57bf4db20d42a164a7a41d47df0507d8926e49da5

Contents?: true

Size: 554 Bytes

Versions: 4

Compression:

Stored size: 554 Bytes

Contents

module Faalis
  module Generators
    module Concerns

      # Adds `required` key to `fields`. Fields with this key as true will
      # be non optional fields
      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
          fields_with("required", true).collect {|x| x["name"]}
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
faalis-0.24.2 lib/faalis/generators/concerns/required.rb
faalis-0.24.0 lib/faalis/generators/concerns/required.rb
faalis-0.23.0 lib/faalis/generators/concerns/required.rb
faalis-0.22.0 lib/faalis/generators/concerns/required.rb