Massive Cleanup
authorIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 19:34:40 +0000 (11:34 -0800)
committerIra W. Snyder <devel@irasnyder.com>
Mon, 26 Nov 2007 19:34:40 +0000 (11:34 -0800)
Signed-off-by: Ira W. Snyder <devel@irasnyder.com>
91 files changed:
app/controllers/game_genre_controller.rb [new file with mode: 0644]
app/controllers/game_platform_controller.rb [new file with mode: 0644]
app/controllers/gamegenre_controller.rb [deleted file]
app/controllers/gameplatform_controller.rb [deleted file]
app/controllers/media_controller.rb [deleted file]
app/controllers/video_genre_controller.rb [new file with mode: 0644]
app/controllers/video_media_controller.rb [new file with mode: 0644]
app/controllers/videogenre_controller.rb [deleted file]
app/helpers/game_genre_helper.rb [new file with mode: 0644]
app/helpers/game_platform_helper.rb [new file with mode: 0644]
app/helpers/gamegenre_helper.rb [deleted file]
app/helpers/gameplatform_helper.rb [deleted file]
app/helpers/media_helper.rb [deleted file]
app/helpers/video_genre_helper.rb [new file with mode: 0644]
app/helpers/video_media_helper.rb [new file with mode: 0644]
app/helpers/videogenre_helper.rb [deleted file]
app/models/game.rb
app/models/game_genre.rb [new file with mode: 0644]
app/models/game_platform.rb [new file with mode: 0644]
app/models/gamegenre.rb [deleted file]
app/models/gameplatform.rb [deleted file]
app/models/video.rb
app/models/video_genre.rb [moved from app/models/media.rb with 59% similarity]
app/models/video_media.rb [moved from app/models/videogenre.rb with 59% similarity]
app/views/game/_form.rhtml
app/views/game/list.rhtml
app/views/game/searchresults.rhtml
app/views/game/show.rhtml
app/views/game_genre/_form.rhtml [new file with mode: 0644]
app/views/game_genre/edit.rhtml [new file with mode: 0644]
app/views/game_genre/list.rhtml [new file with mode: 0644]
app/views/game_genre/new.rhtml [moved from app/views/videogenre/new.rhtml with 86% similarity]
app/views/game_genre/show.rhtml [new file with mode: 0644]
app/views/game_platform/_form.rhtml [new file with mode: 0644]
app/views/game_platform/edit.rhtml [new file with mode: 0644]
app/views/game_platform/list.rhtml [new file with mode: 0644]
app/views/game_platform/new.rhtml [moved from app/views/gameplatform/new.rhtml with 85% similarity]
app/views/game_platform/show.rhtml [new file with mode: 0644]
app/views/gamegenre/_form.rhtml [deleted file]
app/views/gamegenre/edit.rhtml [deleted file]
app/views/gamegenre/list.rhtml [deleted file]
app/views/gamegenre/show.rhtml [deleted file]
app/views/gameplatform/_form.rhtml [deleted file]
app/views/gameplatform/edit.rhtml [deleted file]
app/views/gameplatform/list.rhtml [deleted file]
app/views/gameplatform/show.rhtml [deleted file]
app/views/layouts/game_genre.rhtml [moved from app/views/layouts/gamegenre.rhtml with 87% similarity]
app/views/layouts/game_platform.rhtml [moved from app/views/layouts/gameplatform.rhtml with 87% similarity]
app/views/layouts/video_genre.rhtml [moved from app/views/layouts/media.rhtml with 87% similarity]
app/views/layouts/video_media.rhtml [moved from app/views/layouts/videogenre.rhtml with 87% similarity]
app/views/media/_form.rhtml [deleted file]
app/views/media/edit.rhtml [deleted file]
app/views/media/list.rhtml [deleted file]
app/views/media/show.rhtml [deleted file]
app/views/video/_form.rhtml
app/views/video/list.rhtml
app/views/video/searchresults.rhtml
app/views/video/show.rhtml
app/views/video_genre/_form.rhtml [new file with mode: 0644]
app/views/video_genre/edit.rhtml [new file with mode: 0644]
app/views/video_genre/list.rhtml [new file with mode: 0644]
app/views/video_genre/new.rhtml [moved from app/views/media/new.rhtml with 86% similarity]
app/views/video_genre/show.rhtml [new file with mode: 0644]
app/views/video_media/_form.rhtml [new file with mode: 0644]
app/views/video_media/edit.rhtml [new file with mode: 0644]
app/views/video_media/list.rhtml [new file with mode: 0644]
app/views/video_media/new.rhtml [moved from app/views/gamegenre/new.rhtml with 86% similarity]
app/views/video_media/show.rhtml [new file with mode: 0644]
app/views/videogenre/_form.rhtml [deleted file]
app/views/videogenre/edit.rhtml [deleted file]
app/views/videogenre/list.rhtml [deleted file]
app/views/videogenre/show.rhtml [deleted file]
db/development.sqlite3
db/migrate/028_create_video_genres.rb [new file with mode: 0644]
db/migrate/029_create_video_medias.rb [new file with mode: 0644]
db/migrate/030_create_game_genres.rb [new file with mode: 0644]
db/migrate/031_create_game_platforms.rb [new file with mode: 0644]
db/migrate/032_fix_rentables.rb [new file with mode: 0644]
db/schema.rb
test/fixtures/game_genres.yml [moved from test/fixtures/gamegenres.yml with 100% similarity]
test/fixtures/game_platforms.yml [moved from test/fixtures/gameplatforms.yml with 100% similarity]
test/fixtures/video_genres.yml [moved from test/fixtures/medias.yml with 100% similarity]
test/fixtures/video_medias.yml [moved from test/fixtures/videogenres.yml with 100% similarity]
test/functional/game_genre_controller_test.rb [moved from test/functional/gamegenre_controller_test.rb with 63% similarity]
test/functional/game_platform_controller_test.rb [moved from test/functional/gameplatform_controller_test.rb with 62% similarity]
test/functional/video_genre_controller_test.rb [moved from test/functional/videogenre_controller_test.rb with 63% similarity]
test/functional/video_media_controller_test.rb [moved from test/functional/media_controller_test.rb with 63% similarity]
test/unit/game_genre_test.rb [moved from test/unit/gamegenre_test.rb with 66% similarity]
test/unit/game_platform_test.rb [moved from test/unit/gameplatform_test.rb with 64% similarity]
test/unit/video_genre_test.rb [moved from test/unit/media_test.rb with 66% similarity]
test/unit/video_media_test.rb [moved from test/unit/videogenre_test.rb with 66% similarity]

