Sha256: ce2809d8d1cb54109416752ac9f50d06f12414532f0ea2adf463421b0ae017dd

Contents?: true

Size: 425 Bytes

Versions: 36

Compression:

Stored size: 425 Bytes

Contents

class <%= class_name.pluralize %>Filter < Refine::Filter
  include Refine::Conditions
  @@default_stabilizer = Refine::Stabilizers::UrlEncodedStabilizer

  def initial_query
    <%= class_name %>.all
  end

  def table
    <%= class_name %>.arel_table
  end

  def conditions
    [
<% @conditions.each do |condition| -%>
      <%= condition[:condition] %>Condition.new("<%= condition[:field] %>"),
<% end -%>
    ]
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
refine-rails-2.13.3 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.13.2 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.13.1 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.13.0 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.12.2 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.12.1 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.12.0 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.12 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.11 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.10 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.9 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.8 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.6 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.5 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.4 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.3 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.2 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.1 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.11.0 lib/generators/filter/templates/filter.rb.erb
refine-rails-2.10.1 lib/generators/filter/templates/filter.rb.erb