From e0c5a3031d7de796134c72c44c38dc90c6221d2f Mon Sep 17 00:00:00 2001 From: Felix Pahlow Date: Tue, 15 Oct 2019 13:05:26 +0200 Subject: Fix sqlite3 ambiguous column name. This error only affected ECS running sqlite3 databases. --- app/models/community.rb | 2 +- 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| -- cgit v1.2.3