diff options
author | Felix Pahlow <felix.pahlow@itz.uni-halle.de> | 2019-10-15 13:05:26 +0200 |
---|---|---|
committer | Heiko Bernloehr <Heiko.Bernloehr@FreeIT.de> | 2019-10-16 02:44:51 +0200 |
commit | e0c5a3031d7de796134c72c44c38dc90c6221d2f (patch) | |
tree | 01df94f96f12e4fff81dfd0dd5882b8aa4fe0543 | |
parent | da6075d23bfff09429c5e28e499a26956cb8ea88 (diff) | |
download | ecs-e0c5a3031d7de796134c72c44c38dc90c6221d2f.tar.gz ecs-e0c5a3031d7de796134c72c44c38dc90c6221d2f.zip |
Fix sqlite3 ambiguous column name.
This error only affected ECS running sqlite3 databases.
-rw-r--r-- | app/models/community.rb | 2 | ||||
-rw-r--r-- | app/models/participant.rb | 2 |
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| |