diff --git a/app/controllers/game_genre_controller.rb b/app/controllers/game_genre_controller.rb
new file mode 100644 (file)
index 0000000..ef2b4e1
--- /dev/null
@@ -0,0 +1,51 @@
+class GameGenreController < ApplicationController
+  def index
+    list
+    render :action => 'list'
+  end
+
+  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
+  verify :method => :post, :only => [ :destroy, :create, :update ],
+         :redirect_to => { :action => :list }
+
+  def list
+    @game_genre_pages, @game_genres = paginate :game_genres, :per_page => 10
+  end
+
+  def show
+    @game_genre = GameGenre.find(params[:id])
+  end
+
+  def new
+    @game_genre = GameGenre.new
+  end
+
+  def create
+    @game_genre = GameGenre.new(params[:game_genre])
+    if @game_genre.save
+      flash[:notice] = 'GameGenre was successfully created.'
+      redirect_to :action => 'list'
+    else
+      render :action => 'new'
+    end
+  end
+
+  def edit
+    @game_genre = GameGenre.find(params[:id])
+  end
+
+  def update
+    @game_genre = GameGenre.find(params[:id])
+    if @game_genre.update_attributes(params[:game_genre])
+      flash[:notice] = 'GameGenre was successfully updated.'
+      redirect_to :action => 'show', :id => @game_genre
+    else
+      render :action => 'edit'
+    end
+  end
+
+  def destroy
+    GameGenre.find(params[:id]).destroy
+    redirect_to :action => 'list'
+  end
+end
diff --git a/app/controllers/game_platform_controller.rb b/app/controllers/game_platform_controller.rb
new file mode 100644 (file)
index 0000000..155bf97
--- /dev/null
@@ -0,0 +1,51 @@
+class GamePlatformController < ApplicationController
+  def index
+    list
+    render :action => 'list'
+  end
+
+  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
+  verify :method => :post, :only => [ :destroy, :create, :update ],
+         :redirect_to => { :action => :list }
+
+  def list
+    @game_platform_pages, @game_platforms = paginate :game_platforms, :per_page => 10
+  end
+
+  def show
+    @game_platform = GamePlatform.find(params[:id])
+  end
+
+  def new
+    @game_platform = GamePlatform.new
+  end
+
+  def create
+    @game_platform = GamePlatform.new(params[:game_platform])
+    if @game_platform.save
+      flash[:notice] = 'GamePlatform was successfully created.'
+      redirect_to :action => 'list'
+    else
+      render :action => 'new'
+    end
+  end
+
+  def edit
+    @game_platform = GamePlatform.find(params[:id])
+  end
+
+  def update
+    @game_platform = GamePlatform.find(params[:id])
+    if @game_platform.update_attributes(params[:game_platform])
+      flash[:notice] = 'GamePlatform was successfully updated.'
+      redirect_to :action => 'show', :id => @game_platform
+    else
+      render :action => 'edit'
+    end
+  end
+
+  def destroy
+    GamePlatform.find(params[:id]).destroy
+    redirect_to :action => 'list'
+  end
+end
diff --git a/app/controllers/gamegenre_controller.rb b/app/controllers/gamegenre_controller.rb
deleted file mode 100644 (file)
index e3005b1..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-class GamegenreController < ApplicationController
-
-  # Make sure that a user logs in before doing any action here
-  before_filter :authorize
-
-  def index
-    list
-    render :action => 'list'
-  end
-
-  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
-  verify :method => :post, :only => [ :destroy, :create, :update ],
-         :redirect_to => { :action => :list }
-
-  def list
-    @gamegenre_pages, @gamegenres = paginate :gamegenres, :per_page => 10
-  end
-
-  def show
-    @gamegenre = Gamegenre.find(params[:id])
-  end
-
-  def new
-    @gamegenre = Gamegenre.new
-  end
-
-  def create
-    @gamegenre = Gamegenre.new(params[:gamegenre])
-    if @gamegenre.save
-      flash[:notice] = 'Gamegenre was successfully created.'
-      redirect_to :action => 'list'
-    else
-      render :action => 'new'
-    end
-  end
-
-  def edit
-    @gamegenre = Gamegenre.find(params[:id])
-  end
-
-  def update
-    @gamegenre = Gamegenre.find(params[:id])
-    if @gamegenre.update_attributes(params[:gamegenre])
-      flash[:notice] = 'Gamegenre was successfully updated.'
-      redirect_to :action => 'show', :id => @gamegenre
-    else
-      render :action => 'edit'
-    end
-  end
-
-  def destroy
-    Gamegenre.find(params[:id]).destroy
-    redirect_to :action => 'list'
-  end
-end
diff --git a/app/controllers/gameplatform_controller.rb b/app/controllers/gameplatform_controller.rb
deleted file mode 100644 (file)
index 4e009c8..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-class GameplatformController < ApplicationController
-
-  # Make sure that a user logs in before doing any action here
-  before_filter :authorize
-
-  def index
-    list
-    render :action => 'list'
-  end
-
-  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
-  verify :method => :post, :only => [ :destroy, :create, :update ],
-         :redirect_to => { :action => :list }
-
-  def list
-    @gameplatform_pages, @gameplatforms = paginate :gameplatforms, :per_page => 10
-  end
-
-  def show
-    @gameplatform = Gameplatform.find(params[:id])
-  end
-
-  def new
-    @gameplatform = Gameplatform.new
-  end
-
-  def create
-    @gameplatform = Gameplatform.new(params[:gameplatform])
-    if @gameplatform.save
-      flash[:notice] = 'Gameplatform was successfully created.'
-      redirect_to :action => 'list'
-    else
-      render :action => 'new'
-    end
-  end
-
-  def edit
-    @gameplatform = Gameplatform.find(params[:id])
-  end
-
-  def update
-    @gameplatform = Gameplatform.find(params[:id])
-    if @gameplatform.update_attributes(params[:gameplatform])
-      flash[:notice] = 'Gameplatform was successfully updated.'
-      redirect_to :action => 'show', :id => @gameplatform
-    else
-      render :action => 'edit'
-    end
-  end
-
-  def destroy
-    Gameplatform.find(params[:id]).destroy
-    redirect_to :action => 'list'
-  end
-end
diff --git a/app/controllers/media_controller.rb b/app/controllers/media_controller.rb
deleted file mode 100644 (file)
index be0c368..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-class MediaController < ApplicationController
-
-  # Make sure that a user logs in before doing any action here
-  before_filter :authorize
-
-  def index
-    list
-    render :action => 'list'
-  end
-
-  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
-  verify :method => :post, :only => [ :destroy, :create, :update ],
-         :redirect_to => { :action => :list }
-
-  def list
-    @media_pages, @medias = paginate :medias, :per_page => 10
-  end
-
-  def show
-    @media = Media.find(params[:id])
-  end
-
-  def new
-    @media = Media.new
-  end
-
-  def create
-    @media = Media.new(params[:media])
-    if @media.save
-      flash[:notice] = 'Media was successfully created.'
-      redirect_to :action => 'list'
-    else
-      render :action => 'new'
-    end
-  end
-
-  def edit
-    @media = Media.find(params[:id])
-  end
-
-  def update
-    @media = Media.find(params[:id])
-    if @media.update_attributes(params[:media])
-      flash[:notice] = 'Media was successfully updated.'
-      redirect_to :action => 'show', :id => @media
-    else
-      render :action => 'edit'
-    end
-  end
-
-  def destroy
-    Media.find(params[:id]).destroy
-    redirect_to :action => 'list'
-  end
-end
diff --git a/app/controllers/video_genre_controller.rb b/app/controllers/video_genre_controller.rb
new file mode 100644 (file)
index 0000000..6fe0d8f
--- /dev/null
@@ -0,0 +1,51 @@
+class VideoGenreController < ApplicationController
+  def index
+    list
+    render :action => 'list'
+  end
+
+  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
+  verify :method => :post, :only => [ :destroy, :create, :update ],
+         :redirect_to => { :action => :list }
+
+  def list
+    @video_genre_pages, @video_genres = paginate :video_genres, :per_page => 10
+  end
+
+  def show
+    @video_genre = VideoGenre.find(params[:id])
+  end
+
+  def new
+    @video_genre = VideoGenre.new
+  end
+
+  def create
+    @video_genre = VideoGenre.new(params[:video_genre])
+    if @video_genre.save
+      flash[:notice] = 'VideoGenre was successfully created.'
+      redirect_to :action => 'list'
+    else
+      render :action => 'new'
+    end
+  end
+
+  def edit
+    @video_genre = VideoGenre.find(params[:id])
+  end
+
+  def update
+    @video_genre = VideoGenre.find(params[:id])
+    if @video_genre.update_attributes(params[:video_genre])
+      flash[:notice] = 'VideoGenre was successfully updated.'
+      redirect_to :action => 'show', :id => @video_genre
+    else
+      render :action => 'edit'
+    end
+  end
+
+  def destroy
+    VideoGenre.find(params[:id]).destroy
+    redirect_to :action => 'list'
+  end
+end
diff --git a/app/controllers/video_media_controller.rb b/app/controllers/video_media_controller.rb
new file mode 100644 (file)
index 0000000..3c75f06
--- /dev/null
@@ -0,0 +1,51 @@
+class VideoMediaController < ApplicationController
+  def index
+    list
+    render :action => 'list'
+  end
+
+  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
+  verify :method => :post, :only => [ :destroy, :create, :update ],
+         :redirect_to => { :action => :list }
+
+  def list
+    @video_media_pages, @video_medias = paginate :video_medias, :per_page => 10
+  end
+
+  def show
+    @video_media = VideoMedia.find(params[:id])
+  end
+
+  def new
+    @video_media = VideoMedia.new
+  end
+
+  def create
+    @video_media = VideoMedia.new(params[:video_media])
+    if @video_media.save
+      flash[:notice] = 'VideoMedia was successfully created.'
+      redirect_to :action => 'list'
+    else
+      render :action => 'new'
+    end
+  end
+
+  def edit
+    @video_media = VideoMedia.find(params[:id])
+  end
+
+  def update
+    @video_media = VideoMedia.find(params[:id])
+    if @video_media.update_attributes(params[:video_media])
+      flash[:notice] = 'VideoMedia was successfully updated.'
+      redirect_to :action => 'show', :id => @video_media
+    else
+      render :action => 'edit'
+    end
+  end
+
+  def destroy
+    VideoMedia.find(params[:id]).destroy
+    redirect_to :action => 'list'
+  end
+end
diff --git a/app/controllers/videogenre_controller.rb b/app/controllers/videogenre_controller.rb
deleted file mode 100644 (file)
index c0cef4f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-class VideogenreController < ApplicationController
-
-  # Make sure that a user logs in before doing any action here
-  before_filter :authorize
-
-  def index
-    list
-    render :action => 'list'
-  end
-
-  # GETs should be safe (see http://www.w3.org/2001/tag/doc/whenToUseGet.html)
-  verify :method => :post, :only => [ :destroy, :create, :update ],
-         :redirect_to => { :action => :list }
-
-  def list
-    @videogenre_pages, @videogenres = paginate :videogenres, :per_page => 10
-  end
-
-  def show
-    @videogenre = Videogenre.find(params[:id])
-  end
-
-  def new
-    @videogenre = Videogenre.new
-  end
-
-  def create
-    @videogenre = Videogenre.new(params[:videogenre])
-    if @videogenre.save
-      flash[:notice] = 'Videogenre was successfully created.'
-      redirect_to :action => 'list'
-    else
-      render :action => 'new'
-    end
-  end
-
-  def edit
-    @videogenre = Videogenre.find(params[:id])
-  end
-
-  def update
-    @videogenre = Videogenre.find(params[:id])
-    if @videogenre.update_attributes(params[:videogenre])
-      flash[:notice] = 'Videogenre was successfully updated.'
-      redirect_to :action => 'show', :id => @videogenre
-    else
-      render :action => 'edit'
-    end
-  end
-
-  def destroy
-    Videogenre.find(params[:id]).destroy
-    redirect_to :action => 'list'
-  end
-end
diff --git a/app/helpers/game_genre_helper.rb b/app/helpers/game_genre_helper.rb
new file mode 100644 (file)
index 0000000..321bfdb
--- /dev/null
@@ -0,0 +1,2 @@
+module GameGenreHelper
+end
diff --git a/app/helpers/game_platform_helper.rb b/app/helpers/game_platform_helper.rb
new file mode 100644 (file)
index 0000000..7e5adce
--- /dev/null
@@ -0,0 +1,2 @@
+module GamePlatformHelper
+end
diff --git a/app/helpers/gamegenre_helper.rb b/app/helpers/gamegenre_helper.rb
deleted file mode 100644 (file)
index d53499c..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-module GamegenreHelper
-end
diff --git a/app/helpers/gameplatform_helper.rb b/app/helpers/gameplatform_helper.rb
deleted file mode 100644 (file)
index a8bb6d0..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-module GameplatformHelper
-end
diff --git a/app/helpers/media_helper.rb b/app/helpers/media_helper.rb
deleted file mode 100644 (file)
index d08298b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-module MediaHelper
-end
diff --git a/app/helpers/video_genre_helper.rb b/app/helpers/video_genre_helper.rb
new file mode 100644 (file)
index 0000000..f1e8a9a
--- /dev/null
@@ -0,0 +1,2 @@
+module VideoGenreHelper
+end
diff --git a/app/helpers/video_media_helper.rb b/app/helpers/video_media_helper.rb
new file mode 100644 (file)
index 0000000..d167258
--- /dev/null
@@ -0,0 +1,2 @@
+module VideoMediaHelper
+end
diff --git a/app/helpers/videogenre_helper.rb b/app/helpers/videogenre_helper.rb
deleted file mode 100644 (file)
index f369342..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-module VideogenreHelper
-end
index f2e627c..55639a7 100644 (file)
@@ -1,16 +1,16 @@
 class Game < Rentable
