
Renamed requestor_user_id -> user_id Index of request_for_comments now returns the n (5?) newest requests per user. Solved via sliding windows in postgres, code added to model. Added route to /my_request_for_comments/ that shows all requests for the current user. Changed view from ERB to slim
9 lines
319 B
Ruby
9 lines
319 B
Ruby
class Comment < ActiveRecord::Base
|
|
# inherit the creation module: encapsulates that this is a polymorphic user, offers some aliases and makes sure that all necessary attributes are set.
|
|
include Creation
|
|
attr_accessor :username
|
|
|
|
belongs_to :file, class: CodeOcean::File
|
|
belongs_to :user, polymorphic: true
|
|
end
|