madebymany / sir-trevor-rails

Rails gem for Sir Trevor integration.
MIT License
149 stars 50 forks source link

Converting json to separate blocks #42

Closed firedev closed 9 years ago

firedev commented 9 years ago

Hi,

How one would go about adding ID to each block so they could be stored separately? As far as I've noticed, if you add id to JSON data it stays.

Theoretically speaking I could create new blocks if ID is missing and update the ones having ID... And then delete the ones that aren't referenced anymore.

Is this the way to go?

dwb commented 9 years ago

id will stick around; no schema is enforced anywhere so as long as you follow the basic conventions (essentially the data and type properties) you can put properties where you like. I'm not going to go as far as saying relying on this is supported though, as we may change things in the future, but I would have thought major upheaval is unlikely.

We don't store blocks separately: we don't have any use cases where we need to treat the data as anything other than a blob that should be delivered straight to the editor, but if you've got something more interesting going on I can't see why it would be a silly thing to do.

firedev commented 9 years ago

Thanks, I guess that is what I wanted to hear. Thinking aloud kind of thing.