-  has_many :game_genres, :through => Gamegenre
-  has_many :gameplatforms, :through => Gameplatform
+  has_many :game_genres
+  has_many :game_platforms
 
-  validates_presence_of :game_genre
-  validates_presence_of :platform
+  validates_presence_of :game_genre_id
+  validates_presence_of :game_platform_id
 
   def genre
-    return Gamegenre.find(game_genre).name
+    GameGenre.find_by_id(game_genre_id)
   end
 
-  def game_platform
-    return Gameplatform.find(platform).name
+  def platform
+    GamePlatform.find_by_id(game_platform_id)
   end
 
   def calculated_price
@@ -35,12 +35,4 @@ class Game < Rentable
     return Time.now.advance(:days => period).to_date
   end
 
-  def genre_name
-    Gamegenre.find_by_id(game_genre).name
-  end
-
-  def platform_name
-    Gameplatform.find_by_id(platform).name
-  end
-
 end
diff --git a/app/models/game_genre.rb b/app/models/game_genre.rb
new file mode 100644 (file)
index 0000000..8bcc2f3
--- /dev/null
@@ -0,0 +1,3 @@
+class GameGenre < ActiveRecord::Base
+  belongs_to :game
+end
diff --git a/app/models/game_platform.rb b/app/models/game_platform.rb
new file mode 100644 (file)
index 0000000..379684e
--- /dev/null
@@ -0,0 +1,3 @@
+class GamePlatform < ActiveRecord::Base
+  belongs_to :game
+end
diff --git a/app/models/gamegenre.rb b/app/models/gamegenre.rb
deleted file mode 100644 (file)
index 37c1eff..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-class Gamegenre < ActiveRecord::Base
-  belongs_to :game
-end
diff --git a/app/models/gameplatform.rb b/app/models/gameplatform.rb
deleted file mode 100644 (file)
index c14fcf7..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-class Gameplatform < ActiveRecord::Base
-  belongs_to :game
-end
index b20602a..7739aeb 100644 (file)
@@ -1,17 +1,17 @@
 class Video < Rentable
   has_many :video_genres
-  has_many :medias
+  has_many :video_medias
 
   validates_presence_of :director
-  validates_presence_of :video_genre
-  validates_presence_of :media
+  validates_presence_of :video_genre_id
+  validates_presence_of :video_media_id
 
   def genre
-    return Videogenre.find(video_genre).name
+    VideoGenre.find_by_id(video_genre_id)
   end
 
-  def media_name
-    return Media.find(media).name
+  def media
+    VideoMedia.find_by_id(video_media_id)
   end
 
   def calculated_price
@@ -39,6 +39,6 @@ class Video < Rentable
   protected
   def validate
     errors.add(:video_genre, "does not exist in the database") if video_genre.nil?
-    errors.add(:media, "does not exist in the database") if media.nil?
+    errors.add(:video_media, "does not exist in the database") if video_media.nil?
   end
 end
similarity index 59%
rename from app/models/media.rb
rename to app/models/video_genre.rb
index fc20733..d28062b 100644 (file)
@@ -1,4 +1,4 @@
-class Media < ActiveRecord::Base
+class VideoGenre < ActiveRecord::Base
   belongs_to :video
 
   validates_presence_of :name
similarity index 59%
rename from app/models/videogenre.rb
rename to app/models/video_media.rb
index 5182e33..3c24b02 100644 (file)
@@ -1,4 +1,4 @@
-class Videogenre < ActiveRecord::Base
+class VideoMedia < ActiveRecord::Base
   belongs_to :video
 
   validates_presence_of :name
index 69c3904..e74b713 100644 (file)
@@ -7,10 +7,10 @@
 <p><label for="game_newrelease">New Release</label><br/>
 <%= check_box 'game', 'newrelease' %></p>
 
-<p><label for="game_platform">Platform</label><br/>
-<%= select 'game', 'platform', Gameplatform.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
+<p><label for="game_game_platform_id">Platform</label><br/>
+<%= select 'game', 'game_platform_id', GamePlatform.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
 
-<p><label for="game_genre">Genre</label><br/>
-<%= select 'game', 'game_genre', Gamegenre.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
+<p><label for="game_game_genre_id">Genre</label><br/>
+<%= select 'game', 'game_genre_id', GameGenre.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
 <!--[eoform:game]-->
 
index a32c14d..4528322 100644 (file)
@@ -16,8 +16,8 @@
     <td><%=h game.title %></td>
     <td><%=h tf_to_yesno(game.checkedout?) %></td>
     <td><%=h tf_to_yesno(game.newrelease) %></td>
-    <td><%=h game.genre %></td>
-    <td><%=h game.game_platform %></td>
+    <td><%=h game.genre.name %></td>
+    <td><%=h game.platform.name %></td>
     <td><%= link_to 'View', :action => 'show', :id => game %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => game %></td>
     <td><%= link_to 'Remove', { :action => 'destroy', :id => game }, :confirm => 'Are you sure?', :method => :post %></td>
index 203f4cc..b8c5d76 100644 (file)
@@ -19,8 +19,8 @@
     <td><%=h game.title %></td>
     <td><%=h tf_to_yesno(game.checkedout?) %></td>
     <td><%=h tf_to_yesno(game.newrelease) %></td>
