Skip to content
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

ArgumentError using helpers with Ruby 3 #906

Open
CaioFML opened this issue Mar 19, 2021 · 4 comments
Open

ArgumentError using helpers with Ruby 3 #906

CaioFML opened this issue Mar 19, 2021 · 4 comments

Comments

@CaioFML
Copy link

CaioFML commented Mar 19, 2021

Hello guys, I upgraded my Ruby for 3.0 from 2.7 and I'm having some troubles.

I have this helper in application_helper.rb:

  def format_datetime(date, format: :small)
    I18n.l(date, format: format)
  rescue I18n::ArgumentError
    nil
  end

And when I call this method h.format_datetime with format like:

  def expire_at(format: :small)
    format_datetime(object.expire_at, format: format)
  end

I receive:

image

But it works if I extract to a private method in draper, any thoughts?

@CaioFML CaioFML changed the title ArgumentError using helpers ArgumentError using helpers with Ruby 3 Mar 19, 2021
@brian-kephart
Copy link

Using the current version of Draper from RubyGems results in errors like these. Support for Ruby 3 kwargs was added to git, but has not been released yet. Try installing directly from Github and see if the issue disappears.

# Gemfile
gem 'draper', github: 'drapergem/draper'

@codebycliff is there anything blocking a new minor/patch release for Ruby 3 support?

@CaioFML
Copy link
Author

CaioFML commented Mar 23, 2021

Using the current version of Draper from RubyGems results in errors like these. Support for Ruby 3 kwargs was added to git, but has not been released yet. Try installing directly from Github and see if the issue disappears.

# Gemfile
gem 'draper', github: 'drapergem/draper'

@codebycliff is there anything blocking a new minor/patch release for Ruby 3 support?

Yeah, it works, thanks!

Waiting for the release for ruby 3 support! :)

@tisba
Copy link

tisba commented Apr 13, 2021

See #902

@mishina2228
Copy link

@CaioFML v4.0.2 has been released, so I think we can close this issue.
cc @codebycliff

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

No branches or pull requests

4 participants