Use AR relations to save fields/inputs and values

Instead of saving/destroying fields/inputs and values one at time
Use the Active Record relations to save these with a single save
call on the parent. This is done by adding the :autosave to the has_many
relations

It also includes the removal of to_i calls on the id fields. This will
help us when we switch to GIT and have strings as id's and the to_i
calls would fail
> To find, you can for example pass conditions with SQL fragments

Not (usefully) when you're only supplying a single argument. (If you think you see a way, please do let security@rubyonrails.org know.)

> Rails change over the time

Well since 4.0, `find` is much curtailed, and now *only* accepts IDs. I don't foresee that opening up again.

Anyway, this just caught my attention because if `SomeModel.find(params[:id])` is unsafe, then *a lot* of apps have an issue.

---

To venture back to the root topic, however: I would strongly discourage the use of the git commit sha as the PK. The AR Way is to use a surrogate key, and disregarding that seems to be courting future pain for minimal benefit.