-    <td><%=h game.genre %></td>
-    <td><%=h game.game_platform %></td>
+    <td><%=h game.genre.name %></td>
+    <td><%=h game.platform.name %></td>
     <td><%= link_to 'View', :action => 'show', :id => game %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => game %></td>
     <td><%= link_to 'Remove', { :action => 'destroy', :id => game }, :confirm => 'Are you sure?', :method => :post %></td>
index e31791b..e7c5333 100644 (file)
@@ -1,8 +1,8 @@
 <p><b>Game ID:</b> <%=h @game.id.to_s %></p>
 <p><b>Title:</b> <%=h @game.title %></p>
 <p><b>New Release:</b> <%=h tf_to_yesno(@game.newrelease) %></p>
-<p><b>Genre:</b> <%=h @game.genre_name %></p>
-<p><b>Platform:</b> <%=h @game.platform_name %></p>
+<p><b>Genre:</b> <%=h @game.genre.name %></p>
+<p><b>Platform:</b> <%=h @game.platform.name %></p>
 
 
 <%= link_to 'Edit', :action => 'edit', :id => @game %> |
diff --git a/app/views/game_genre/_form.rhtml b/app/views/game_genre/_form.rhtml
new file mode 100644 (file)
index 0000000..63713d6
--- /dev/null
@@ -0,0 +1,7 @@
+<%= error_messages_for 'game_genre' %>
+
+<!--[form:game_genre]-->
+<p><label for="game_genre_name">Name</label><br/>
+<%= text_field 'game_genre', 'name'  %></p>
+<!--[eoform:game_genre]-->
+
diff --git a/app/views/game_genre/edit.rhtml b/app/views/game_genre/edit.rhtml
new file mode 100644 (file)
index 0000000..f539e97
--- /dev/null
@@ -0,0 +1,9 @@
+<h1>Editing game_genre</h1>
+
+<% form_tag :action => 'update', :id => @game_genre do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag 'Edit' %>
+<% end %>
+
+<%= link_to 'Show', :action => 'show', :id => @game_genre %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/game_genre/list.rhtml b/app/views/game_genre/list.rhtml
new file mode 100644 (file)
index 0000000..83c005c
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing game_genres</h1>
+
+<table>
+  <tr>
+  <% for column in GameGenre.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for game_genre in @game_genres %>
+  <tr>
+  <% for column in GameGenre.content_columns %>
+    <td><%=h game_genre.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => game_genre %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => game_genre %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => game_genre }, :confirm => 'Are you sure?', :method => :post %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @game_genre_pages.current.previous } if @game_genre_pages.current.previous %>
+<%= link_to 'Next page', { :page => @game_genre_pages.current.next } if @game_genre_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New game_genre', :action => 'new' %>
similarity index 86%
rename from app/views/videogenre/new.rhtml
rename to app/views/game_genre/new.rhtml
index e842ea3..46de91d 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New videogenre</h1>
+<h1>New game_genre</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>
diff --git a/app/views/game_genre/show.rhtml b/app/views/game_genre/show.rhtml
new file mode 100644 (file)
index 0000000..5b05499
--- /dev/null
@@ -0,0 +1,8 @@
+<% for column in GameGenre.content_columns %>
+<p>
+  <b><%= column.human_name %>:</b> <%=h @game_genre.send(column.name) %>
+</p>
+<% end %>
+
+<%= link_to 'Edit', :action => 'edit', :id => @game_genre %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/game_platform/_form.rhtml b/app/views/game_platform/_form.rhtml
new file mode 100644 (file)
index 0000000..1601bba
--- /dev/null
@@ -0,0 +1,7 @@
+<%= error_messages_for 'game_platform' %>
+
+<!--[form:game_platform]-->
+<p><label for="game_platform_name">Name</label><br/>
+<%= text_field 'game_platform', 'name'  %></p>
+<!--[eoform:game_platform]-->
+
diff --git a/app/views/game_platform/edit.rhtml b/app/views/game_platform/edit.rhtml
new file mode 100644 (file)
index 0000000..237e1d5
--- /dev/null
@@ -0,0 +1,9 @@
+<h1>Editing game_platform</h1>
+
+<% form_tag :action => 'update', :id => @game_platform do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag 'Edit' %>
+<% end %>
+
+<%= link_to 'Show', :action => 'show', :id => @game_platform %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/game_platform/list.rhtml b/app/views/game_platform/list.rhtml
new file mode 100644 (file)
index 0000000..3206a36
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing game_platforms</h1>
+
+<table>
+  <tr>
+  <% for column in GamePlatform.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for game_platform in @game_platforms %>
+  <tr>
+  <% for column in GamePlatform.content_columns %>
+    <td><%=h game_platform.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => game_platform %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => game_platform %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => game_platform }, :confirm => 'Are you sure?', :method => :post %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @game_platform_pages.current.previous } if @game_platform_pages.current.previous %>
+<%= link_to 'Next page', { :page => @game_platform_pages.current.next } if @game_platform_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New game_platform', :action => 'new' %>
similarity index 85%
rename from app/views/gameplatform/new.rhtml
rename to app/views/game_platform/new.rhtml
index 7341fb4..fdc286d 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New gameplatform</h1>
+<h1>New game_platform</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>
diff --git a/app/views/game_platform/show.rhtml b/app/views/game_platform/show.rhtml
new file mode 100644 (file)
index 0000000..72cd5d9
--- /dev/null
@@ -0,0 +1,8 @@
+<% for column in GamePlatform.content_columns %>
+<p>
+  <b><%= column.human_name %>:</b> <%=h @game_platform.send(column.name) %>
+</p>
+<% end %>
+
+<%= link_to 'Edit', :action => 'edit', :id => @game_platform %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/gamegenre/_form.rhtml b/app/views/gamegenre/_form.rhtml
deleted file mode 100644 (file)
index 9378e76..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= error_messages_for 'gamegenre' %>
-
-<!--[form:gamegenre]-->
-<p><label for="gamegenre_name">Name</label><br/>
-<%= text_field 'gamegenre', 'name'  %></p>
-<!--[eoform:gamegenre]-->
-
diff --git a/app/views/gamegenre/edit.rhtml b/app/views/gamegenre/edit.rhtml
deleted file mode 100644 (file)
index e5246a9..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<h1>Editing gamegenre</h1>
-
-<% form_tag :action => 'update', :id => @gamegenre do %>
-  <%= render :partial => 'form' %>
-  <%= submit_tag 'Edit' %>
-<% end %>
-
-<%= link_to 'Show', :action => 'show', :id => @gamegenre %> |
-<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/gamegenre/list.rhtml b/app/views/gamegenre/list.rhtml
deleted file mode 100644 (file)
index 21e0ea3..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1>Listing gamegenres</h1>
-
-<table>
-  <tr>
-  <% for column in Gamegenre.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
-  </tr>
-  
-<% for gamegenre in @gamegenres %>
-  <tr>
-  <% for column in Gamegenre.content_columns %>
-    <td><%=h gamegenre.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => gamegenre %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => gamegenre %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => gamegenre }, :confirm => 'Are you sure?', :method => :post %></td>
-  </tr>
-<% end %>
-</table>
-
-<%= link_to 'Previous page', { :page => @gamegenre_pages.current.previous } if @gamegenre_pages.current.previous %>
-<%= link_to 'Next page', { :page => @gamegenre_pages.current.next } if @gamegenre_pages.current.next %> 
-
-<br />
-
-<%= link_to 'New gamegenre', :action => 'new' %>
diff --git a/app/views/gamegenre/show.rhtml b/app/views/gamegenre/show.rhtml
deleted file mode 100644 (file)
index 417f406..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<% for column in Gamegenre.content_columns %>
-<p>
-  <b><%= column.human_name %>:</b> <%=h @gamegenre.send(column.name) %>
-</p>
-<% end %>
-
-<%= link_to 'Edit', :action => 'edit', :id => @gamegenre %> |
-<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/gameplatform/_form.rhtml b/app/views/gameplatform/_form.rhtml
deleted file mode 100644 (file)
index 7ea8d9b..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= error_messages_for 'gameplatform' %>
-
-<!--[form:gameplatform]-->
-<p><label for="gameplatform_name">Name</label><br/>
-<%= text_field 'gameplatform', 'name'  %></p>
-<!--[eoform:gameplatform]-->
-
diff --git a/app/views/gameplatform/edit.rhtml b/app/views/gameplatform/edit.rhtml
deleted file mode 100644 (file)
index 5eb3cbd..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<h1>Editing gameplatform</h1>
-
-<% form_tag :action => 'update', :id => @gameplatform do %>
-  <%= render :partial => 'form' %>
-  <%= submit_tag 'Edit' %>
-<% end %>
-
-<%= link_to 'Show', :action => 'show', :id => @gameplatform %> |
-<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/gameplatform/list.rhtml b/app/views/gameplatform/list.rhtml
deleted file mode 100644 (file)
index e2be35d..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1>Listing gameplatforms</h1>
-
-<table>
-  <tr>
-  <% for column in Gameplatform.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
-  </tr>
-  
-<% for gameplatform in @gameplatforms %>
-  <tr>
-  <% for column in Gameplatform.content_columns %>
-    <td><%=h gameplatform.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => gameplatform %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => gameplatform %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => gameplatform }, :confirm => 'Are you sure?', :method => :post %></td>
-  </tr>
-<% end %>
-</table>
-
-<%= link_to 'Previous page', { :page => @gameplatform_pages.current.previous } if @gameplatform_pages.current.previous %>
-<%= link_to 'Next page', { :page => @gameplatform_pages.current.next } if @gameplatform_pages.current.next %> 
-
-<br />
-
-<%= link_to 'New gameplatform', :action => 'new' %>
diff --git a/app/views/gameplatform/show.rhtml b/app/views/gameplatform/show.rhtml
deleted file mode 100644 (file)
index 12b8ce5..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<% for column in Gameplatform.content_columns %>
-<p>
-  <b><%= column.human_name %>:</b> <%=h @gameplatform.send(column.name) %>
-</p>
-<% end %>
-
-<%= link_to 'Edit', :action => 'edit', :id => @gameplatform %> |
-<%= link_to 'Back', :action => 'list' %>
similarity index 87%
rename from app/views/layouts/gamegenre.rhtml
rename to app/views/layouts/game_genre.rhtml
index ab082d2..29a36ae 100644 (file)
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
   <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-  <title>Gamegenre: <%= controller.action_name %></title>
