lml/fine_print — pull request #2 by jpslav (2013-11-02 01:11:01+00:00)
Title: Moves fine_print away from providing application views; adds intentional publish; renames key models

The original ideas about FinePrint had a focus on providing views to application end users where they could agree to terms. This is a good goal, but due to the variability in how different sites and developers want those views to appear to their users, this PR changes FinePrint to eliminate those end-user-facing views. FinePrint retains views for administrators to manage agreements and user_agreements.

Because the end user views were removed, the controller methods were changed.

I also changed the names of the models from `agreement` and `user_agreement` to `contract` and `signature`. As explained in the README:

>As the meaning of 'agreement' can be somewhat ambiguous (meaning either the thing someone agrees to or the record of the agreement between that thing and the user) we have call a set of terms a 'contract' and a user's agreement to that contract a 'signature'.

Previously, once a contract was marked as ready it was available for users to sign. Instead of having non-ready contracts that already had a version number, this PR changes contracts to be intentionally published (or unpublished). A draft contract does not have a version. When it is published, it is assigned the next available version number and it is marked as the latest (by setting `is_latest` to `true`). When a contract is unpublished (when allowed), the version is deleted, and the most recent published contract is marked as the latest.

Some specs were added.

Note that I took the liberty of setting the version to 1.0.0.alpha. @Dantemss should remove the "alpha" before publishing the gem (and then probably reset the version to 1.0.1.alpha afterwards).

@Dantemss, a review of the code is probably not a bad idea.