avoid breaking mysql migration from an empty db
fixes the more menu bug
fixes #1726 ie support for edit template (with a simple text-box).
fixes #1165 add inherited params display and override option to the host form.

Signed-off-by: Ohad Levy <ohadlevy@gmail.com>
fixes more menu issues
fixes parameters whitespace validations
1.0RC3 released
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.