panoramic icon indicating copy to clipboard operation
panoramic copied to clipboard

rails 6.1 ArgumentError missing keyword: locals

Open abstracts33d opened this issue 5 years ago • 4 comments

In rails 6.1 the gem does not work narrowed it down to lib/panoramic/resolver.rb 46

actionview (6.1.0) lib/action_view/template.rb initialize initalize(source, identifier, handler, locals:, format: nil, variant: nil, virtual_path: nil) the call to add is made like this

ActionView::Template.new(source, identifier, handler, details)

which does not include locals named argument

was not throwing an error in 6.0 because of default value provided initalize(source, identifier, handler, format: nil, variant: nil, locals: nil, virtual_path: nil, updated_at: nil)

can be fixed for 6.1 like this

      ActionView::Template.new(source, identifier, handler,
                               :locals => [],
                               :format => Mime[record.format].to_sym,
                               :virtual_path => virtual_path(record.path, record.partial))

not sure of what is needed to make it compatible with all versions

here is a pr regarding the fix for 6.1 PR 46

abstracts33d avatar Dec 15 '20 13:12 abstracts33d

+1

andrewsheelan avatar Mar 03 '21 18:03 andrewsheelan

I'm working on a rails 6.1 project, and when I add panoramic without specifying a version, bundler resolves it to 0.0.6 since 0.0.7 has a dependency on rails ~> 4

However, even when I grab version 0.0.7 on its own to peek at resolver.rb, I don't see the fix from this commit. Could you possibly publish a new version of your gem with this fix included?

sduret avatar Nov 04 '21 19:11 sduret

I worked around this issue for now by adding the latest ref from github to the gemfile:

gem "panoramic", github: "andreapavoni/panoramic", ref: "bd766f61f32e5fcf3c050f56f6e16d49a169d025"

tweeres04 avatar Nov 24 '21 18:11 tweeres04

Anyone knows if any fix for this issue with Paranoic is released? I worked around this problem with @tweeres04 suggestion by now.

fernandobello85 avatar Mar 07 '22 13:03 fernandobello85