Coder Social home page Coder Social logo

Comments (8)

kbrock avatar kbrock commented on June 28, 2024 1

Classification#before_save creates the Tag

from manageiq-schema.

Fryguy avatar Fryguy commented on June 28, 2024

@kbrock Thoughts?

from manageiq-schema.

miq-bot avatar miq-bot commented on June 28, 2024

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

from manageiq-schema.

kbrock avatar kbrock commented on June 28, 2024

@cben is this as simple as:

add_index :classifications, [:parent_id, :description, :id], :unique=>true

I just created that migration but am curious if you are suggesting something else. like dropping the uniqueness constraint - relying upon the tag or something else

from manageiq-schema.

cben avatar cben commented on June 28, 2024

Yeah that might be enough, as it's similar to existing validation only actually guaranteed.
Need to review creation order — is it always Classification-then-Tag? If a Tag is created first, and then the Classification fails uniqueness, should roll back the Tag. Or just wrap these in a transaction.
Or can postpone this until your quest to merge Classification & Tag, would become no-brainer then :-)

  • should also amend tag mapping to catch ActiveRecord::RecordNotUnique as well.
  • are there any other places where RecordNotUnique errors would break things?

from manageiq-schema.

JPrause avatar JPrause commented on June 28, 2024

@miq-bot remove_label stale

from manageiq-schema.

miq-bot avatar miq-bot commented on June 28, 2024

This issue has been automatically marked as stale because it has not been updated for at least 6 months.

If you can still reproduce this issue on the current release or on master, please reply with all of the information you have about it in order to keep the issue open.

Thank you for all your contributions!

from manageiq-schema.

Fryguy avatar Fryguy commented on June 28, 2024

Closing for now, as we can do batch saves a little better in other ways, and we should probably investigate other ways to make the tag mapping table more searchable (such as adding a type or vendor column)

from manageiq-schema.

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.