Skip to content

Commit ff0c13c

Browse files
committed
properly order new announcements. fixes CNVS-3242
maintain a separate position scope for announcements than discussions so that new announcements receive proper position value. test plan: * create multiple announcements in a course, verifying that the newest announcements appear at the top of the announcement index page. Change-Id: Ie05d6399b670326e02a0634598e924f89e92eeea Reviewed-on: https://gerrit.instructure.com/21761 Reviewed-by: Mark Ericksen <marke@instructure.com> Tested-by: Jenkins <jenkins@instructure.com> QA-Review: Cam Theriault <cam@instructure.com> Product-Review: Zach Pendleton <zachp@instructure.com>
1 parent 011cd66 commit ff0c13c

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

app/models/announcement.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ class Announcement < DiscussionTopic
3030
validates_presence_of :context_id
3131
validates_presence_of :context_type
3232
validates_presence_of :message
33-
33+
34+
acts_as_list scope: %q{context_id = '#{context_id}' AND
35+
context_type = '#{context_type}' AND
36+
type = 'Announcement'}
37+
3438
def infer_content
3539
self.title ||= t(:no_title, "No Title")
3640
end

0 commit comments

Comments
 (0)