Created
January 22, 2010 11:31
-
-
Save owendall/283700 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Archive < ActiveRecord::Base | |
hobo_model # Don't put anything above this | |
fields do | |
name :string | |
timestamps | |
end | |
belongs_to :workspace | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ArchivesController < ApplicationController | |
hobo_model_controller | |
auto_actions :all, :except => :index | |
auto_actions_for :workspace, [:new] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class PlaylistitemsController < ApplicationController | |
hobo_model_controller | |
auto_actions :write_only, [ :show, :update] | |
auto_actions_for :playlist, [ :new, :create ] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Video < ActiveRecord::Base | |
hobo_model # Don't put anything above this | |
fields do | |
title :string | |
description :string | |
timestamps | |
end | |
has_many :playlistitems |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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