Coder Social home page Coder Social logo

Comments (3)

evanshabsove avatar evanshabsove commented on May 23, 2024 1

Sorry for my super late reply, I've had some time to be able to look back into this for our application.

I think at the time I didn't fully understand the problem I was facing. Looking at this again I need to be able to saved unknown attributes, which is already an issue on this project. I'm going to close this issue, thanks again for your response!

from store_model.

evanshabsove avatar evanshabsove commented on May 23, 2024

Hmmm on taking a second look I'm not sure my initial diagnosis was the cause of the problem...trying to figure it out now.

from store_model.

DmitryTsepelev avatar DmitryTsepelev commented on May 23, 2024

Hi @evanshabsove, thanks for reaching out!

If I understand the problem correctly, you want to store one or more customization (of many more) in the same JSON column. You've mentioned, that you don't want to create a class for each possible customization, but would inline syntax solve your problem? (it's easy to add):

class Configuration
  include StoreModel::Model

  attribute :supplier do
    attribute :title, :string
  end
end

instead of

class Supplier
  include StoreModel::Model

  attribute :title, :string
end

class Configuration
  include StoreModel::Model

  attribute :supplier, Supplier.to_type
end

As for the part about raised error, I guess the reason is different from empty attributes (because you don't have any validations), maybe it's caused by the method_missing trick. I'd be happy to assist if you share more details or reproduction example.

from store_model.

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.