Giter VIP home page Giter VIP logo

Comments (11)

pat avatar pat commented on June 2, 2024

Hmm, hadn't thought of that approach. You're right that it definitely doesn't work with the current code... I'm not quite sure how to restructure things so it does, but I'm certainly open to that. Pull requests are welcome, but I'll leave this issue open so that if I have the time and a touch of inspiration I'll have a go.

from gutentag.

pat avatar pat commented on June 2, 2024

This change is now published in 0.3.0. Thanks for logging the issue :)

from gutentag.

kenips avatar kenips commented on June 2, 2024

Thank you very much! Interesting take actually - I thought you'd just be setting the taggable_id on create!

from gutentag.

kenips avatar kenips commented on June 2, 2024

So @pat with

attr_writer :tag_names
I guess tag_names= is a class method?

from gutentag.

pat avatar pat commented on June 2, 2024

Nope, that's getting evaluated within the class context (attar_writer is a class method) but it's creating the instance method tag_names=. Are you finding that's not the case?

from gutentag.

kenips avatar kenips commented on June 2, 2024

Right, of course! No I was just trying to override tag_names= in my class (after calling has_many_tags. I guess in this case I need to alias not super. Just wasn't thinking straight.

from gutentag.

pat avatar pat commented on June 2, 2024

Ah right - yup, because the method doesn't exist in any ancestor of the model, there's no super definition. Aliasing is definitely the way to go (which is a shame, super is far nicer).

from gutentag.

pat avatar pat commented on June 2, 2024

... and now I'm thinking about ways to change the code so method inheritance is possible. Hmm.

from gutentag.

kenips avatar kenips commented on June 2, 2024

Haha :). Yep especially when you peek into ancestors and the modules are there. Would be interested to know your process in converting it so!

from gutentag.

pat avatar pat commented on June 2, 2024

In the end it was pretty easy - see f20b762.

from gutentag.

kenips avatar kenips commented on June 2, 2024

ha! yes. thanks for everything.

from gutentag.

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.