Skip to content

Commit

Permalink
Merge pull request #559 from ChicagoWorldcon/stag-conclar-tweaks
Browse files Browse the repository at this point in the history
conclar tweaks
  • Loading branch information
balen authored Aug 4, 2022
2 parents f087e61 + 71c39bf commit 2b807cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
5 changes: 3 additions & 2 deletions app/models/published_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ def roles(role_ids)
has_many :participant_assignments,
-> {
joins("JOIN session_assignment_role_type as sart ON sart.id = published_session_assignments.session_assignment_role_type_id")
.where("published_session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Reserve')")
.order("sart.sort_order")
.joins("JOIN people on people.id = published_session_assignments.person_id")
.where("published_session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Reserve' OR session_assignment_role_type.name = 'Invisible')")
.order("sart.sort_order, people.published_name asc")
},
class_name: 'PublishedSessionAssignment'
has_many :participants, through: :participant_assignments, source: :person, class_name: 'Person'
Expand Down
5 changes: 3 additions & 2 deletions app/models/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,10 @@ def interests_for(person_id)
has_many :participant_assignments,
-> {
joins("JOIN session_assignment_role_type as sart ON sart.id = session_assignments.session_assignment_role_type_id")
.joins("JOIN people on people.id = session_assignments.person_id")
.where("session_assignments.session_assignment_role_type_id is not null AND session_assignments.state != 'rejected'")
.where("session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Reserve')")
.order("sart.sort_order")
.where("session_assignments.session_assignment_role_type_id not in (select id from session_assignment_role_type where session_assignment_role_type.name = 'Reserve' OR session_assignment_role_type.name = 'Invisible')")
.order("sart.sort_order, people.published_name asc")
},
class_name: 'SessionAssignment'
has_many :participants, through: :participant_assignments, source: :person, class_name: 'Person'
Expand Down
4 changes: 4 additions & 0 deletions app/serializers/conclar/session_serializer.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
class Conclar::SessionSerializer < ActiveModel::Serializer
attributes :title

attribute :format do
object.format.name if object.format
end

attribute :id do
if object.has_attribute?(:id)
object.id
Expand Down

0 comments on commit 2b807cb

Please sign in to comment.