Add web app model, service to fetch metadata
This commit is contained in:
5
app/models/app_catalog.rb
Normal file
5
app/models/app_catalog.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
module AppCatalog
|
||||
def self.table_name_prefix
|
||||
"app_catalog_"
|
||||
end
|
||||
end
|
||||
9
app/models/app_catalog/web_app.rb
Normal file
9
app/models/app_catalog/web_app.rb
Normal file
@@ -0,0 +1,9 @@
|
||||
class AppCatalog::WebApp < ApplicationRecord
|
||||
|
||||
store :metadata, coder: JSON
|
||||
|
||||
validates :url, presence: true, uniqueness: true
|
||||
validates :url, format: { with: URI.regexp },
|
||||
if: Proc.new { |a| a.url.present? }
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user