Skip to content

Instantly share code, notes, and snippets.

@owendall
Created January 22, 2010 11:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save owendall/283700 to your computer and use it in GitHub Desktop.
Save owendall/283700 to your computer and use it in GitHub Desktop.
class Archive < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
belongs_to :workspace
class ArchivesController < ApplicationController
hobo_model_controller
auto_actions :all, :except => :index
auto_actions_for :workspace, [:new]
end
class Playlist < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
title :string
timestamps
end
belongs_to :workspace
has_many :playlistitems, :order => :position
has_many :videos, :through => :playlistitems, :accessible => true
lass Playlistitem < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
position :integer
timestamps
end
belongs_to :playlist
belongs_to :video
acts_as_list :scope => :playlist
class PlaylistitemsController < ApplicationController
hobo_model_controller
auto_actions :write_only, [ :show, :update]
auto_actions_for :playlist, [ :new, :create ]
end
class Video < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
title :string
description :string
timestamps
end
has_many :playlistitems
class Workspace < ActiveRecord::Base
hobo_model # Don't put anything above this
fields do
name :string
timestamps
end
has_many :archives, :accessible => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment