Skip to content

Conversation

@pzupan
Copy link

@pzupan pzupan commented Nov 20, 2019

No description provided.


def self.call(template)
def self.call(template, source=nil)
source =|| template.source

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
source =|| template.source
source ||= template.source

Copy link

@olleolleolle olleolleolle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR fixes the issue – but has 1 typo.

Hello, I got interested in this PR, and tried it, in my app, and my test procedure was: "Start rails console and see if I still get that error warning message".

Error Warning that got me looking for a Rails 6 fix:

DEPRECATION WARNING: Single arity template handlers are deprecated. Template handlers must
now accept two parameters, the view object and the source for the view object.
Change:
  >> JPbuilderHandler.call(template)
To:
  >> JPbuilderHandler.call(template, source)

Update*: I made this as a Pull Request, so that I could try it out, using my Git repo in my Gemfile's gem directive.
pzupan#1

And, my rails console no longer warns.

DonSchado added a commit to juicer-io/jpbuilder that referenced this pull request Oct 20, 2020
since the gem is unmaintained I borrowed the fix from:
bigjason#13
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

Successfully merging this pull request may close these issues.

2 participants