crowbar/barclamp-crowbar — pull request #680 by cloudedge (2013-09-04 04:30:33+00:00)
Title: Add barclamp::role override for roles without specific class overrides (with TESTS) [1/2]

This change supports barclamps (like Network) that need to add roles dynamically but still
need to override the default Crowbar Role behavior.

When a Role is created, Crowbar will look for a matching BarclampName::RoleName class. If this
specific override is not found, then Crowbar will look for BarclampName::Role class. If that
general override is not found, Crowbar will use its own Role model.

Overrides are needed to allow event customization.

This pull request includes BOTH tests specific to this behavior AND documentation of the behavior.

Yes, we are raising the bar. You will comply.

BDD/crowbar.erl | 7 +++++--
BDD/features/role.feature | 20 ++++++++++++++++++++
crowbar_framework/app/models/role.rb | 18 +++++++++++-------
crowbar_framework/app/views/roles/show.html.haml | 3 +++
crowbar_framework/config/locales/crowbar/en.yml | 1 +
doc/devguide/api/role.md | 12 ++++++++++++
6 files changed, 52 insertions(+), 9 deletions(-)

Crowbar-Pull-ID: 01b3ea25901a0e494377a180af1bb08f0f02caef

Crowbar-Release: development