diff options
author | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-08 12:39:37 +0100 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2017-03-08 12:39:37 +0100 |
commit | e3bbd2be30d2cc16edf8a61df78b0dd953d0761a (patch) | |
tree | 9eaaf22993059609dcbcc3d5e17f8bad1c27deea | |
parent | 1b7263dbad4dd835757c9ddd7df0511acfc5e469 (diff) | |
download | ecs-e3bbd2be30d2cc16edf8a61df78b0dd953d0761a.tar.gz ecs-e3bbd2be30d2cc16edf8a61df78b0dd953d0761a.zip |
Change find(:all) to Arel syntax.
-rw-r--r-- | app/controllers/admin/communities_controller.rb | 4 | ||||
-rw-r--r-- | app/controllers/admin/organizations_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/admin/participants_controller.rb | 4 | ||||
-rw-r--r-- | app/helpers/application_helper.rb | 2 | ||||
-rw-r--r-- | app/models/participant.rb | 2 | ||||
-rw-r--r-- | app/views/admin/participants/_form.html.erb | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/app/controllers/admin/communities_controller.rb b/app/controllers/admin/communities_controller.rb index 7c02725..5d8d02e 100644 --- a/app/controllers/admin/communities_controller.rb +++ b/app/controllers/admin/communities_controller.rb @@ -31,7 +31,7 @@ class Admin::CommunitiesController < ApplicationController end def list - @communities=Community.find(:all).uniq + @communities=Community.all.uniq end def show @@ -80,7 +80,7 @@ class Admin::CommunitiesController < ApplicationController # lists all those participants which has not joined the community def index_nonparticipants index_participants - @participants=(Participant.find(:all) - @participants).sort{|x,y| x.id <=> y.id } + @participants=(Participant.all - @participants).sort{|x,y| x.id <=> y.id } end # community releases a participant diff --git a/app/controllers/admin/organizations_controller.rb b/app/controllers/admin/organizations_controller.rb index d16d07d..9b2c89b 100644 --- a/app/controllers/admin/organizations_controller.rb +++ b/app/controllers/admin/organizations_controller.rb @@ -31,7 +31,7 @@ class Admin::OrganizationsController < ApplicationController end def list - @organizations=Organization.find(:all).uniq + @organizations=Organization.all.uniq end def show diff --git a/app/controllers/admin/participants_controller.rb b/app/controllers/admin/participants_controller.rb index e6babf9..689b9d5 100644 --- a/app/controllers/admin/participants_controller.rb +++ b/app/controllers/admin/participants_controller.rb @@ -42,7 +42,7 @@ class Admin::ParticipantsController < ApplicationController when "true" @list_anonymous=true @list_participants_count = Participant.all.count - Participant.find(:all).uniq + Participant.all.uniq when "false" @list_anonymous=false @list_participants_count = Participant.all.count - @list_participants_anonymous_count @@ -127,7 +127,7 @@ class Admin::ParticipantsController < ApplicationController # lists all those communities which the participant has not yet joined def index_noncommunities index_communities - @communities=(Community.find(:all) - @communities).sort{|x,y| x.id <=> y.id } + @communities=(Community.all - @communities).sort{|x,y| x.id <=> y.id } end def destroy_community diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 7721625..c4c4ad8 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -21,7 +21,7 @@ module ApplicationHelper # return a collection of all communities with an empty one appended. def setup_community_collection - return Community.find(:all) << Community.new + return Community.all << Community.new end # returns the maximum line width of a text with "\r\n" lineendings. diff --git a/app/models/participant.rb b/app/models/participant.rb index 4fad70b..14b3bb6 100644 --- a/app/models/participant.rb +++ b/app/models/participant.rb @@ -57,7 +57,7 @@ class Participant < ActiveRecord::Base scope :only_anonymous, -> { where(:ptype => TYPE[:anonym]) } def self.reduced_attributes - find :all, :select => "participants.id, participants.name, participants.description, participants.email, participants.dns, participants.organization_id, participants.ptype" + all.select("participants.id, participants.name, participants.description, participants.email, participants.dns, participants.organization_id, participants.ptype") end def self.mainparticipants_with_reduced_attributes diff --git a/app/views/admin/participants/_form.html.erb b/app/views/admin/participants/_form.html.erb index 13e920d..7b79e9b 100644 --- a/app/views/admin/participants/_form.html.erb +++ b/app/views/admin/participants/_form.html.erb @@ -100,7 +100,7 @@ License along with ECS. If not, see <http://www.gnu.org/licenses/>. <th>join</th> </tr> - <% Community.find(:all).each do |community| %> + <% Community.all.each do |community| %> <tr valign="top" class="<%= cycle('list-line-odd', 'list-line-even') %>"> <!-- <tr align="left" valign="top"> --> <TD> |