Bug #4682
closedcreate a new smart variable for a puppet class doesn't save the relation in the database.
Description
steps to reproduce:
1. goto edit puppetclass -> smart variables tab.
2. add a new variable and submit the form.
3. the new smart variable is saved but is not attached to any puppet class.
Updated by Stephen Benjamin almost 11 years ago
Works for me against develop. Added two smart variables to the apache puppetclass and the association shows up (and the host gets the global parameter):
1.8.7 :005 > LookupKey.where(:puppetclass_id => Puppetclass.find_by_name("apache")).select("key, puppetclass_id") +-----+----------------+ | key | puppetclass_id | +-----+----------------+ | baz | 60 | | foo | 60 | +-----+----------------+
Updated by Dominic Cleal almost 11 years ago
- Category set to Parameters
- Status changed from New to Ready For Testing
- Assignee set to Stephen Benjamin
- Target version set to 1.9.0
- Translation missing: en.field_release set to 4
Updated by Stephen Benjamin almost 11 years ago
In the end, I was able to reproduce the problem. The Puppetclass view uses "puppetclass.lookup_keys.empty?" and I had a poorly named counter in EnvironmentClasses that was 0 (no other params for the class).
Something to keep in mind if something weird happens like this... rails magic makes .empty? and .size look to the counter cache if it exists.
Updated by Anonymous almost 11 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset df471c78ec92ab321e18e00d232121cddf746337.