Sha256: ef79f176eb924528222a43df5a5b6060ba79ab0467c7d7eb63537e996c707d57

Contents?: true

Size: 567 Bytes

Versions: 3

Compression:

Stored size: 567 Bytes

Contents

module TaskHelper
  class Field < Base
    data_member :entity_id, :name, :desc, :type_name, :default,
                :validate_options, :position, :visible, :size, :cols,
                :rows, :initial, :pretty_type_name, :formula_field,
                :formula_operation, :start_from, :step

    def initialize(args = {}, form: nil, **params)
      @form = form
      super(args.merge(params))
    end

    def form
      @form ||=
        Database.all.each do |d|
          break Form.find(database: d.id, form: entity_id) || next
        end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
task_helper-0.0.3 lib/task_helper/field.rb
task_helper-0.0.2 lib/task_helper/field.rb
task_helper-0.0.1 lib/task_helper/field.rb