+  <title>GameGenre: <%= controller.action_name %></title>
   <%= stylesheet_link_tag 'scaffold' %>
 </head>
 <body>
similarity index 87%
rename from app/views/layouts/gameplatform.rhtml
rename to app/views/layouts/game_platform.rhtml
index 8abc654..ebeb521 100644 (file)
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
   <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-  <title>Gameplatform: <%= controller.action_name %></title>
+  <title>GamePlatform: <%= controller.action_name %></title>
   <%= stylesheet_link_tag 'scaffold' %>
 </head>
 <body>
similarity index 87%
rename from app/views/layouts/media.rhtml
rename to app/views/layouts/video_genre.rhtml
index 6fefa03..ce9a7f1 100644 (file)
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
   <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-  <title>Media: <%= controller.action_name %></title>
+  <title>VideoGenre: <%= controller.action_name %></title>
   <%= stylesheet_link_tag 'scaffold' %>
 </head>
 <body>
similarity index 87%
rename from app/views/layouts/videogenre.rhtml
rename to app/views/layouts/video_media.rhtml
index ede979e..fd5434b 100644 (file)
@@ -4,7 +4,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 <head>
   <meta http-equiv="content-type" content="text/html;charset=UTF-8" />
-  <title>Videogenre: <%= controller.action_name %></title>
+  <title>VideoMedia: <%= controller.action_name %></title>
   <%= stylesheet_link_tag 'scaffold' %>
 </head>
 <body>
diff --git a/app/views/media/_form.rhtml b/app/views/media/_form.rhtml
deleted file mode 100644 (file)
index d29cadb..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= error_messages_for 'media' %>
-
-<!--[form:media]-->
-<p><label for="media_name">Name</label><br/>
-<%= text_field 'media', 'name'  %></p>
-<!--[eoform:media]-->
-
diff --git a/app/views/media/edit.rhtml b/app/views/media/edit.rhtml
deleted file mode 100644 (file)
index 6a99fbc..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<h1>Editing media</h1>
-
-<% form_tag :action => 'update', :id => @media do %>
-  <%= render :partial => 'form' %>
-  <%= submit_tag 'Edit' %>
-<% end %>
-
-<%= link_to 'Show', :action => 'show', :id => @media %> |
-<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/media/list.rhtml b/app/views/media/list.rhtml
deleted file mode 100644 (file)
index 020d74f..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1>Listing medias</h1>
-
-<table>
-  <tr>
-  <% for column in Media.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
-  </tr>
-  
-<% for media in @medias %>
-  <tr>
-  <% for column in Media.content_columns %>
-    <td><%=h media.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => media %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => media %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => media }, :confirm => 'Are you sure?', :method => :post %></td>
-  </tr>
-<% end %>
-</table>
-
-<%= link_to 'Previous page', { :page => @media_pages.current.previous } if @media_pages.current.previous %>
-<%= link_to 'Next page', { :page => @media_pages.current.next } if @media_pages.current.next %> 
-
-<br />
-
-<%= link_to 'New media', :action => 'new' %>
diff --git a/app/views/media/show.rhtml b/app/views/media/show.rhtml
deleted file mode 100644 (file)
index 695e6b0..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<% for column in Media.content_columns %>
-<p>
-  <b><%= column.human_name %>:</b> <%=h @media.send(column.name) %>
-</p>
-<% end %>
-
-<%= link_to 'Edit', :action => 'edit', :id => @media %> |
-<%= link_to 'Back', :action => 'list' %>
index 51b9628..91a9e4b 100644 (file)
@@ -7,13 +7,13 @@
 <p><label for="video_newrelease">Newrelease</label><br/>
 <%= check_box 'video', 'newrelease' %></p>
 
-<p><label for="video_genre">Genre</label><br/>
-<%= select 'video', 'video_genre', Videogenre.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
+<p><label for="video_video_genre_id">Genre</label><br/>
+<%= select 'video', 'video_genre_id', VideoGenre.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
 
 <p><label for="video_director">Director</label><br/>
 <%= text_field 'video', 'director'  %></p>
 
-<p><label for="video_media">Media</label><br/>
-<%= select 'video', 'media', Media.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
+<p><label for="video_video_media_id">Media</label><br/>
+<%= select 'video', 'video_media_id', VideoMedia.find(:all).collect {|c| [c.name.to_s, c.id] } %></p>
 <!--[eoform:video]-->
 
index 113ee97..198eeb1 100644 (file)
@@ -17,9 +17,9 @@
     <td><%=h video.title %></td>
     <td><%=h tf_to_yesno(video.checkedout?) %></td>
     <td><%=h tf_to_yesno(video.newrelease) %></td>
-    <td><%=h video.genre %></td>
+    <td><%=h video.genre.name %></td>
     <td><%=h video.director %></td>
-    <td><%=h video.media_name %></td>
+    <td><%=h video.media.name %></td>
     <td><%= link_to 'View', :action => 'show', :id => video %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => video %></td>
     <td><%= link_to 'Remove', { :action => 'destroy', :id => video }, :confirm => 'Are you sure?', :method => :post %></td>
index eae7d23..587ddf7 100644 (file)
@@ -20,9 +20,9 @@
     <td><%=h video.title %></td>
     <td><%=h tf_to_yesno(video.checkedout?) %></td>
     <td><%=h tf_to_yesno(video.newrelease) %></td>
-    <td><%=h video.genre %></td>
+    <td><%=h video.genre.name %></td>
     <td><%=h video.director %></td>
-    <td><%=h video.media_name %></td>
+    <td><%=h video.media.name %></td>
     <td><%= link_to 'View', :action => 'show', :id => video %></td>
     <td><%= link_to 'Edit', :action => 'edit', :id => video %></td>
     <td><%= link_to 'Remove', { :action => 'destroy', :id => video }, :confirm => 'Are you sure?', :post => true %></td>
index 631ec4b..d20135a 100644 (file)
@@ -1,9 +1,9 @@
 <p><b>Video ID:</b> <%=h @video.id.to_s %></p>
 <p><b>Title:</b> <%=h @video.title %></p>
 <p><b>New Release:</b> <%=h tf_to_yesno(@video.newrelease) %></p>
-<p><b>Genre:</b> <%=h @video.genre %></p>
+<p><b>Genre:</b> <%=h @video.genre.name %></p>
 <p><b>Director:</b> <%=h @video.director %></p>
-<p><b>Media:</b> <%=h @video.media_name %></p>
+<p><b>Media:</b> <%=h @video.media.name %></p>
 
 <%= link_to 'Edit', :action => 'edit', :id => @video %> |
 <%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/video_genre/_form.rhtml b/app/views/video_genre/_form.rhtml
