Closed jamesst20 closed 5 years ago
You should change default: :something
to default: :something.to_s
or default: -> { :something }
.
That doesn't fix it sadly
Can you show me the minimal code that produces the warning?
Sorry for the late response
describe "GET #index" do
it "returns a success response" do
create :cipc_check
get :index, params: {}
expect(response).to be_successful
end
end
class CipcChecksGrid < ApplicationGrid
scope { CipcCheckBase }
...
filter(:scope_filter, :enum, select: scopes(:active_or_recent, :processable, :unprocessable, :archived, :discarded),
header: t("helpers.scopes.title"), default: :active_or_recent, include_blank: false) do |value, scope|
scope.send(value)
end
end
where scopes method is
def self.scopes(*scopes)
lambda do
scopes.each_with_object({}) do |elem, acc|
acc[I18n.t("helpers.scopes.#{elem}")] = elem
end
end
end
Randomized with seed 3542
:default as a Symbol is now treated as a method name. Use String instead or -> { default } if you really want default value to be a Symbol but not a String.
1 example, 0 failures, 1 passed
Finished in 0.315739499 seconds
@bogdan
I can see you removed the warning here https://github.com/bogdan/datagrid/commit/bd54295b5e7476a86113c317a6c980a8cd5a2f82
Is there a chance you can make a release?
Thank you
v1.5.9
Hi,
I was wondering if it could be fixed. When using default parameter in filter(), I get this warning:
Edit: Sorry for the title, I did not notice the error was this long
Thank you