wice_grid
wice_grid copied to clipboard
Support for Rails 6
Is it planned to support Rails 6?
When, if yes?
Thank you!
@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)
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'
@kreintjes thank you, that at least has me up and running for now!
Is there an update for the Rails 6 support?
Or do we need to look for another gem?
@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.
Create a PR and providing it's been tested by a couple parties I'll merge and release a new version 👍
For me it's fine :+1:
Btw, Rails 6.1.0, can't modify frozen ActiveRecord::ConnectionAdapters::MySQL::Column
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
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 https://github.com/patricklindsay/wice_grid/issues/74#issuecomment-738750635 for more info and usage instructions.
Master of this repo doesn't support Rails 6+ yet.
@celron @imshenitsky I found out a fix to the Frozen issue, you might want to monkey patch it for now. https://github.com/kickbooster/wice_grid/commit/350b8e6da0fcfd0cef3b07adc94ae08554f40e1d
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
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
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
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.
Does anyone know an alternative gem that supports Rails 6, which is similar to Wice Grid?
@bart3r I'm considering https://github.com/bogdan/datagrid for my latest project.
@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 :(
@g-gagnon , thanks https://github.com/kickbooster/wice_grid/commit/350b8e6da0fcfd0cef3b07adc94ae08554f40e1d unexpectedly working on ruby 3.0, rails 6.1.3
kickbooster@350b8e6 working for me as well on ruby 2.6.5p114, Rails 6.1.2.1
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 https://github.com/kickbooster/wice_grid/commit/350b8e6 or to work on a better solution to fix that. Thank you for your support!
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.
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: https://github.com/kreintjes/wice_grid/pull/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.
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).