Skip to content

Commit a2b0ce3

Browse files
author
jamesprior
committed
Updating finders for rails 4
1 parent da6bacf commit a2b0ce3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/cms/acts/cms_user.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,11 @@ def cms_access?
100100
# Return a list of the sections associated with this user that can be viewed.
101101
# Overridden from user so that able_to_view? will work correctly.
102102
def viewable_sections
103-
@viewable_sections ||= Cms::Section.find(:all, :include => :groups, :conditions => ["#{Cms::Group.table_name}.id in (?)", cms_groups.collect(&:id)])
103+
@viewable_sections ||= Cms::Section.includes(:groups).where(["#{Cms::Group.table_name}.id in (?)", cms_groups.collect(&:id)])
104104
end
105105

106106
def permissions
107-
@permissions ||= Cms::Permission.find(:all, :include => :groups, :conditions => ["#{Cms::Group.table_name}.id in (?)", cms_groups.collect(&:id)])
107+
@permissions ||= Cms::Permission.includes(:groups).where(["#{Cms::Group.table_name}.id in (?)", cms_groups.collect(&:id)])
108108
end
109109

110110
def able_to_edit?(section)

0 commit comments

Comments
 (0)