Comments (19)
@zzak Is there any reason #54 can't be merged? Because it doesn't use prepend
, it doesn't break compatibility, but it does get rid of the deprecation warning.
from acts_as_paranoid.
@zzak: Do you want me to move the gem's version to 1.0.0 in my patch set then and kill the old dependencies?
I think it makes sense to kill some of the older versions since Ruby 1.9 and 2.0 are now end of life
- https://www.ruby-lang.org/en/news/2016/02/24/support-plan-of-ruby-2-0-0-and-2-1/
- https://www.ruby-lang.org/en/news/2014/01/10/ruby-1-9-3-will-end-on-2015/
Also going along with #54 if you take a look at what alias_method_chain did under the covers (see here) that is just copy-pasting in the same deprecated functionality. If you are going to do that you might as well just copy and paste alias_method_chain
in a lib directory and remove the deprecation notice so that you get all the benefits of the original method call (they differ slightly from just two alias_method calls)
Finally here are some reasons to use the new prepend:
http://www.justinweiss.com/articles/rails-5-module-number-prepend-and-the-end-of-alias-method-chain/
from acts_as_paranoid.
@trcarden This patch is great if we want to drop backwards compatibility with older Ruby versions -- but at the moment I'd like to keep it for now.
Maybe we could submit that patch and start thinking about 1.0.0 w/ only modern versions of Ruby/Rails supported?
from acts_as_paranoid.
@estebanbouza @nneufeld Totally, sorry I just missed this comment.
Thanks for your patience!
from acts_as_paranoid.
@mibamur Could you submit a patch?
from acts_as_paranoid.
@zzak I have a few experience in it
not now, later
from acts_as_paranoid.
from acts_as_paranoid.
from acts_as_paranoid.
@mibamur LGTM, if it kills the warning and doesn't change backwards compatibility.
from acts_as_paranoid.
could we change #54 like this for backwards compatibility?
if Rails::VERSION::STRING.to_f < 5 || RUBY_VERSION.to_f < 2
alias_method_chain :belongs_to, :deleted
else
alias_method :belongs_to_without_deleted, :belongs_to
alias_method :belongs_to, :belongs_to_with_deleted
end
from acts_as_paranoid.
It's trivial to maintain compatibility (one case statement), so I'd rather not drop support or bump major version at this time.
from acts_as_paranoid.
That's too bad. I don't think supporting ruby versions that are dead is worth it. Also this is a mature gem so bumping a major version isn't going to leave anyone out of new features. That said I am not going to maintain it so maybe it will make your life easier. I will keep my fork up there if people wanted to eventually make this gem use more modern techniques
from acts_as_paranoid.
could someone answer
is if Rails::VERSION::STRING.to_f < 5 || RUBY_VERSION.to_f < 2
one of possible way?
from acts_as_paranoid.
https://bugs.ruby-lang.org/issues/10847 is a problem with stack overflows with prepend
. It was fixed in Ruby 2.1.6 and 2.2.2, but not in any prior Ruby versions. You should check the earliest version of Ruby supported for use with the earliest version of Rails that you support, and write the code that works with that. Unless you can be sure that your code isn't affected, of course.
from acts_as_paranoid.
Anything new about updating ? It's annoying and been months. Really.
from acts_as_paranoid.
For the record, this is just a WARNING
there is no need to take immediate action unless there is an actual bug.
As for getting this fixed, I already commented how I'd like to resolve this, anyone is free to submit a patch!
from acts_as_paranoid.
@zzak Could you comment on @nneufeld 's statement before? Is the gem abandoned?
from acts_as_paranoid.
@zzak Why is this issue still open?? @nneufeld's solution will fix the problem, why not merge it?!
from acts_as_paranoid.
Merged #54
from acts_as_paranoid.
Related Issues (20)
- Emulate difference between `destroy` and `destroy!` in default ActiveRecord HOT 4
- Avoid loading associated object for counter cache updates
- Behavior of destroy on associations does not match default ActiveRecord
- Setting `:double_tap_destroys_fully` should apply to methods on relations as well HOT 1
- Remove deprecated methods for the 0.8.0 release
- Association building broken with upgrade to 0.7.0 HOT 4
- FeatureRequest: Global default options configuration
- Calling delete then recover on the same object doesn't recover has_many/dependent relationships HOT 2
- Honor foreign key constraint violation HOT 2
- Release with Rails 7 support HOT 3
- Question: Skip recover functionality HOT 6
- Recover when junction table record exists rather than creating a new one
- recover! method raises validation error even if record is valid. Using recover works properly
- Possible conflict between acts_as_paranoid and newrelic_rpm
- with_deleted unscopes everything when joining through multiple associations HOT 3
- `only_deleted` doesn't work sometimes(?)
- How can I destroy models without destroying their ActiveStorage associations? HOT 4
- Why can not use like this User.first.update!(deleted_at: Time.now) HOT 1
- Add `with_deleted: true` for has_many relationships HOT 1
- The documentation for `column_type: 'boolean'`, allow_nulls option is incorrect
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from acts_as_paranoid.