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

Support for Rails 6 #74

Open
andreydeineko opened this issue Feb 19, 2020 · 24 comments
Open

Support for Rails 6 #74

andreydeineko opened this issue Feb 19, 2020 · 24 comments

Comments

@andreydeineko
Copy link

andreydeineko commented Feb 19, 2020

Is it planned to support Rails 6?

When, if yes?

Thank you!

@andreydeineko
Copy link
Author

@Vinnie1991 how did you manage to install it in Rails 6 app given the following dependency: https://github.com/patricklindsay/wice_grid/blob/master/Gemfile.lock#L7:

rails (~> 5.0, < 5.3)

@kreintjes
Copy link
Collaborator

Hi @andreydeineko, we are indeed planning Rails 6 support. We still have some work to do to make that happen, i.e. get the tests stable on CircleCI again and start running builds against Rails 6 as well (any help with that would be appreciated).

In the mean time you could try my fork in which I fix a Rails 5.2 deprecation warning and loosen the lock to allow Rails 6. Install it using gem 'wice_grid', '~> 4.1', github: 'kreintjes/wice_grid', branch: 'fix/all'

@thisisbrians
Copy link

@kreintjes thank you, that at least has me up and running for now!

@Vinnie1991
Copy link

Is there an update for the Rails 6 support?

Or do we need to look for another gem?

@kreintjes
Copy link
Collaborator

kreintjes commented Dec 4, 2020

@Vinnie1991 I'm currently not actively working on this gem (too busy with other projects unfortunately). My fork/branch gem 'wice_grid', '~> 4.1', github: 'kreintjes/wice_grid', branch: 'fix/all' is currently successfully running in at least one Rails 6 production application (mine). However, this of course is not an ideal situation.

Maybe @afdev82, @thisisbrians and @andreydeineko can comment on their experiences using my fork in their Rails 6 applications.

I am willing to implement fixes for (severe) security vulnerabilities if needed, but I do not have the time to actively fix bugs or improve support for modern/coming Rails versions (6 or higher). Any PRs for that are welcome. However, first step remains getting the CI up and running again. Any help with that is welcome as well.

@patricklindsay
Copy link
Owner

Create a PR and providing it's been tested by a couple parties I'll merge and release a new version 👍

@afdev82
Copy link

afdev82 commented Dec 7, 2020

For me it's fine 👍

@imshenitsky
Copy link

Btw, Rails 6.1.0, can't modify frozen ActiveRecord::ConnectionAdapters::MySQL::Column

@celron
Copy link

celron commented Jan 27, 2021

With either Rails 6 or 6.1, I get FrozenError (can't modify frozen ActiveRecord::ConnectionAdapters::MySQL::Column: when initialize_grid is called. This is on Ubuntu 20.04 as well as Mac OS, though on Mac OS it seems to work on 6.0, and I will try to figure out what is causing it, though I'm not good at debugging Gems

@kreintjes
Copy link
Collaborator

kreintjes commented Jan 27, 2021

Hi @celron (and @imshenitsky), did you use my fork/branch when you got this error? That branch should work with Rails 6.0 (6.1 unsure). See #74 (comment) for more info and usage instructions.

Master of this repo doesn't support Rails 6+ yet.

KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 10, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 16, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 16, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 16, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 16, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
KishiKyousuke added a commit to pubannotation/pubdictionaries that referenced this issue Feb 16, 2021
- The official release of wice_grid for Rails 6.0 has not yet been released, and the following URL shows how to install a version that works fine with Rails 6.0
- patricklindsay/wice_grid#74
@g-gagnon
Copy link

@celron @imshenitsky I found out a fix to the Frozen issue, you might want to monkey patch it for now.
kickbooster@350b8e6

@celron
Copy link

celron commented Feb 24, 2021

Hello, I will try with the latest.
Doing some quick testing, I noticed the version of Ruby made a difference as to whether I received an error or not. Ruby 2.6.3 no error while Ruby 3.0 I get the error
This is with Rail 6.0

@celron
Copy link

celron commented Feb 25, 2021

Just a quick update, I tried with ruby 3.0 and both rails 6.0.3 and rails 6.1.3 and I don't get the FrozenError using the kickbooster branch

@celron
Copy link

celron commented Feb 25, 2021

I might have spoke too soon about 6.1, there seems to be some steps that have to be done to upgrade an app to rails 6.1 and it seeks to be causing problems. I'm getting problem with arguments to <%= grid now... will have to look into it

@g-gagnon
Copy link

Yea the Kickbooster branch is not meant to be used directly since we don't plan to offer external support, I just wanted to highlight a potential monkey patch approach that anyone could take to avoid the Frozen error. I can't guarantee things would be stable.

@bart3r
Copy link

bart3r commented Mar 16, 2021

Does anyone know an alternative gem that supports Rails 6, which is similar to Wice Grid?

@thisisbrians
Copy link

@bart3r I'm considering https://github.com/bogdan/datagrid for my latest project.

@bart3r
Copy link

bart3r commented Mar 16, 2021

@thisisbrians yes, I did see that one, but it's just not as nice as Wice.

A real shame that this gem isn't maintained any more :(

@imshenitsky
Copy link

@g-gagnon , thanks kickbooster@350b8e6 unexpectedly working on ruby 3.0, rails 6.1.3

@thisisbrians
Copy link

kickbooster/wice_grid@350b8e6 working for me as well on ruby 2.6.5p114, Rails 6.1.2.1

@afdev82
Copy link

afdev82 commented Jun 18, 2021

Could we have a PR open with https://github.com/kreintjes/wice_grid/tree/fix/all to let the Rails 6 support land in master?
I'm personally using for some months in production the https://github.com/kreintjes/wice_grid/tree/fix/all branch with Rails 6.0 and Ruby v2.7 without any issue.
But if others have issues with Ruby 3 or Rails 6.1, maybe it's worth also to cherry-pick the commit kickbooster@350b8e6 or to work on a better solution to fix that.
Thank you for your support!

@kreintjes
Copy link
Collaborator

I might have spoke too soon about 6.1, there seems to be some steps that have to be done to upgrade an app to rails 6.1 and it seeks to be causing problems. I'm getting problem with arguments to <%= grid now... will have to look into it

@celron I might have the same problem for some WiceGrid views after upgrading to Rails 6.1. Some views gave an ActionView::Template::Error: missing attribute: ... error on the grid(...) call. This occured when the relation passed to initialize_grid(...) contained a custom select call. It can be fixed by also selecting all attributes of the main model.

Example:
change
initialize_grid(Model.select('something_custom'))
to
initialize_grid(Model.select('model.*, something_custom'))

This wasn't needed in Rails 6.0, but it is after upgrading to Rails 6.1.

@kreintjes
Copy link
Collaborator

But if others have issues with Ruby 3 or Rails 6.1, maybe it's worth also to cherry-pick the commit kickbooster@350b8e6 or to work on a better solution to fix that. Thank you for your support!

A fix for the "can't modify frozen" error with Rails 6.1 (as reported by @celron and @imshenitsky) has been merged into my fix/all branch a while back thanks to @carlobeltrame: kreintjes#2.

So that branch should work with Rails 6.1 as well (without needing Kickboosters monkey-patch). It does for me with Ruby 2.7. Not sure about 3.0 or 3.1 though.

@afdev82
Copy link

afdev82 commented Mar 2, 2022

Yes, I'm using it also with Rails 6.1 (6.1.4.4) and ruby 3.0 (3.0.3) in production without issues (but I haven't switched the Rails defaults to 6.1, they are still the ones for Rails 6.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants