Migrated app to modular Sinatra application; copied in a lot of improvements for a Sinatra app that I learned from Stage Manager

This commit is contained in:
2023-03-14 20:49:42 -04:00
parent 2340dddd06
commit 385dd98dbe
28 changed files with 384 additions and 275 deletions

5
app/models/ip_address.rb Normal file
View File

@ -0,0 +1,5 @@
class IpAddress < Sequel::Model
end

17
app/models/item.rb Normal file
View File

@ -0,0 +1,17 @@
class Item < Sequel::Model
one_to_many :item_comments
def getLink()
return "/item/#{self.id}"
end
def type_selected?(option)
if self.type == option
return 'selected'
else
return ''
end
end
end

View File

@ -0,0 +1,5 @@
class ItemComment < Sequel::Model
many_to_one :items
end

9
app/models/license.rb Normal file
View File

@ -0,0 +1,9 @@
class License < Sequel::Model
one_to_many :license_comments
def getLink()
return "/license/#{self.id}"
end
end

View File

@ -0,0 +1,5 @@
class LicenseComment < Sequel::Model
many_to_one :licenses
end