Skip to content

Commit

Permalink
This syntax makes more sense for excluding restricted settings from r…
Browse files Browse the repository at this point in the history
…egular users.
  • Loading branch information
stevenheidel authored and parndt committed Jun 28, 2010
1 parent 4682148 commit ff6d185
Showing 1 changed file with 3 additions and 3 deletions.
@@ -1,7 +1,7 @@
class Admin::RefinerySettingsController < Admin::BaseController

crudify :refinery_setting, :title_attribute => :title, :order => "name ASC", :searchable => false
#:conditions => current_user.superuser? ? '' : 'restricted IS false'
#:conditions => current_user.superuser? ? nil : {:restricted => false}

def edit
@refinery_setting = RefinerySetting.find(params[:id])
Expand All @@ -12,13 +12,13 @@ def edit
def find_all_refinery_settings
@refinery_settings = RefinerySetting.find :all,
:order => "name ASC",
:conditions => current_user.superuser? ? "" : "restricted IS false"
:conditions => current_user.superuser? ? nil : {:restricted => false}
end

def paginate_all_refinery_settings
@refinery_settings = RefinerySetting.paginate :page => params[:page],
:order => "name ASC",
:conditions => current_user.superuser? ? "" : "restricted IS false"
:conditions => current_user.superuser? ? nil : {:restricted => false}
end

end

0 comments on commit ff6d185

Please sign in to comment.