-
-
Notifications
You must be signed in to change notification settings - Fork 109
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
fix 4.0.0v ransack #132
fix 4.0.0v ransack #132
Conversation
lib/rails_db/table.rb
Outdated
@@ -60,6 +60,7 @@ def self.model_name | |||
klass = ActiveRecord::Base.descendants.detect { |c| c.table_name == table_name } | |||
end | |||
|
|||
ransack_methods(klass) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- please rename to add_ransack_methods
- add a dependency in gemspec file to include ransack >= 4, this way it will require all developers to upgrade (OR to not make it so strict just add a check in the code if Ransack::VERSION >= 4.0 and then call this method)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I like the if Ransack::VERSION >= 4.0
, but got strange error NameError (uninitialized constant Ransack::VERSION)
.
So, I can get version in way like this
ransack_gem = Gem.loaded_specs['ransack']
add_ransack_methods(klass) if ransack_gem.version >= Gem::Version.new('4.0.0')
. But not sure if it will be okay 👾👾👾
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is good solution, as long specs are passed this is good for me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@igorkasyanchuk fixed ( ˘▽˘)っ♨
@le-murier I think code is good enough to solve this issue, please check the comments |
@le-murier new version was released. thanks! |
It's looking a little bit ugly, but will allow all attributes and no association.
Pr for #131