eregs / regulations-core

An engine that supplies the API that allows users to read regulations and their various layers.
Creative Commons Zero v1.0 Universal
17 stars 27 forks source link

[WIP] Combine regulation and preamble node models. #48

Closed jmcarp closed 8 years ago

jmcarp commented 8 years ago

Preparation for https://github.com/eregs/notice-and-comment/issues/118. This is incomplete, and tests are going to fail--I'm hoping to get a quick 👍 / 👎 on approach from @cmc333333 before finishing the details.

TODO:

cmc333333 commented 8 years ago

Makes sense to me. A few more things to consider:

  1. Renaming everything from "regulation" to "document"
  2. Probably makes sense to add the doc_type to the indexes/uniqueness constraints
  3. We'll want to update the search and regulation listing views to use use the appropriate doc_type filter
cmc333333 commented 8 years ago

Oh, one more heads up: I think that at some point in the near future, the preamble won't have a separate endpoint for creation/retrieval; it'll be part of the notice end points. Behind the scenes, we'll still create the nested models and all that jazz, the end user interface might just be a tad different.

cmc333333 commented 8 years ago

You'll need to replace the function in your migration; not a huge deal to import from a different path. This is the reason it's not good to call external code in migrations, however.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-2.8%) to 85.046% when pulling a30562c55a55ec3f1c6c60f025420a901ca7f23c on jmcarp:consolidate-models into 5f64e1c74909a71274374a316cc9da9446c17892 on eregs:master.

cmc333333 commented 8 years ago

Quick note that the coverage drop is okay -- it's almost exclusively due to additional code in a migration.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-2.8%) to 85.046% when pulling abf763e6959abdd3e34fcb0bec1b544cf3f4893d on jmcarp:consolidate-models into 5f64e1c74909a71274374a316cc9da9446c17892 on eregs:master.

cmc333333 commented 8 years ago

Love the direction. Ping @tadhg-ohiggins @porta-antiporta - this will make it pretty easy to add (and search) other types of documents, such as US Code, AOs, etc. so long as they can be described in the Node structure, which is very generic.

coveralls commented 8 years ago

Coverage Status

Coverage decreased (-2.8%) to 85.024% when pulling 0057c75c1b21c1d069fcb3aee37fa1ca3e9e6282 on jmcarp:consolidate-models into 5f64e1c74909a71274374a316cc9da9446c17892 on eregs:master.

cmc333333 commented 8 years ago

Flantastic!