Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/models/room.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Room < SearchableRecord
has_and_belongs_to_many :tags
has_many :people, dependent: :nullify
has_many :courses, dependent: :nullify
belongs_to :floor
belongs_to :floor, optional: true
belongs_to :outer_shape, class_name: 'Polyline'
has_and_belongs_to_many :walls
has_and_belongs_to_many :points
Expand Down
8 changes: 5 additions & 3 deletions app/views/rooms/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@
<div class='col-3'>
floor
</div>
<div class='col'>
<%= @room.floor.name %>
</div>
<% if @room.floor.present? %>
<div class='col'>
<%= @room.floor.name %>
</div>
<% end %>
</div>
<% if @room.chairs.present? %>
<div class='row'>
Expand Down
2 changes: 1 addition & 1 deletion db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions lib/scraping/scraper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def self.build_info_if_not_exists(person, item, key, problem_checker)

# Save room on person
def self.add_room(person, room, problem_checker)
room = Room.find_or_create_by(number: room)
person.room = room unless problem_checker.check_for_conflict(person, "room")
room_obj = Room.find_or_create_by(full_name: room)
person.room = room_obj unless problem_checker.check_for_conflict(person, "room_id")
end
end