Sha256: 7ac666e5eb40d5570354aa47cfd3d1c54e90ae4bca51c9c66e052cb54908bdcc

Contents?: true

Size: 635 Bytes

Versions: 24

Compression:

Stored size: 635 Bytes

Contents

<% module_namespacing do -%>
class <%= class_name %>Query < Riveter::Query::Base

  # TODO: optionally provide methods here for additional
  # results such as summaries, aggregated data or other
  # associated data

protected

  def build_relation(filter)
    # start with a relation
    relation = <%= class_name %>.all

    #
    # TODO: apply conditions etc to the query using the filter
    #
    # E.g.
    #
    # :.name filter
    #
    # relation = relation.where?(filter.name_like.present?, 'name LIKE ?', filter.name_like)
    #
    # :. page filter
    # relation.page(filter.page)
    #

    relation
  end

end
<% end -%>

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.8.3 lib/generators/riveter/query/templates/query.rb
riveter-0.8.2 lib/generators/riveter/query/templates/query.rb
riveter-0.8.1 lib/generators/riveter/query/templates/query.rb
riveter-0.8.0 lib/generators/riveter/query/templates/query.rb
riveter-0.7.0 lib/generators/riveter/query/templates/query.rb
riveter-0.6.0 lib/generators/riveter/query/templates/query.rb
riveter-0.3.0 lib/generators/riveter/query/templates/query.rb
riveter-0.2.1 lib/generators/riveter/query/templates/query.rb
riveter-0.2.0 lib/generators/riveter/query/templates/query.rb
riveter-0.1.1 lib/generators/riveter/query/templates/query.rb
riveter-0.0.15 lib/generators/riveter/query/templates/query.rb
riveter-0.0.14 lib/generators/riveter/query/templates/query.rb
riveter-0.0.13 lib/generators/riveter/query/templates/query.rb
riveter-0.0.12 lib/generators/riveter/query/templates/query.rb
riveter-0.0.11 lib/generators/riveter/query/templates/query.rb
riveter-0.0.10 lib/generators/riveter/query/templates/query.rb
riveter-0.0.9 lib/generators/riveter/query/templates/query.rb
riveter-0.0.8 lib/generators/riveter/query/templates/query.rb
riveter-0.0.7 lib/generators/riveter/query/templates/query.rb
riveter-0.0.6 lib/generators/riveter/query/templates/query.rb