OSDN Git Service

renamed Thumb to Record::Thumb
authornomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 01:40:27 +0000 (10:40 +0900)
committernomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 01:40:27 +0000 (10:40 +0900)
app/controllers/thumbs_controller.rb
app/models/arc_thumb.rb
app/models/record/thumb.rb [moved from app/models/thumb.rb with 94% similarity]
app/views/arcs/show.html.erb
app/views/thumbs/index.html.erb

index e968c31..67e61f2 100644 (file)
@@ -6,8 +6,8 @@ class ThumbsController < ApplicationController
   # GET /thumbs
   # GET /thumbs.xml
   def index
-    @search = Thumb::Search.new(params[:search])
-    @thumbs = Thumb.paginate(@search.find_options.merge(:page => params[:page]))
+    @search = Record::Thumb::Search.new(params[:search])
+    @thumbs = Record::Thumb.paginate(@search.find_options.merge(:page => params[:page]))
 
     respond_to do |format|
       format.html # index.html.erb
@@ -18,7 +18,7 @@ class ThumbsController < ApplicationController
   # GET /thumbs/1
   # GET /thumbs/1.xml
   def show
-    @thumb = Thumb.find(params[:id])
+    @thumb = Record::Thumb.find(params[:id])
 
     respond_to do |format|
       format.html # show.html.erb
@@ -29,7 +29,7 @@ class ThumbsController < ApplicationController
   # GET /thumbs/new
   # GET /thumbs/new.xml
   def new
-    @thumb = Thumb.new
+    @thumb = Record::Thumb.new
 
     respond_to do |format|
       format.html # new.html.erb
@@ -39,18 +39,18 @@ class ThumbsController < ApplicationController
 
   # GET /thumbs/1/edit
   def edit
-    @thumb = Thumb.find(params[:id])
+    @thumb = Record::Thumb.find(params[:id])
   end
 
   # POST /thumbs
   # POST /thumbs.xml
   def create
-    @thumb = Thumb.new(params[:thumb])
+    @thumb = Record::Thumb.new(params[:thumb])
     @thumb.video_id = params[:thumb].delete(:video_id)
 
     respond_to do |format|
       if @thumb.save
-        flash[:notice] = 'Thumb was successfully created.'
+        flash[:notice] = 'Record::Thumb was successfully created.'
         format.html { redirect_to(@thumb) }
         format.xml  { render :xml => @thumb, :status => :created, :location => @thumb }
       else
@@ -63,11 +63,11 @@ class ThumbsController < ApplicationController
   # PUT /thumbs/1
   # PUT /thumbs/1.xml
   def update
-    @thumb = Thumb.find(params[:id])
+    @thumb = Record::Thumb.find(params[:id])
 
     respond_to do |format|
       if @thumb.update_attributes(params[:thumb])
-        flash[:notice] = 'Thumb was successfully updated.'
+        flash[:notice] = 'Record::Thumb was successfully updated.'
         format.html { redirect_to(@thumb) }
         format.xml  { head :ok }
       else
@@ -80,7 +80,7 @@ class ThumbsController < ApplicationController
   # DELETE /thumbs/1
   # DELETE /thumbs/1.xml
   def destroy
-    @thumb = Thumb.find(params[:id])
+    @thumb = Record::Thumb.find(params[:id])
     @thumb.destroy
 
     respond_to do |format|
index 308385c..6c16191 100644 (file)
@@ -1,4 +1,4 @@
 class ArcThumb < ActiveRecord::Base
   belongs_to :arc
-  belongs_to :thumb
+  belongs_to :thumb, :class_name => 'Record::Thumb'
 end
similarity index 94%
rename from app/models/thumb.rb
rename to app/models/record/thumb.rb
index f9419f7..e460363 100644 (file)
@@ -1,4 +1,4 @@
-class Thumb < ActiveRecord::Base
+class Record::Thumb < ActiveRecord::Base
   set_primary_key :video_id
   has_many :arc_thumbs
   has_many :arcs, :through => :arc_thumbs
index fc86cef..4e8252c 100644 (file)
@@ -49,7 +49,7 @@
   <tbody>
 <% @arc.thumbs.each do |thumb| %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to thumb.video_id, thumb %></td>
+    <td><%=link_to thumb.video_id, thumb_path(thumb) %></td>
     <td><%= thumb.title %></td>
     <td><%= truncate(thumb.description) %></td>
   </tr>
index f275445..51e827f 100644 (file)
@@ -20,7 +20,7 @@
   <tbody>
 <% @thumbs.each do |thumb| %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to thumb.video_id, thumb %></td>
+    <td><%=link_to thumb.video_id, thumb_path(thumb) %></td>
     <td><%= thumb.title %></td>
     <td><%= truncate(thumb.description) %></td>
   </tr>