new file mode 100644 (file)
index 0000000..92b3dfd
--- /dev/null
@@ -0,0 +1,7 @@
+<%= error_messages_for 'video_genre' %>
+
+<!--[form:video_genre]-->
+<p><label for="video_genre_name">Name</label><br/>
+<%= text_field 'video_genre', 'name'  %></p>
+<!--[eoform:video_genre]-->
+
diff --git a/app/views/video_genre/edit.rhtml b/app/views/video_genre/edit.rhtml
new file mode 100644 (file)
index 0000000..9d45a13
--- /dev/null
@@ -0,0 +1,9 @@
+<h1>Editing video_genre</h1>
+
+<% form_tag :action => 'update', :id => @video_genre do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag 'Edit' %>
+<% end %>
+
+<%= link_to 'Show', :action => 'show', :id => @video_genre %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/video_genre/list.rhtml b/app/views/video_genre/list.rhtml
new file mode 100644 (file)
index 0000000..2e64727
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing video_genres</h1>
+
+<table>
+  <tr>
+  <% for column in VideoGenre.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for video_genre in @video_genres %>
+  <tr>
+  <% for column in VideoGenre.content_columns %>
+    <td><%=h video_genre.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => video_genre %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => video_genre %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => video_genre }, :confirm => 'Are you sure?', :method => :post %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @video_genre_pages.current.previous } if @video_genre_pages.current.previous %>
+<%= link_to 'Next page', { :page => @video_genre_pages.current.next } if @video_genre_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New video_genre', :action => 'new' %>
similarity index 86%
rename from app/views/media/new.rhtml
rename to app/views/video_genre/new.rhtml
index ee6bf50..8624080 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New media</h1>
+<h1>New video_genre</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>
diff --git a/app/views/video_genre/show.rhtml b/app/views/video_genre/show.rhtml
new file mode 100644 (file)
index 0000000..cab19df
--- /dev/null
@@ -0,0 +1,8 @@
+<% for column in VideoGenre.content_columns %>
+<p>
+  <b><%= column.human_name %>:</b> <%=h @video_genre.send(column.name) %>
+</p>
+<% end %>
+
+<%= link_to 'Edit', :action => 'edit', :id => @video_genre %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/video_media/_form.rhtml b/app/views/video_media/_form.rhtml
new file mode 100644 (file)
index 0000000..fe6cc56
--- /dev/null
@@ -0,0 +1,7 @@
+<%= error_messages_for 'video_media' %>
+
+<!--[form:video_media]-->
+<p><label for="video_media_name">Name</label><br/>
+<%= text_field 'video_media', 'name'  %></p>
+<!--[eoform:video_media]-->
+
diff --git a/app/views/video_media/edit.rhtml b/app/views/video_media/edit.rhtml
new file mode 100644 (file)
index 0000000..f7bb5d1
--- /dev/null
@@ -0,0 +1,9 @@
+<h1>Editing video_media</h1>
+
+<% form_tag :action => 'update', :id => @video_media do %>
+  <%= render :partial => 'form' %>
+  <%= submit_tag 'Edit' %>
+<% end %>
+
+<%= link_to 'Show', :action => 'show', :id => @video_media %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/video_media/list.rhtml b/app/views/video_media/list.rhtml
new file mode 100644 (file)
index 0000000..90ca633
--- /dev/null
@@ -0,0 +1,27 @@
+<h1>Listing video_medias</h1>
+
+<table>
+  <tr>
+  <% for column in VideoMedia.content_columns %>
+    <th><%= column.human_name %></th>
+  <% end %>
+  </tr>
+  
+<% for video_media in @video_medias %>
+  <tr>
+  <% for column in VideoMedia.content_columns %>
+    <td><%=h video_media.send(column.name) %></td>
+  <% end %>
+    <td><%= link_to 'Show', :action => 'show', :id => video_media %></td>
+    <td><%= link_to 'Edit', :action => 'edit', :id => video_media %></td>
+    <td><%= link_to 'Destroy', { :action => 'destroy', :id => video_media }, :confirm => 'Are you sure?', :method => :post %></td>
+  </tr>
+<% end %>
+</table>
+
+<%= link_to 'Previous page', { :page => @video_media_pages.current.previous } if @video_media_pages.current.previous %>
+<%= link_to 'Next page', { :page => @video_media_pages.current.next } if @video_media_pages.current.next %> 
+
+<br />
+
+<%= link_to 'New video_media', :action => 'new' %>
similarity index 86%
rename from app/views/gamegenre/new.rhtml
rename to app/views/video_media/new.rhtml
index 98a943f..8df951f 100644 (file)
@@ -1,4 +1,4 @@
-<h1>New gamegenre</h1>
+<h1>New video_media</h1>
 
 <% form_tag :action => 'create' do %>
   <%= render :partial => 'form' %>
diff --git a/app/views/video_media/show.rhtml b/app/views/video_media/show.rhtml
new file mode 100644 (file)
index 0000000..05d3c2b
--- /dev/null
@@ -0,0 +1,8 @@
+<% for column in VideoMedia.content_columns %>
+<p>
+  <b><%= column.human_name %>:</b> <%=h @video_media.send(column.name) %>
+</p>
+<% end %>
+
+<%= link_to 'Edit', :action => 'edit', :id => @video_media %> |
+<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/videogenre/_form.rhtml b/app/views/videogenre/_form.rhtml
deleted file mode 100644 (file)
index 4082225..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<%= error_messages_for 'videogenre' %>
-
-<!--[form:videogenre]-->
-<p><label for="videogenre_name">Name</label><br/>
-<%= text_field 'videogenre', 'name'  %></p>
-<!--[eoform:videogenre]-->
-
diff --git a/app/views/videogenre/edit.rhtml b/app/views/videogenre/edit.rhtml
deleted file mode 100644 (file)
index b281524..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-<h1>Editing videogenre</h1>
-
-<% form_tag :action => 'update', :id => @videogenre do %>
-  <%= render :partial => 'form' %>
-  <%= submit_tag 'Edit' %>
-<% end %>
-
-<%= link_to 'Show', :action => 'show', :id => @videogenre %> |
-<%= link_to 'Back', :action => 'list' %>
diff --git a/app/views/videogenre/list.rhtml b/app/views/videogenre/list.rhtml
deleted file mode 100644 (file)
index 1ef4849..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<h1>Listing videogenres</h1>
-
-<table>
-  <tr>
-  <% for column in Videogenre.content_columns %>
-    <th><%= column.human_name %></th>
-  <% end %>
-  </tr>
-  
-<% for videogenre in @videogenres %>
-  <tr>
-  <% for column in Videogenre.content_columns %>
-    <td><%=h videogenre.send(column.name) %></td>
-  <% end %>
-    <td><%= link_to 'Show', :action => 'show', :id => videogenre %></td>
-    <td><%= link_to 'Edit', :action => 'edit', :id => videogenre %></td>
-    <td><%= link_to 'Destroy', { :action => 'destroy', :id => videogenre }, :confirm => 'Are you sure?', :method => :post %></td>
-  </tr>
-<% end %>
-</table>
-
-<%= link_to 'Previous page', { :page => @videogenre_pages.current.previous } if @videogenre_pages.current.previous %>
-<%= link_to 'Next page', { :page => @videogenre_pages.current.next } if @videogenre_pages.current.next %> 
-
-<br />
-
-<%= link_to 'New videogenre', :action => 'new' %>
diff --git a/app/views/videogenre/show.rhtml b/app/views/videogenre/show.rhtml
deleted file mode 100644 (file)
index 9df8b32..0000000
+++ /dev/null
@@ -1,8 +0,0 @@
-<% for column in Videogenre.content_columns %>
-<p>
-  <b><%= column.human_name %>:</b> <%=h @videogenre.send(column.name) %>
-</p>
-<% end %>
-
-<%= link_to 'Edit', :action => 'edit', :id => @videogenre %> |
-<%= link_to 'Back', :action => 'list' %>
index 332cbaf..9fcfb99 100644 (file)
Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ
diff --git a/db/migrate/028_create_video_genres.rb b/db/migrate/028_create_video_genres.rb
new file mode 100644 (file)
index 0000000..ba80f5f
--- /dev/null
@@ -0,0 +1,11 @@
+class CreateVideoGenres < ActiveRecord::Migration
+  def self.up
+    create_table :video_genres do |t|
+      t.column :name, :string, :null => false
+    end
+  end
+
+  def self.down
+    drop_table :video_genres
+  end
+end
diff --git a/db/migrate/029_create_video_medias.rb b/db/migrate/029_create_video_medias.rb
new file mode 100644 (file)
index 0000000..6ed0b50
--- /dev/null
@@ -0,0 +1,11 @@
+class CreateVideoMedias < ActiveRecord::Migration
+  def self.up
+    create_table :video_medias do |t|
+      t.column :name, :string, :null => false
+    end
+  end
+
+  def self.down
+    drop_table :video_medias
+  end
+end
diff --git a/db/migrate/030_create_game_genres.rb b/db/migrate/030_create_game_genres.rb
new file mode 100644 (file)
index 0000000..b50f4f2
--- /dev/null
@@ -0,0 +1,11 @@
+class CreateGameGenres < ActiveRecord::Migration
+  def self.up
+    create_table :game_genres do |t|
+      t.column :name, :string, :null => false
+    end
+  end
+
+  def self.down
+    drop_table :game_genres
+  end
+end
diff --git a/db/migrate/031_create_game_platforms.rb b/db/migrate/031_create_game_platforms.rb
new file mode 100644 (file)
index 0000000..e854637
--- /dev/null
@@ -0,0 +1,11 @@
+class CreateGamePlatforms < ActiveRecord::Migration
+  def self.up
+    create_table :game_platforms do |t|
+      t.column :name, :string, :null => false
+    end
+  end
+
+  def self.down
+    drop_table :game_platforms
+  end
+end
diff --git a/db/migrate/032_fix_rentables.rb b/db/migrate/032_fix_rentables.rb
new file mode 100644 (file)
index 0000000..b0e45ed
--- /dev/null
@@ -0,0 +1,12 @@
+class FixRentables < ActiveRecord::Migration
+  def self.up
+    drop_table :gamegenres
+    drop_table :medias
+    drop_table :gameplatforms
+    drop_table :videogenres
+  end
+
+  def self.down
+    raise ActiveRecord::IrreversibleMigration
+  end
+end
index f9d22a0..45c829e 100644 (file)
@@ -2,7 +2,7 @@
 # migrations feature of ActiveRecord to incrementally modify your database, and
 # then regenerate this schema definition.
 
