Sha256: 435dace617a75ba949e4f61eb179d8d27fd9042a67f69ab3b9b551a41ef8e042

Contents?: true

Size: 483 Bytes

Versions: 1

Compression:

Stored size: 483 Bytes

Contents

require 'ar_finder_form/attr'
module ArFinderForm
  module Attr
    class Static < Base

      attr_reader :values
      def initialize(column, name, values, options)
        super(column, name, options)
        @values = values || {}
      end

      def setup
        # do nothing
      end

      def build(context)
        context.add_condition(
          values.map{|v| "#{column_name(context)} #{v}"}.
          join(' %s ' % options[:connector]))
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ar_finder_form-0.1.0 lib/ar_finder_form/attr/static.rb