I have a model called Page. The users are able to specify attributes whenever they create a Page. Ideally, they will choose from a list of attributes and assign them to the Page.
My first though was to create as many columns as attributes the user is able to select, and basically marking them as true/false if it has been selected.
However, I have a feeling that I might be missing a better approach. I have also used at HSTORE, but at the end of the day, I would also need to do something like:
attributes: { 'attribute1' => 'true', 'attribute2' => 'false' } and I am not sure if that is appropriate.
I will use those attributes in order to select pages, so I should be able to say something like:
Page.where(attribute1 is true).where(attribute2 is false).where(...)
How should I store those attributes in my Page model?