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:
5
app/models/ip_address.rb
Normal file
5
app/models/ip_address.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class IpAddress < Sequel::Model
|
||||
|
||||
|
||||
|
||||
end
|
17
app/models/item.rb
Normal file
17
app/models/item.rb
Normal 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
|
5
app/models/item_comment.rb
Normal file
5
app/models/item_comment.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class ItemComment < Sequel::Model
|
||||
|
||||
many_to_one :items
|
||||
|
||||
end
|
9
app/models/license.rb
Normal file
9
app/models/license.rb
Normal file
@ -0,0 +1,9 @@
|
||||
class License < Sequel::Model
|
||||
|
||||
one_to_many :license_comments
|
||||
|
||||
def getLink()
|
||||
return "/license/#{self.id}"
|
||||
end
|
||||
|
||||
end
|
5
app/models/license_comment.rb
Normal file
5
app/models/license_comment.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class LicenseComment < Sequel::Model
|
||||
|
||||
many_to_one :licenses
|
||||
|
||||
end
|
Reference in New Issue
Block a user