-
Notifications
You must be signed in to change notification settings - Fork 5
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
Release 1.0.0.beta.1 #17
Conversation
closes #8
paginate_results unless opts[:skip_pagination] | ||
|
||
# Add custom meta data if we've defined the method | ||
# @meta.merge!(self.custom_meta_data) if self.respond_to?(:custom_meta_data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
filterer = SortingFiltererD.new(sort: 'foo') | ||
end | ||
|
||
it 'can change to desc' do | ||
expect_any_instance_of(FakeQuery).to receive(:order).with('baz DESC NULLS LAST').and_return(FakeQuery.new) | ||
expect_any_instance_of(FakeQuery).to receive(:order).with('baz desc NULLS LAST').and_return(FakeQuery.new) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [112/80]
@@ -88,7 +96,7 @@ def starting_query | |||
end | |||
|
|||
sort_option 'id', default: true | |||
sort_option Regexp.new('foo([0-9]+)'), -> (results, matches, filterer) { results.order(matches[1] + ' ' + filterer.direction) } | |||
sort_option Regexp.new('foo([0-9]+)'), -> (results, matches, filterer) { results.order(matches[1] + ' ' + filterer.sort_direction) } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [134/80]
expect(f).to receive(:offset).with(0).and_return(f) | ||
it 'applies default filters' do | ||
expect_any_instance_of(FakeQuery).to receive(:where).with(foo: 'bar').and_return(FakeQuery.new) | ||
filterer = DefaultFiltersFilterer.filter({}, foo: 'bar') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless assignment to variable - filterer
.
} | ||
def sort | ||
@sort ||= begin | ||
if params[:sort] && (opt = find_sort_option_from_param(params[:sort])) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Useless assignment to variable - opt
.
This isn't a complete rewrite, but the API has completely changed. Will look for some real-world feedback before releasing
1.0.0
.