Merge ff16668941 into 137d997793
This commit is contained in:
commit
9f28fc800f
8 changed files with 8 additions and 8 deletions
|
|
@ -11,7 +11,7 @@ module Admin
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
@registrations = @conference.registrations.joins(:qanswers).uniq
|
@registrations = @conference.registrations.joins(:qanswers).distinct
|
||||||
end
|
end
|
||||||
|
|
||||||
def new
|
def new
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ module Admin
|
||||||
if current_user.has_role? :organization_admin, :any
|
if current_user.has_role? :organization_admin, :any
|
||||||
@conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten
|
@conferences_with_role = Organization.with_role('organization_admin', current_user).map { |org| org.conferences.pluck :short_title }.flatten
|
||||||
end
|
end
|
||||||
@conferences_with_role.uniq!
|
@conferences_with_role.distinct!
|
||||||
|
|
||||||
return if @conference.blank?
|
return if @conference.blank?
|
||||||
@versions = PaperTrail::Version.where(conference_id: @conference.id).accessible_by(current_ability)
|
@versions = PaperTrail::Version.where(conference_id: @conference.id).accessible_by(current_ability)
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ module Admin
|
||||||
def show
|
def show
|
||||||
if can_manage_volunteers?(@conference)
|
if can_manage_volunteers?(@conference)
|
||||||
@volunteers = if @conference.use_vpositions
|
@volunteers = if @conference.use_vpositions
|
||||||
@conference.registrations.joins(:vchoices).uniq
|
@conference.registrations.joins(:vchoices).distinct
|
||||||
else
|
else
|
||||||
@conference.registrations.where(volunteer: true)
|
@conference.registrations.where(volunteer: true)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@ module Api
|
||||||
users = User.joins(:event_users)
|
users = User.joins(:event_users)
|
||||||
end
|
end
|
||||||
|
|
||||||
users = users.where(event_users: {event_role: :speaker}).uniq
|
users = users.where(event_users: {event_role: :speaker}).distinct
|
||||||
render json: users, each_serializer: SpeakerSerializer, callback: params['callback']
|
render json: users, each_serializer: SpeakerSerializer, callback: params['callback']
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ class BoothsController < ApplicationController
|
||||||
skip_authorize_resource only: [:withdraw, :confirm, :restart]
|
skip_authorize_resource only: [:withdraw, :confirm, :restart]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@booths = current_user.booths.where(conference_id: @conference.id).uniq
|
@booths = current_user.booths.where(conference_id: @conference.id).distinct
|
||||||
end
|
end
|
||||||
|
|
||||||
def show; end
|
def show; end
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ module UsersHelper
|
||||||
providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank?
|
providers << provider if !ENV["OSEM_#{provider.upcase}_KEY"].blank? && !ENV["OSEM_#{provider.upcase}_SECRET"].blank?
|
||||||
end
|
end
|
||||||
|
|
||||||
providers.uniq
|
providers.distinct
|
||||||
end
|
end
|
||||||
|
|
||||||
# Receives a hash, generated from User model, function get_roles
|
# Receives a hash, generated from User model, function get_roles
|
||||||
|
|
|
||||||
|
|
@ -231,7 +231,7 @@ class Program < ApplicationRecord
|
||||||
languages.match(/^$|(\A[a-z][a-z](,[a-z][a-z])*\z)/).present?
|
languages.match(/^$|(\A[a-z][a-z](,[a-z][a-z])*\z)/).present?
|
||||||
languages_array = languages.split(',')
|
languages_array = languages.split(',')
|
||||||
# We check that languages are not repeated
|
# We check that languages are not repeated
|
||||||
errors.add(:languages, "can't be repeated") && return unless languages_array.uniq!.nil?
|
errors.add(:languages, "can't be repeated") && return unless languages_array.distinct!.nil?
|
||||||
# We check if every language is a valid ISO 639-1 language
|
# We check if every language is a valid ISO 639-1 language
|
||||||
errors.add(:languages, 'must be ISO 639-1 valid codes') unless languages_array.select{ |x| ISO_639.find(x).nil? }.empty?
|
errors.add(:languages, 'must be ISO 639-1 valid codes') unless languages_array.select{ |x| ISO_639.find(x).nil? }.empty?
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,5 @@
|
||||||
%license/
|
%license/
|
||||||
%optout=false #FIXME
|
%optout=false #FIXME
|
||||||
%persons
|
%persons
|
||||||
- event.speakers.uniq.each do |speaker|
|
- event.speakers.distinct.each do |speaker|
|
||||||
%person{ id: speaker.id }= speaker.name
|
%person{ id: speaker.id }= speaker.name
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue