Fix basic style issues with rubocop
This commit is contained in:
parent
f4a22851a1
commit
763f864dc9
36 changed files with 108 additions and 143 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue