From 1e53255088385fcfe49747202227d30a76e08c89 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 19 Jan 2012 21:10:27 +0000 Subject: Fixed bug in roles where last matching controller used, rather than first --- lib/roles.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/roles.lua') diff --git a/lib/roles.lua b/lib/roles.lua index 7c69724..8cc5332 100644 --- a/lib/roles.lua +++ b/lib/roles.lua @@ -52,7 +52,9 @@ get_controllers = function(self,pre,controller) filename = string.match(v,"[^/]*.lua") name = string.match(filename,"[^.]*") sname = string.match(filename,"[^-]*") - temp[prefix..sname] = {path=path,prefix=prefix,filename=filename,name=name,sname=sname} + if not temp[prefix..sname] then -- only keep the first of each + temp[prefix..sname] = {path=path,prefix=prefix,filename=filename,name=name,sname=sname} + end end if pre and controller then return temp[pre..controller] -- cgit v1.2.3