Fixed tiny typo in the hostgroup unit test
Import puppetclasses and parameters into db

Parameters are mapped to automatically created smart-variables
Fixes and _parameter helpers in LookupKey

Simplify .select([fields]) with .all.
Fix a small error with new parameters in new classes
Fix a small error using value instead of default_value

Use _parameter helpers in LookupKey,
permits to separate the puppetclass from the parameter
and be agnostic to the actual key formatting ("class/param")

Allow lookup_keys.puppetclass_id to be NULL,
to allow disassociation of obsolete smart-varaibles.
Simplify failing is/to_parameter

The import broke by making is_parameter? return true only
for one of the environment the puppetclass appears in.

Moreover, a detached parameter smart-variable is still a parameter,
hence we must succeed even when puppetclass is nil.
(And it reduced the number of DB queries.)
Fix / in smart-variable param representation

The slash in the to_param representation was misleading ActionPack
to believe into an additional REST nesting level.

Three possible fixes to that problem:
1) Patch ActionPack to url escape, if appropriate
2) Replace the slash by a neutral character
3) Escape the slash, into %2F.
   Actually escape twice, into %252F...

I chose the second solution, using a backslash.
Improved smart-variable index

Added paging controller.
Add old puppetclass name for parameter smart-variables,
by taking the first part of its name, with red coloration.
Added different coloring for parameters, as opposed to variables.
Create proper is_param column, stop the prefix madness.

Enforce varying scope key uniqueness.
No uniqueness enforcement for unbound smart-vars.
Permit easy creation of smart-variables

No longer restrict smart-var new and create.
Adapt smart-vars form to its possible contexts:
- from the /lookup_keys controller:
  There is no context, hence puppetclass is freely modifiable.
- from the /puppetclass/edit|new controller:
  Smart-vars are in a dedicated tab, hence there is no need to
  display the current puppetclass, and would be forbidden to change it.
- from the /puppetclass/id/lookup_keys/edit controller:
  We need to display the parent puppetclass,
  but we forbid to change it, not to change the context.
New ENC format, with puppetclass parameters

Offer a setting to control which format to use.
Output either with the puppet 0.23.0 through 2.6.4 format (like before),
or with the puppet 2.6.5+ format (with class parameters).
Permit help_inline for checkboxes

The :help_inline option was appended as raw text after the checkboxes.
I created :help_text for this usage instead,
and let :help_inline work as intended, inside the <label>,
so that it stays inline.
Make default value nullable in LookupKeys

Added javascript helpers.
Make smart-variables mandatory or optional

Raise an error when a mandatory parameter is missing,
for the ENC YAML output.
Remove vistigal function
Typed smart-variables
Importing puppetclass detects smart-var type
Default value display fixes
Fix smart-var matcher value display and validation
Fix validation occuring on child marked for destruction

Edit a smart-variable, change its type to one incompatible
with the matcher's value.
Delete the matcher.

The deleted matcher validation fails.
It shouldn't be called in the first place.
This is likely a rails bug, see:
  https://github.com/rails/rails/pull/3854
Fix parameter find and is_mandatory value

A shameful error slipped in the usage of find_by_key.
Forgot to set is_mandatory when default value is nil on importing.
Make foreman replace ${::facts} for puppet

The inclusion of ${ and } in a string make Puppet perform substitutions.
When importing, the smart-proxy must not perform such substitution,
it therefore should be done upon exporting the YAML ENC output.
Unfortunately, Puppet does not perform it upon reception of the YAML
document, hence we have to do it inside Foreman.