-ActiveRecord::Schema.define(:version => 27) do
+ActiveRecord::Schema.define(:version => 32) do
 
   create_table "coitems", :force => true do |t|
     t.column "customer_id", :integer
@@ -19,23 +19,19 @@ ActiveRecord::Schema.define(:version => 27) do
     t.column "debt",    :decimal,                :default => 0.0
   end
 
-  create_table "game_policies", :force => true do |t|
-    t.column "day",         :integer,                               :null => false
-    t.column "fee",         :decimal, :precision => 8, :scale => 2, :null => false
-    t.column "period",      :integer
-    t.column "description", :string
-  end
-
-  create_table "gamegenres", :force => true do |t|
+  create_table "game_genres", :force => true do |t|
     t.column "name", :string, :null => false
   end
 
-  create_table "gameplatforms", :force => true do |t|
+  create_table "game_platforms", :force => true do |t|
     t.column "name", :string, :null => false
   end
 
-  create_table "medias", :force => true do |t|
-    t.column "name", :string, :null => false
+  create_table "game_policies", :force => true do |t|
+    t.column "day",         :integer,                               :null => false
+    t.column "fee",         :decimal, :precision => 8, :scale => 2, :null => false
+    t.column "period",      :integer
+    t.column "description", :string
   end
 
   create_table "merchandise_purchases", :force => true do |t|
@@ -64,14 +60,14 @@ ActiveRecord::Schema.define(:version => 27) do
   end
 
   create_table "rentables", :force => true do |t|
-    t.column "type",        :string
-    t.column "title",       :string
-    t.column "newrelease",  :boolean, :default => false
-    t.column "video_genre", :integer
-    t.column "director",    :string
-    t.column "media",       :integer
-    t.column "game_genre",  :integer
-    t.column "platform",    :integer
+    t.column "type",             :string
+    t.column "title",            :string
+    t.column "newrelease",       :boolean
+    t.column "video_genre_id",   :integer
+    t.column "director",         :string
+    t.column "video_media_id",   :integer
+    t.column "game_genre_id",    :integer
+    t.column "game_platform_id", :integer
   end
 
 # Could not dump table "sqlite_sequence" because of following StandardError
@@ -84,6 +80,14 @@ ActiveRecord::Schema.define(:version => 27) do
     t.column "manager",         :boolean, :default => false
   end
 
+  create_table "video_genres", :force => true do |t|
+    t.column "name", :string, :null => false
+  end
+
+  create_table "video_medias", :force => true do |t|
+    t.column "name", :string, :null => false
+  end
+
   create_table "video_policies", :force => true do |t|
     t.column "day",         :integer,                               :null => false
     t.column "fee",         :decimal, :precision => 8, :scale => 2, :null => false
@@ -91,8 +95,4 @@ ActiveRecord::Schema.define(:version => 27) do
     t.column "description", :string
   end
 
-  create_table "videogenres", :force => true do |t|
-    t.column "name", :string, :null => false
-  end
-
 end
similarity index 63%
rename from test/functional/gamegenre_controller_test.rb
rename to test/functional/game_genre_controller_test.rb
index aa660e6..88138c1 100644 (file)
@@ -1,18 +1,18 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'gamegenre_controller'
+require 'game_genre_controller'
 
 # Re-raise errors caught by the controller.
-class GamegenreController; def rescue_action(e) raise e end; end
+class GameGenreController; def rescue_action(e) raise e end; end
 
-class GamegenreControllerTest < Test::Unit::TestCase
-  fixtures :gamegenres
+class GameGenreControllerTest < Test::Unit::TestCase
+  fixtures :game_genres
 
   def setup
-    @controller = GamegenreController.new
+    @controller = GameGenreController.new
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = gamegenres(:first).id
+    @first_id = game_genres(:first).id
   end
 
   def test_index
@@ -27,7 +27,7 @@ class GamegenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'list'
 
-    assert_not_nil assigns(:gamegenres)
+    assert_not_nil assigns(:game_genres)
   end
 
   def test_show
@@ -36,8 +36,8 @@ class GamegenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'show'
 
-    assert_not_nil assigns(:gamegenre)
-    assert assigns(:gamegenre).valid?
+    assert_not_nil assigns(:game_genre)
+    assert assigns(:game_genre).valid?
   end
 
   def test_new
@@ -46,18 +46,18 @@ class GamegenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'new'
 
-    assert_not_nil assigns(:gamegenre)
+    assert_not_nil assigns(:game_genre)
   end
 
   def test_create
-    num_gamegenres = Gamegenre.count
+    num_game_genres = GameGenre.count
 
-    post :create, :gamegenre => {}
+    post :create, :game_genre => {}
 
     assert_response :redirect
     assert_redirected_to :action => 'list'
 
-    assert_equal num_gamegenres + 1, Gamegenre.count
+    assert_equal num_game_genres + 1, GameGenre.count
   end
 
   def test_edit
@@ -66,8 +66,8 @@ class GamegenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'edit'
 
-    assert_not_nil assigns(:gamegenre)
-    assert assigns(:gamegenre).valid?
+    assert_not_nil assigns(:game_genre)
+    assert assigns(:game_genre).valid?
   end
 
   def test_update
@@ -78,7 +78,7 @@ class GamegenreControllerTest < Test::Unit::TestCase
 
   def test_destroy
     assert_nothing_raised {
-      Gamegenre.find(@first_id)
+      GameGenre.find(@first_id)
     }
 
     post :destroy, :id => @first_id
@@ -86,7 +86,7 @@ class GamegenreControllerTest < Test::Unit::TestCase
     assert_redirected_to :action => 'list'
 
     assert_raise(ActiveRecord::RecordNotFound) {
-      Gamegenre.find(@first_id)
+      GameGenre.find(@first_id)
     }
   end
 end
@@ -1,18 +1,18 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'gameplatform_controller'
+require 'game_platform_controller'
 
 # Re-raise errors caught by the controller.
-class GameplatformController; def rescue_action(e) raise e end; end
+class GamePlatformController; def rescue_action(e) raise e end; end
 
-class GameplatformControllerTest < Test::Unit::TestCase
-  fixtures :gameplatforms
+class GamePlatformControllerTest < Test::Unit::TestCase
+  fixtures :game_platforms
 
   def setup
-    @controller = GameplatformController.new
+    @controller = GamePlatformController.new
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = gameplatforms(:first).id
+    @first_id = game_platforms(:first).id
   end
 
   def test_index
@@ -27,7 +27,7 @@ class GameplatformControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'list'
 
-    assert_not_nil assigns(:gameplatforms)
+    assert_not_nil assigns(:game_platforms)
   end
 
   def test_show
@@ -36,8 +36,8 @@ class GameplatformControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'show'
 
-    assert_not_nil assigns(:gameplatform)
-    assert assigns(:gameplatform).valid?
+    assert_not_nil assigns(:game_platform)
+    assert assigns(:game_platform).valid?
   end
 
   def test_new
