Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provide convenient accessors for filters and search params #3

Closed
bolshakov opened this issue Dec 15, 2015 · 0 comments
Closed

Provide convenient accessors for filters and search params #3

bolshakov opened this issue Dec 15, 2015 · 0 comments

Comments

@bolshakov
Copy link
Contributor

Something like

before do |scope, params|
  params[:filters].fetch(:name)
  # or
  params[:filters][:name]
end
bolshakov added a commit that referenced this issue Dec 16, 2015
…ine domain specific methods: #3

```ruby
filters = Might::FilterParameters.new([parameter])

filters['height'] #=> #<Might::FilterParameter ....>
fitlers['width'] #=> nil

fitlers.fetch('height') #=>  #<Might::FilterParameter ....>
fitlers.fetch(:width) #=> fails with Might::FilterParameters::FilterError
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant