Added Sequel migrations and models for videos and channels; Fixed database name in Rakefile and defaults config file
This commit is contained in:
5
lib/models/channel.rb
Normal file
5
lib/models/channel.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class Channel < Sequel::Model
|
||||
|
||||
one_to_many :videos
|
||||
|
||||
end
|
5
lib/models/video.rb
Normal file
5
lib/models/video.rb
Normal file
@ -0,0 +1,5 @@
|
||||
class Video < Sequel::Model
|
||||
|
||||
many_to_one :channels
|
||||
|
||||
end
|
@ -1,14 +1,7 @@
|
||||
namespace '/' do
|
||||
|
||||
get '' do
|
||||
channels = [
|
||||
{
|
||||
:name => 'Bit Goblin',
|
||||
:openProjects => 'N/a',
|
||||
:totalProjects => 'N/a',
|
||||
:last_updated => 'N/a'
|
||||
}
|
||||
]
|
||||
channels = Channel.reverse(:updated_at).limit(10).all()
|
||||
erb :index, :locals => {
|
||||
:title => 'Dashboard',
|
||||
:channels => channels
|
||||
|
Reference in New Issue
Block a user