Hi all,
On the 5.2.0beta branch of rails this line
fails as value isn't called with any arguments from rails tag methods, eg:
object is available here, so shouldn't need to be passed as an arg:
so the change should be easy, but I can't figure out how to bundle ransack against rails 5.2.0beta to fix the specs. Any guidance and I'd be happy to help out with a PR :grin:
@ttrmw This is part of a series of problems related to Rails 5.2, particularly I posted this problem here already: https://github.com/activerecord-hackery/ransack/issues/849#issuecomment-351026690
In order to keep everything in one place and avoid confusion, I suggest this issue be closed.
You may however gladly try to fix it with a pull request! :)
I can't figure out how to bundle ransack against rails 5.2.0beta to fix the specs
Can you be more specific? What did you try, where are you stuck?
Try this branch for adding any fixes to. https://github.com/activerecord-hackery/ransack/pull/858
I'm experiencing this also on Rails 5.2.0.beta2 - in my request specs that call a template with a form_for I keep experiencing this error:
Failure/Error: <%= f.text_field :first_name, class: "form-control" %>
ActionView::Template::Error:
wrong number of arguments (given 0, expected 1)
When I downgrade to rails 5.1.4 or remove the ransack gem from the project this spec runs fine.
It's only when I pass in invalid params like this:
context 'invalid data' do
it 'shows errors' do
get edit_user_url(user)
put user_url(user), params: { user: { email: '' } }
expect(controller.flash[:alert]).to eq("Email can't be blank")
end
end
Tried to pull from the polyamorous_1.3.2 branch but that didn't seem to help.
Encountered the same issue on Rails 5.2.0.beta2
wrong number of arguments (given 0, expected 1)
Trace: https://gist.github.com/cdesch/91c7b74bee06fe274bcb499beae8e42a
Still within Rails 5.2 RC1. I am sure everyone is aware of that though. Any update on progress? Is this a priority?
@bbonislawski has PR open for fixes for this.
https://github.com/activerecord-hackery/ransack/pull/859
I created a merge commit but I can't get travis CI to understand which activerecord gem to use (specs pass locally).
Merge fork:
https://github.com/spark-solutions/ransack/pull/1
@corinnekunze Fantastic news! We are going to move forward with 5.2 RC1 due to our project release is quite a ways out and the ActiveStorage has already made life easier. Hopefully, the PR will be merged soon.
Most helpful comment
I'm experiencing this also on Rails 5.2.0.beta2 - in my request specs that call a template with a
form_forI keep experiencing this error:When I downgrade to rails 5.1.4 or remove the
ransackgem from the project this spec runs fine.It's only when I pass in invalid params like this:
Tried to pull from the
polyamorous_1.3.2branch but that didn't seem to help.