@@ -46,18 +46,18 @@ class GameplatformControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'new'
 
-    assert_not_nil assigns(:gameplatform)
+    assert_not_nil assigns(:game_platform)
   end
 
   def test_create
-    num_gameplatforms = Gameplatform.count
+    num_game_platforms = GamePlatform.count
 
-    post :create, :gameplatform => {}
+    post :create, :game_platform => {}
 
     assert_response :redirect
     assert_redirected_to :action => 'list'
 
-    assert_equal num_gameplatforms + 1, Gameplatform.count
+    assert_equal num_game_platforms + 1, GamePlatform.count
   end
 
   def test_edit
@@ -66,8 +66,8 @@ class GameplatformControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'edit'
 
-    assert_not_nil assigns(:gameplatform)
-    assert assigns(:gameplatform).valid?
+    assert_not_nil assigns(:game_platform)
+    assert assigns(:game_platform).valid?
   end
 
   def test_update
@@ -78,7 +78,7 @@ class GameplatformControllerTest < Test::Unit::TestCase
 
   def test_destroy
     assert_nothing_raised {
-      Gameplatform.find(@first_id)
+      GamePlatform.find(@first_id)
     }
 
     post :destroy, :id => @first_id
@@ -86,7 +86,7 @@ class GameplatformControllerTest < Test::Unit::TestCase
     assert_redirected_to :action => 'list'
 
     assert_raise(ActiveRecord::RecordNotFound) {
-      Gameplatform.find(@first_id)
+      GamePlatform.find(@first_id)
     }
   end
 end
@@ -1,18 +1,18 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'videogenre_controller'
+require 'video_genre_controller'
 
 # Re-raise errors caught by the controller.
-class VideogenreController; def rescue_action(e) raise e end; end
+class VideoGenreController; def rescue_action(e) raise e end; end
 
-class VideogenreControllerTest < Test::Unit::TestCase
-  fixtures :videogenres
+class VideoGenreControllerTest < Test::Unit::TestCase
+  fixtures :video_genres
 
   def setup
-    @controller = VideogenreController.new
+    @controller = VideoGenreController.new
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = videogenres(:first).id
+    @first_id = video_genres(:first).id
   end
 
   def test_index
@@ -27,7 +27,7 @@ class VideogenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'list'
 
-    assert_not_nil assigns(:videogenres)
+    assert_not_nil assigns(:video_genres)
   end
 
   def test_show
@@ -36,8 +36,8 @@ class VideogenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'show'
 
-    assert_not_nil assigns(:videogenre)
-    assert assigns(:videogenre).valid?
+    assert_not_nil assigns(:video_genre)
+    assert assigns(:video_genre).valid?
   end
 
   def test_new
@@ -46,18 +46,18 @@ class VideogenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'new'
 
-    assert_not_nil assigns(:videogenre)
+    assert_not_nil assigns(:video_genre)
   end
 
   def test_create
-    num_videogenres = Videogenre.count
+    num_video_genres = VideoGenre.count
 
-    post :create, :videogenre => {}
+    post :create, :video_genre => {}
 
     assert_response :redirect
     assert_redirected_to :action => 'list'
 
-    assert_equal num_videogenres + 1, Videogenre.count
+    assert_equal num_video_genres + 1, VideoGenre.count
   end
 
   def test_edit
@@ -66,8 +66,8 @@ class VideogenreControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'edit'
 
-    assert_not_nil assigns(:videogenre)
-    assert assigns(:videogenre).valid?
+    assert_not_nil assigns(:video_genre)
+    assert assigns(:video_genre).valid?
   end
 
   def test_update
@@ -78,7 +78,7 @@ class VideogenreControllerTest < Test::Unit::TestCase
 
   def test_destroy
     assert_nothing_raised {
-      Videogenre.find(@first_id)
+      VideoGenre.find(@first_id)
     }
 
     post :destroy, :id => @first_id
@@ -86,7 +86,7 @@ class VideogenreControllerTest < Test::Unit::TestCase
     assert_redirected_to :action => 'list'
 
     assert_raise(ActiveRecord::RecordNotFound) {
-      Videogenre.find(@first_id)
+      VideoGenre.find(@first_id)
     }
   end
 end
similarity index 63%
rename from test/functional/media_controller_test.rb
rename to test/functional/video_media_controller_test.rb
index b2824ad..fbec6fc 100644 (file)
@@ -1,18 +1,18 @@
 require File.dirname(__FILE__) + '/../test_helper'
-require 'media_controller'
+require 'video_media_controller'
 
 # Re-raise errors caught by the controller.
-class MediaController; def rescue_action(e) raise e end; end
+class VideoMediaController; def rescue_action(e) raise e end; end
 
-class MediaControllerTest < Test::Unit::TestCase
-  fixtures :medias
+class VideoMediaControllerTest < Test::Unit::TestCase
+  fixtures :video_medias
 
   def setup
-    @controller = MediaController.new
+    @controller = VideoMediaController.new
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = medias(:first).id
+    @first_id = video_medias(:first).id
   end
 
   def test_index
@@ -27,7 +27,7 @@ class MediaControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'list'
 
-    assert_not_nil assigns(:medias)
+    assert_not_nil assigns(:video_medias)
   end
 
   def test_show
@@ -36,8 +36,8 @@ class MediaControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'show'
 
-    assert_not_nil assigns(:media)
-    assert assigns(:media).valid?
+    assert_not_nil assigns(:video_media)
+    assert assigns(:video_media).valid?
   end
 
   def test_new
@@ -46,18 +46,18 @@ class MediaControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'new'
 
-    assert_not_nil assigns(:media)
+    assert_not_nil assigns(:video_media)
   end
 
   def test_create
-    num_medias = Media.count
+    num_video_medias = VideoMedia.count
 
-    post :create, :media => {}
+    post :create, :video_media => {}
 
     assert_response :redirect
     assert_redirected_to :action => 'list'
 
-    assert_equal num_medias + 1, Media.count
+    assert_equal num_video_medias + 1, VideoMedia.count
   end
 
   def test_edit
@@ -66,8 +66,8 @@ class MediaControllerTest < Test::Unit::TestCase
     assert_response :success
     assert_template 'edit'
 
-    assert_not_nil assigns(:media)
-    assert assigns(:media).valid?
+    assert_not_nil assigns(:video_media)
+    assert assigns(:video_media).valid?
   end
 
   def test_update
@@ -78,7 +78,7 @@ class MediaControllerTest < Test::Unit::TestCase
 
   def test_destroy
     assert_nothing_raised {
-      Media.find(@first_id)
+      VideoMedia.find(@first_id)
     }
 
     post :destroy, :id => @first_id
@@ -86,7 +86,7 @@ class MediaControllerTest < Test::Unit::TestCase
     assert_redirected_to :action => 'list'
 
     assert_raise(ActiveRecord::RecordNotFound) {
-      Media.find(@first_id)
+      VideoMedia.find(@first_id)
     }
   end
 end
similarity index 66%
rename from test/unit/gamegenre_test.rb
rename to test/unit/game_genre_test.rb
index 1a72d2c..f47f4e4 100644 (file)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class GamegenreTest < Test::Unit::TestCase
-  fixtures :gamegenres
+class GameGenreTest < Test::Unit::TestCase
+  fixtures :game_genres
 
   # Replace this with your real tests.
   def test_truth
similarity index 64%
rename from test/unit/gameplatform_test.rb
rename to test/unit/game_platform_test.rb
index a796e92..97108b2 100644 (file)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class GameplatformTest < Test::Unit::TestCase
-  fixtures :gameplatforms
+class GamePlatformTest < Test::Unit::TestCase
+  fixtures :game_platforms
 
   # Replace this with your real tests.
   def test_truth
similarity index 66%
rename from test/unit/media_test.rb
rename to test/unit/video_genre_test.rb
index 3883727..a7e3f8d 100644 (file)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class MediaTest < Test::Unit::TestCase
-  fixtures :medias
+class VideoGenreTest < Test::Unit::TestCase
+  fixtures :video_genres
 
   # Replace this with your real tests.
   def test_truth
similarity index 66%
rename from test/unit/videogenre_test.rb
rename to test/unit/video_media_test.rb
index 5290195..346f66f 100644 (file)
@@ -1,7 +1,7 @@
 require File.dirname(__FILE__) + '/../test_helper'
 
-class VideogenreTest < Test::Unit::TestCase
-  fixtures :videogenres
+class VideoMediaTest < Test::Unit::TestCase
+  fixtures :video_medias
 
   # Replace this with your real tests.
   def test_truth