Fix basic style issues with rubocop
This commit is contained in:
parent
f4a22851a1
commit
763f864dc9
36 changed files with 108 additions and 143 deletions
|
|
@ -102,7 +102,6 @@ class Conference < ActiveRecord::Base
|
|||
return media_types
|
||||
end
|
||||
|
||||
|
||||
##
|
||||
# Checks if the user is registered to the conference
|
||||
#
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ class Datatable
|
|||
}
|
||||
end
|
||||
|
||||
|
||||
def data
|
||||
[]
|
||||
end
|
||||
|
|
|
|||
|
|
@ -3,5 +3,4 @@ class DietaryChoice < ActiveRecord::Base
|
|||
|
||||
belongs_to :conference
|
||||
has_many :registrations
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -197,11 +197,15 @@ class Event < ActiveRecord::Base
|
|||
errors.add(:user_biography, 'must be filled out') if submitter.biography_word_count == 0
|
||||
end
|
||||
|
||||
# TODO: create a module to be mixed into model to perform same operation
|
||||
# venue.rb has same functionality which can be shared
|
||||
# TODO: rename guid to UUID as guid is specifically Microsoft term
|
||||
def generate_guid
|
||||
begin
|
||||
guid = SecureRandom.urlsafe_base64
|
||||
end while self.class.where(guid: guid).exists?
|
||||
self.guid = guid
|
||||
loop do
|
||||
@guid = SecureRandom.urlsafe_base64
|
||||
break if !self.class.where(guid: guid).any?
|
||||
end
|
||||
self.guid = @guid
|
||||
end
|
||||
|
||||
def set_week
|
||||
|
|
|
|||
|
|
@ -18,12 +18,9 @@ class EventAttachment < ActiveRecord::Base
|
|||
"delete_url" => conference_proposal_event_attachment_path(self.event.conference.short_title, self.event_id, self.id),
|
||||
"delete_type" => "DELETE"
|
||||
}
|
||||
|
||||
end
|
||||
#:path => ":rails_root/public/system/:attachment/:id/:style/:filename",
|
||||
# :url => "/system/:attachment/:id/:style/:filename"
|
||||
|
||||
#has_paper_trail :meta => {:associated_id => :event_id, :associated_type => "Event"}
|
||||
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ class Openid < ActiveRecord::Base
|
|||
|
||||
if openid.new_record?
|
||||
openid.email = auth.info.email
|
||||
if existing_openid = Openid.where(email: openid.email).first
|
||||
if (existing_openid = Openid.where(email: openid.email).first)
|
||||
openid.user_id = existing_openid.user_id
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -15,5 +15,4 @@ class Room < ActiveRecord::Base
|
|||
# end while Person.where(:guid => guid).exists?
|
||||
self.guid = guid
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -14,5 +14,4 @@ class Track < ActiveRecord::Base
|
|||
# end while Person.where(:guid => guid).exists?
|
||||
self.guid = guid
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -11,13 +11,17 @@ class Venue < ActiveRecord::Base
|
|||
content_type: [/jpg/, /jpeg/, /png/, /gif/],
|
||||
size: { in: 0..500.kilobytes }
|
||||
accepts_nested_attributes_for :lodgings, allow_destroy: true
|
||||
|
||||
private
|
||||
|
||||
# TODO: create a module to be mixed into model to perform same operation
|
||||
# event.rb has same functionality which can be shared
|
||||
# TODO: rename guid to UUID as guid is specifically Microsoft term
|
||||
def generate_guid
|
||||
begin
|
||||
guid = SecureRandom.urlsafe_base64
|
||||
end while Venue.where(:guid => guid).exists?
|
||||
self.guid = guid
|
||||
loop do
|
||||
@guid = SecureRandom.urlsafe_base64
|
||||
break if !Venue.where(:guid => guid).any?
|
||||
end
|
||||
self.guid = @guid
|
||||
end
|
||||
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,5 +4,4 @@ class Vote < ActiveRecord::Base
|
|||
belongs_to :user
|
||||
belongs_to :event
|
||||
delegate :name, to: :user
|
||||
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue