Coder Social home page Coder Social logo

Identity metadata about layer-ruby HOT 7 CLOSED

beamercola avatar beamercola commented on July 30, 2024
Identity metadata

from layer-ruby.

Comments (7)

benedikt avatar benedikt commented on July 30, 2024

Hi @beamercola!

Thanks so much for getting in touch. It is possible to update metadata on identity objects. I'm not quite sure why it doesn't work for you, though. Can you please share the code snippet you use to update the metadata?

Cheers,

Benedikt

from layer-ruby.

beamercola avatar beamercola commented on July 30, 2024

Great thanks!

So by default identity.metadata returns nil
so setting identity.metadata = {a: "b"}; identity.save

It sounds like it's writing the whole metadata object and not patching existing?

Thanks again, lemme know if there's anything else I can provide

from layer-ruby.

beamercola avatar beamercola commented on July 30, 2024

Keep messing with it and can't seem to find anything that works

from layer-ruby.

benedikt avatar benedikt commented on July 30, 2024

@beamercola You're right. It's a bug. I'll see what I can do to fix it.

from layer-ruby.

benedikt avatar benedikt commented on July 30, 2024

Hi @beamercola,

I just pushed a potential fix to the identity-metadata branch. Can you please check if it fixes your issue?

Use this line in your Gemfile to use the version from the branch:

gem 'layer-ruby', github: 'benedikt/layer-ruby', branch: 'identity-metadata'

Afterwards, these operations should work as expected:

identity.metadata = { foo: 'bar' }
identity.metadata['bar'] = 'baz'

Replacing the whole object will not work, though. I changed the #metadata= setter to simply set all key value pairs on the existing metadata object.

Please let me know if this fixes your issues.

from layer-ruby.

beamercola avatar beamercola commented on July 30, 2024

Works great! You're the most attentive developer out there - keep up the awesome work.

Thank you.

from layer-ruby.

benedikt avatar benedikt commented on July 30, 2024

Thank you, @beamercola 😄

I just released this fix as v0.7.2 on RubyGems. So you can now switch back to loading the gem from there.

from layer-ruby.

Related Issues (17)

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.