zorab47 / active_admin-sortable_tree

Show ActiveAdmin index as a nested tree with drag'n'drop
MIT License
162 stars 127 forks source link

Rails 4.x compatibility #44

Closed ybart closed 8 years ago

ybart commented 9 years ago

Hi, I'm using ActiveAdmin 1.0 with Rails 4.1. I tried to replace the following in my Gemfile

gem "activeadmin-sortable-tree", github: "nebirhos/activeadmin-sortable-tree"

which was removed with this one using:

gem "activeadmin-sortable-tree", github: "zorab47/activeadmin-sortable-tree"

However I get the following error from Bundler when I run bundle update activeadmin-sortable-tree:

Could not find gem 'activeadmin-sortable-tree (>= 0) ruby' in
git://github.com/zorab47/activeadmin-sortable-tree.git (at master).
Source does not contain any versions of 'activeadmin-sortable-tree (>= 0) ruby'
ybart commented 9 years ago

Looks like I overlooked the gem changed name for active_admin-sortable_tree (with an extra underscore). So the following syntax is working :

gem "active_admin-sortable-tree", github: "zorab47/activeadmin-sortable-tree"
zorab47 commented 9 years ago

You can also reference the gem from Rubygems directly which include the change for Rails 4.x.

gem "active_admin-sortable_tree", "~> 0.2.0"
ybart commented 9 years ago

Great ! Thanks.

dmitry commented 9 years ago

I've stuck with the same issue. May be it's better to rename github repository name?

zorab47 commented 9 years ago

Perhaps adding another file to require with the name activeadmin/sortable_tree would be convenient. It would be a method of notifying those who can use Rubygems instead via a deprecation warning. The master branch is in a middle ground between being renamed and maintaining the existing URLs for those referencing the git project directly in their Gemfile.

It is possible to reference the file to require directly, but Rubygems is still be the preferred method.

gem "activeadmin-sortable-tree", github: "nebirhos/activeadmin-sortable-tree", require: "active_admin/sortable_tree"

Another downside to using the git repository without a version constraint is that issues like this can popup without warning, which is why I prefer the Rubygems approach.

Thanks for the input @dmitry. The update path can certainly be improved. :+1:

zorab47 commented 8 years ago

I'm closing this for now. If it continues to be confusing please reopen.