summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/models/community.rb2
-rw-r--r--app/models/participant.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/community.rb b/app/models/community.rb
index 3137f09..27a34b2 100644
--- a/app/models/community.rb
+++ b/app/models/community.rb
@@ -17,7 +17,7 @@
class Community < ActiveRecord::Base
- has_many :memberships, -> { order 'id ASC' }
+ has_many :memberships, -> { order 'memberships.id ASC' }
has_many :participants, :through => :memberships
has_many :community_messages, :dependent => :destroy
has_many :messages, :through => :community_messages
diff --git a/app/models/participant.rb b/app/models/participant.rb
index 14b3bb6..205bd2c 100644
--- a/app/models/participant.rb
+++ b/app/models/participant.rb
@@ -42,7 +42,7 @@ class Participant < ActiveRecord::Base
accepts_nested_attributes_for :communities, :reject_if => proc { |attrs| attrs.all? { |k, v| v.blank? } }
accepts_nested_attributes_for :subparticipant, :allow_destroy => true
- scope :order_id_asc, -> { order("id ASC") }
+ scope :order_id_asc, -> { order("participants.id ASC") }
scope :without_anonymous, -> { where(:anonymous => false) }
scope :anonymous, -> { where(:anonymous => true) }
scope :for_message, lambda { |message|