Sha256: c8cb760c2afcc1e679bf82570bf2ce779671a4429bbefc1efc92777b882526c2

Contents?: true

Size: 680 Bytes

Versions: 15

Compression:

Stored size: 680 Bytes

Contents

module VisualConditionBuilder
  module Helper
    def dictionary_values(id_field, label_field)
      self.map {|r| {id: r[id_field], label: r[label_field]}}
    end
  end
end

#INJETANDO METODO para_* em um conjunto de array
class Array
  include VisualConditionBuilder::Helper
end

#INJETANDO METODO para_* em um conjunto de registros ActiveRecord::Relation
if defined?(ActiveRecord)
  module ActiveRecord
    class Relation
      include VisualConditionBuilder::Helper
    end
  end
end

#INJETANDO METODO para_* em um conjunto de registros Mongoid::Criteria
if defined?(Mongoid)
  module Mongoid
    class Criteria
      include VisualConditionBuilder::Helper
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
visual_condition_builder-2.2.7 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.6 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.5 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.4 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.3 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.2 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.1 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.2.0 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.6 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.5 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.4 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.3 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.2 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.1 lib/visual_condition_builder/helper.rb
visual_condition_builder-2.1.0 lib/visual_condition_builder/helper.rb