Git Product home page Git Product logo

Comments (19)

nneufeld avatar nneufeld commented on July 19, 2024 11

@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.

trcarden avatar trcarden commented on July 19, 2024 2

@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

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.

zzak avatar zzak commented on July 19, 2024 1

@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.

zzak avatar zzak commented on July 19, 2024 1

@estebanbouza @nneufeld Totally, sorry I just missed this comment.

Thanks for your patience!

from acts_as_paranoid.

zzak avatar zzak commented on July 19, 2024

@mibamur Could you submit a patch?

from acts_as_paranoid.

mibamur avatar mibamur commented on July 19, 2024

@zzak I have a few experience in it
not now, later

from acts_as_paranoid.

trcarden avatar trcarden commented on July 19, 2024

@zzak see: #55

from acts_as_paranoid.

mibamur avatar mibamur commented on July 19, 2024

@zzak #54

from acts_as_paranoid.

zzak avatar zzak commented on July 19, 2024

@mibamur LGTM, if it kills the warning and doesn't change backwards compatibility.

from acts_as_paranoid.

mibamur avatar mibamur commented on July 19, 2024

@zzak

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.

zzak avatar zzak commented on July 19, 2024

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.

trcarden avatar trcarden commented on July 19, 2024

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.

mibamur avatar mibamur commented on July 19, 2024

could someone answer
is if Rails::VERSION::STRING.to_f < 5 || RUBY_VERSION.to_f < 2 one of possible way?

from acts_as_paranoid.

BrianHawley avatar BrianHawley commented on July 19, 2024

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.

BatuhanW avatar BatuhanW commented on July 19, 2024

Anything new about updating ? It's annoying and been months. Really.

from acts_as_paranoid.

zzak avatar zzak commented on July 19, 2024

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.

estebanbouza avatar estebanbouza commented on July 19, 2024

@zzak Could you comment on @nneufeld 's statement before? Is the gem abandoned?

from acts_as_paranoid.

alphamarket avatar alphamarket commented on July 19, 2024

@zzak Why is this issue still open?? @nneufeld's solution will fix the problem, why not merge it?!

from acts_as_paranoid.

zzak avatar zzak commented on July 19, 2024

Merged #54

from acts_as_paranoid.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.