Skip to content

Instantly share code, notes, and snippets.

View brentd's full-sized avatar

Brent Dillingham brentd

  • Asheville, NC
View GitHub Profile
diff --git a/lib/searchlogic/named_scopes/conditions.rb b/lib/searchlogic/named_scopes/conditions.rb
index 31d0643..c0c1d8e 100644
--- a/lib/searchlogic/named_scopes/conditions.rb
+++ b/lib/searchlogic/named_scopes/conditions.rb
@@ -30,7 +30,9 @@ module Searchlogic
BOOLEAN_CONDITIONS = {
:null => [:nil],
:not_null => [:not_nil],
- :empty => []
+ :empty => [],
-for model in MODEL_TYPES
-if can_view?(model)
%h2= model.pluralize
=render :partial => "#{model.tableize}/list"
-if has_permission?("people")
%h2 People
=render :partial => 'people/list'
-if has_permission?("organizations")
%h2 Organizations
=render :partial => 'organizations/list'
-if has_permission?("projects")
%h2 Projects
-if has_permission?("people")
%h2 People
=render :partial => 'people/list'
-if has_permission?("organizations")
%h2 Organizations
=render :partial => 'organizations/list'
-if has_permission?("projects")
%h2 Projects
# See ActionController::RequestForgeryProtection for details
# Uncomment the :secret if you're not using the cookie session store
protect_from_forgery # :secret => '76442f0e40a981d5e2b791b320bd8e94'
def must_be_admin
redirect_to '/' unless self.current_user.in_role?("admin")
flash[:notice_error] = "Access Denied..." unless self.current_user.in_role?("admin")
end