Skip to content

Releases: RockSolt/filterameter

1.0.1: Enable Ruby LSP Support

09 Jan 16:51
1d1d16f
Compare
Choose a tag to compare

This release enables Ruby LSP support including Hover and Go-to-Definition.

image

Release 1.0.0: Filterameter!

19 Aug 20:49
Compare
Choose a tag to compare

What if you could increase readability and reduce boilerplate code at the same time as you simplified and sped development of Rails controllers? Sound too good to be true?!? It's not, it's Filterameter.

With the look and feel of a Rails DSL, declare filters and sorts for search pages. The next developer in (hey, maybe that's you!) will thank you. It's obvious what filter parameters are available and easy to add more.

Version 0.10.0: Developer Happiness

29 Jul 16:10
Compare
Choose a tag to compare

Have you ever been frustrated by a gem that just didn't work?!? Only to figure out after banging your head for a bit that you had a typo. Or, worse yet, you should have RTFM.

With this release we check for typos for you. And we RTFM for you. Add a test to each controller to validate the filter declarations. The test results not only catch these types of errors but explain how to fix them.

Did you...

  • typo the name of an attribute or scope?
  • use an inline scope that takes argument as a filter?
  • try to filter by a class method that is not a scope?
  • filter with a scope that takes more than one argument?

No problem. Your tests will set you straight.

Version 0.9.0: Configurable Filter Key

18 Jul 20:30
Compare
Choose a tag to compare

By default the filter parameters are nested under the key filter. That can be customized via the new configuration option filter_key, or set it to false to indicate that the filter parameters are not nested.

Version 0.8.0: Sorting

16 Jul 16:52
Compare
Choose a tag to compare
  • most filters are sortable by default
  • sort only attributes / scopes can be added
  • a default sort can be specified for each controller

The query parameter sort is nested under filter and can optionally specify + or - to indicate the direction:

?filter[sort]=-created_at

Version 0.7.0: Conditional scopes, build_query_from_filters, min_only/max_only

14 Jun 18:03
Compare
Choose a tag to compare
  • Conditional Scopes: For scopes that do not take arguments, they will be conditionally applied depending on the boolean query parameter.
  • Method build_query_from_filters: New method makes it easier to build the query directly, or override parts of the process.
  • Fix for min_only/max_only ranges: Fixes the main attribute filter when a range is declared as min or max only.

Version 0.6.1: Fix range bug

30 May 20:51
Compare
Choose a tag to compare

If a range filter was used without specifying the name attribute, the min and max filters were generated with the wrong attribute name.

Version 0.6.0: Support Collection Associations

28 May 16:09
Compare
Choose a tag to compare

Nested associations can now include collection (has_many) associations. If a query includes a nested filter with a collection association, the distinct method is called on the query to keep the results unique.

Version 0.5.0: Retire Query Classes

14 May 21:10
Compare
Choose a tag to compare

This is a breaking change: the mixin for controllers was renamed from Filterameter::DeclarativeControllerFilters to Filterameter::DeclarativeFilters. All references must be updated.

Why retire query classes? The goal of Filterameter is to simplify Rails controllers. Extending the functionality to query classes did not add much value and muddied the purpose of the gem.

Filterameter 0.4.2

13 May 16:56
Compare
Choose a tag to compare

This updates the scope filters to use public_send instead of send. The factory would not have built a scope filter for a private method, but this formally closes the door on that possibility.