Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COSteve, thanks for the input! I like the idea you've had. Its sort of a hybrid of *my next try*, but maybe there is still a problem. What would you do in the case of a ***new*** record that hasn't been approved? My instinct would be to have a `new?` flag on the record that is `true` by default and set to `false` once the first change has been applied. To me the problem would be an added layer of complication. Now you'd have to keep up with that flag on the "admin" side and after a record has been approved for creation, there is a useless column in your model :/
      singulars
    2. COA new record that is not approved would not be approved and have `object.new_version.blank?` be true. Right? Although, you could write a helper for this. But the states are: unapproved&&no_new_version (new), approved, unapproved&&new_version, approved. These can be synthesized with the used of the data I proposed unless I'm missing something.
      singulars
    3. COI gotcha now. I think I had overlooked the `has_edits` flag when I originally went through your post, and just assumed we would know that a record is pending approval if has an associated `new_version`. I think I'm on board with your logic. Your statement "How you treat the objects once the admin approves it depends on whether you have other associations that depend on the id of the original model." worries me a little bit however, it seems like unless treated very carefully, you could mess up some associations.. I guess that's why you should treat them carefully :P
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload