Sha256: a0b8c82e185f82a07e6fe055606d34296d764d50f07283eb723b5e05dad3f621

Contents?: true

Size: 332 Bytes

Versions: 21

Compression:

Stored size: 332 Bytes

Contents

module TagQueryBuilder
    
  def build_query_from_filters(q, filters)
    filters.each do |filter, value|
      q = method("add_filter_for_#{filter}".to_sym).call(q, value)
    end
    return q
  end
    
  # Fucntion to add a like to the name
  def add_filter_for_like(q, like)
    q.where '(title LIKE ?)', "%#{like}%"
  end 
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
ems-0.1.12 lib/query_builder/tag_query_builder.rb
ems-0.1.11 lib/query_builder/tag_query_builder.rb
ems-0.1.10 lib/query_builder/tag_query_builder.rb
ems-0.1.9 lib/query_builder/tag_query_builder.rb
ems-0.1.8 lib/query_builder/tag_query_builder.rb
ems-0.1.7 lib/query_builder/tag_query_builder.rb
ems-0.1.6 lib/query_builder/tag_query_builder.rb
ems-0.1.5 lib/query_builder/tag_query_builder.rb
ems-0.1.4 lib/query_builder/tag_query_builder.rb
ems-0.1.3 lib/query_builder/tag_query_builder.rb
ems-0.1.2 lib/query_builder/tag_query_builder.rb
ems-0.1.1 lib/query_builder/tag_query_builder.rb
ems-0.1.0 lib/query_builder/tag_query_builder.rb
ems-0.0.9 lib/query_builder/tag_query_builder.rb
ems-0.0.8 lib/query_builder/tag_query_builder.rb
ems-0.0.7 lib/query_builder/tag_query_builder.rb
ems-0.0.6 lib/query_builder/tag_query_builder.rb
ems-0.0.5 lib/query_builder/tag_query_builder.rb
ems-0.0.4 lib/query_builder/tag_query_builder.rb
ems-0.0.3 lib/query_builder/tag_query_builder.rb