Fix basic style issues with rubocop

This commit is contained in:
Artem Chernikov 2014-07-21 14:27:32 +02:00
parent f4a22851a1
commit 763f864dc9
36 changed files with 108 additions and 143 deletions

View file

@ -102,7 +102,6 @@ class Conference < ActiveRecord::Base
return media_types
end
##
# Checks if the user is registered to the conference
#

View file

@ -18,7 +18,6 @@ class Datatable
}
end
def data
[]
end

View file

@ -3,5 +3,4 @@ class DietaryChoice < ActiveRecord::Base
belongs_to :conference
has_many :registrations
end

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -15,5 +15,4 @@ class Room < ActiveRecord::Base
# end while Person.where(:guid => guid).exists?
self.guid = guid
end
end

View file

@ -14,5 +14,4 @@ class Track < ActiveRecord::Base
# end while Person.where(:guid => guid).exists?
self.guid = guid
end
end

View file

@ -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

View file

@ -4,5 +4,4 @@ class Vote < ActiveRecord::Base
belongs_to :user
belongs_to :event
delegate :name, to: :user
end