diff --git a/app/models/favorite.rb b/app/models/beathaven/favorite.rb similarity index 100% rename from app/models/favorite.rb rename to app/models/beathaven/favorite.rb diff --git a/app/models/playlist.rb b/app/models/beathaven/playlist.rb similarity index 100% rename from app/models/playlist.rb rename to app/models/beathaven/playlist.rb diff --git a/app/models/playlist_item.rb b/app/models/beathaven/playlist_item.rb similarity index 100% rename from app/models/playlist_item.rb rename to app/models/beathaven/playlist_item.rb diff --git a/app/models/session.rb b/app/models/beathaven/session.rb similarity index 100% rename from app/models/session.rb rename to app/models/beathaven/session.rb diff --git a/app/models/user.rb b/app/models/beathaven/user.rb similarity index 100% rename from app/models/user.rb rename to app/models/beathaven/user.rb diff --git a/app/models/local_brainz/cached_release.rb b/app/models/local_brainz/cached_release.rb new file mode 100644 index 0000000..0103a9a --- /dev/null +++ b/app/models/local_brainz/cached_release.rb @@ -0,0 +1,4 @@ +class LocalBrainz::CachedRelease < ActiveRecord::Base + belongs_to :album, :class_name => 'Album' + has_many :local_brainz_cached_tracks, :class_name => 'LocalBrainz::CachedTrack', :dependent => :destroy +end diff --git a/app/models/local_brainz/cached_track.rb b/app/models/local_brainz/cached_track.rb new file mode 100644 index 0000000..61da40d --- /dev/null +++ b/app/models/local_brainz/cached_track.rb @@ -0,0 +1,3 @@ +class LocalBrainz::CachedTrack < ActiveRecord::Base + belongs_to :local_brainz_cached_release, :class_name => 'LocalBrainz::CachedRelease' +end diff --git a/app/models/local_brainz.rb b/app/models/local_brainz/local_brainz.rb similarity index 100% rename from app/models/local_brainz.rb rename to app/models/local_brainz/local_brainz.rb diff --git a/app/models/local_brainz/release.rb b/app/models/local_brainz/release.rb deleted file mode 100644 index b7aa0be..0000000 --- a/app/models/local_brainz/release.rb +++ /dev/null @@ -1,4 +0,0 @@ -class LocalBrainz::Release < ActiveRecord::Base - belongs_to :album, :class_name => 'Album' - has_many :local_brainz_tracks, :class_name => 'LocalBrainz::Track', :dependent => :destroy -end diff --git a/app/models/local_brainz/track.rb b/app/models/local_brainz/track.rb deleted file mode 100644 index b835673..0000000 --- a/app/models/local_brainz/track.rb +++ /dev/null @@ -1,3 +0,0 @@ -class LocalBrainz::Track < ActiveRecord::Base - belongs_to :local_brainz_release, :class_name => 'LocalBrainz::Release' -end diff --git a/app/models/album.rb b/app/models/music/album.rb similarity index 100% rename from app/models/album.rb rename to app/models/music/album.rb diff --git a/app/models/album_format.rb b/app/models/music/album_format.rb similarity index 100% rename from app/models/album_format.rb rename to app/models/music/album_format.rb diff --git a/app/models/album_genre.rb b/app/models/music/album_genre.rb similarity index 100% rename from app/models/album_genre.rb rename to app/models/music/album_genre.rb diff --git a/app/models/album_style.rb b/app/models/music/album_style.rb similarity index 100% rename from app/models/album_style.rb rename to app/models/music/album_style.rb diff --git a/app/models/artist.rb b/app/models/music/artist.rb similarity index 100% rename from app/models/artist.rb rename to app/models/music/artist.rb diff --git a/app/models/artist_alias.rb b/app/models/music/artist_alias.rb similarity index 100% rename from app/models/artist_alias.rb rename to app/models/music/artist_alias.rb diff --git a/app/models/artist_link.rb b/app/models/music/artist_link.rb similarity index 100% rename from app/models/artist_link.rb rename to app/models/music/artist_link.rb diff --git a/app/models/genre.rb b/app/models/music/genre.rb similarity index 100% rename from app/models/genre.rb rename to app/models/music/genre.rb diff --git a/app/models/release_format.rb b/app/models/music/release_format.rb similarity index 100% rename from app/models/release_format.rb rename to app/models/music/release_format.rb diff --git a/app/models/style.rb b/app/models/music/style.rb similarity index 100% rename from app/models/style.rb rename to app/models/music/style.rb diff --git a/app/models/track.rb b/app/models/music/track.rb similarity index 100% rename from app/models/track.rb rename to app/models/music/track.rb diff --git a/app/models/track_artist.rb b/app/models/music/track_artist.rb similarity index 100% rename from app/models/track_artist.rb rename to app/models/music/track_artist.rb diff --git a/config/application.rb b/config/application.rb index f8948f9..ed2c684 100644 --- a/config/application.rb +++ b/config/application.rb @@ -16,7 +16,7 @@ module Beathaven # -- all .rb files in that directory are automatically loaded. # Custom directories with classes and modules you want to be autoloadable. - # config.autoload_paths += %W(#{config.root}/extras) + config.autoload_paths += Dir[Rails.root.join('app', 'models', '{**}')] # Only load the plugins named here, in the order given (default is alphabetical). # :all can be used as a placeholder for all plugins not explicitly named. diff --git a/db/migrate/20110925231256_rename_local_brainz_tables.rb b/db/migrate/20110925231256_rename_local_brainz_tables.rb new file mode 100644 index 0000000..905bbfb --- /dev/null +++ b/db/migrate/20110925231256_rename_local_brainz_tables.rb @@ -0,0 +1,10 @@ +class RenameLocalBrainzTables < ActiveRecord::Migration + def self.up + rename_table :local_brainz_tracks, :local_brainz_cached_tracks + rename_table :local_brainz_releases, :local_brainz_cached_releases + end + def self.down + rename_table :local_brainz_cached_tracks, :local_brainz_tracks + rename_table :local_brainz_cached_releases, :local_brainz_releases + end +end