OSDN Git Service

renamed Arc to Record::Arc
authornomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 01:56:41 +0000 (10:56 +0900)
committernomeu <nomeu@users.sourceforge.jp>
Thu, 7 Jul 2011 01:56:41 +0000 (10:56 +0900)
13 files changed:
app/controllers/arcs_controller.rb
app/controllers/welcome_controller.rb
app/models/arc_thumb.rb
app/models/pmd.rb
app/models/record/arc.rb [moved from app/models/arc.rb with 98% similarity]
app/models/vmd.rb
app/models/x.rb
app/views/arcs/index.html.erb
app/views/pmds/index.html.erb
app/views/thumbs/show.html.erb
app/views/vmds/index.html.erb
app/views/welcome/index.html.erb
app/views/xes/index.html.erb

index 5c2d2b2..3d9f843 100644 (file)
@@ -6,8 +6,8 @@ class ArcsController < ApplicationController
   # GET /arcs
   # GET /arcs.xml
   def index
-    @search = Arc::Search.new(params[:search])
-    @arcs = Arc.paginate(@search.find_options.merge(:page => params[:page], :order => 'location_id, code', :include => :location))
+    @search = Record::Arc::Search.new(params[:search])
+    @arcs = Record::Arc.paginate(@search.find_options.merge(:page => params[:page], :order => 'location_id, code', :include => :location))
 
     respond_to do |format|
       format.html # index.html.erb
@@ -18,7 +18,7 @@ class ArcsController < ApplicationController
   # GET /arcs/1
   # GET /arcs/1.xml
   def show
-    @arc = Arc.find(params[:id])
+    @arc = Record::Arc.find(params[:id])
 
     respond_to do |format|
       format.html # show.html.erb
@@ -29,7 +29,7 @@ class ArcsController < ApplicationController
   # GET /arcs/new
   # GET /arcs/new.xml
   def new
-    @arc = Arc.new
+    @arc = Record::Arc.new
 
     respond_to do |format|
       format.html # new.html.erb
@@ -39,17 +39,17 @@ class ArcsController < ApplicationController
 
   # GET /arcs/1/edit
   def edit
-    @arc = Arc.find(params[:id])
+    @arc = Record::Arc.find(params[:id])
   end
 
   # POST /arcs
   # POST /arcs.xml
   def create
-    @arc = Arc.new(params[:arc])
+    @arc = Record::Arc.new(params[:arc])
 
     respond_to do |format|
       if @arc.save
-        flash[:notice] = 'Arc was successfully created.'
+        flash[:notice] = 'Record::Arc was successfully created.'
         format.html { redirect_to(@arc) }
         format.xml  { render :xml => @arc, :status => :created, :location => @arc }
       else
@@ -62,11 +62,11 @@ class ArcsController < ApplicationController
   # PUT /arcs/1
   # PUT /arcs/1.xml
   def update
-    @arc = Arc.find(params[:id])
+    @arc = Record::Arc.find(params[:id])
 
     respond_to do |format|
       if @arc.update_attributes(params[:arc])
-        flash[:notice] = 'Arc was successfully updated.'
+        flash[:notice] = 'Record::Arc was successfully updated.'
         format.html { redirect_to(@arc) }
         format.xml  { head :ok }
       else
@@ -79,7 +79,7 @@ class ArcsController < ApplicationController
   # DELETE /arcs/1
   # DELETE /arcs/1.xml
   def destroy
-    @arc = Arc.find(params[:id])
+    @arc = Record::Arc.find(params[:id])
     @arc.destroy
 
     respond_to do |format|
index 1e2333a..0a34543 100644 (file)
@@ -6,14 +6,14 @@ class WelcomeController < ApplicationController
     @search = Welcome::Search.new(params[:search])
     if @search.text.blank?
       time = 3.day.ago
-      @arcs = Arc.paginate(:conditions => ["arcs.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :include => :location)
+      @arcs = Record::Arc.paginate(:conditions => ["arcs.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :include => :location)
       @pmds = Pmd.paginate(:conditions => ["pmds.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
       @vmds = Vmd.paginate(:conditions => ["vmds.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
       @xes = X.paginate(:conditions => ["xes.updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15, :include => { :arc => :location })
-      @thumbs = Thumb.paginate(:conditions => ["updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15)
+      @thumbs = Record::Thumb.paginate(:conditions => ["updated_at > ?", time], :order => 'updated_at desc', :page => nil, :per_page => 15)
     else
-      @arc_search = Arc::Search.new(params[:search])
-      @arcs = Arc.paginate(@arc_search.find_options.merge(:page => nil, :order => 'location_id, code', :per_page => 15, :include => :location))
+      @arc_search = Record::Arc::Search.new(params[:search])
+      @arcs = Record::Arc.paginate(@arc_search.find_options.merge(:page => nil, :order => 'location_id, code', :per_page => 15, :include => :location))
       @pmd_search = Pmd::Search.new(params[:search])
       @pmds = Pmd.paginate(@pmd_search.find_options.merge(:page => nil, :per_page => 15, :include => { :arc => :location }))
       @vmd_search = Vmd::Search.new(params[:search])
index 6c16191..2fee9a9 100644 (file)
@@ -1,4 +1,4 @@
 class ArcThumb < ActiveRecord::Base
-  belongs_to :arc
+  belongs_to :arc, :class_name => 'Record::Arc'
   belongs_to :thumb, :class_name => 'Record::Thumb'
 end
index a11c7b1..ea3f615 100644 (file)
@@ -1,5 +1,5 @@
 class Pmd < ActiveRecord::Base
-  belongs_to :arc
+  belongs_to :arc, :class_name => 'Record::Arc'
 
   class Search
     attr_accessor :path
similarity index 98%
rename from app/models/arc.rb
rename to app/models/record/arc.rb
index 63acf22..abb6c47 100644 (file)
@@ -1,4 +1,4 @@
-class Arc < ActiveRecord::Base
+class Record::Arc < ActiveRecord::Base
   belongs_to :location, :class_name => 'Record::Location'
   has_many :pmds
   has_many :vmds
index 3f5e29c..4de30ef 100644 (file)
@@ -1,5 +1,5 @@
 class Vmd < ActiveRecord::Base
-  belongs_to :arc
+  belongs_to :arc, :class_name => 'Record::Arc'
 
   class Search
     attr_accessor :path
index 2885f9d..3f46280 100644 (file)
@@ -1,5 +1,5 @@
 class X < ActiveRecord::Base
-  belongs_to :arc
+  belongs_to :arc, :class_name => 'Record::Arc'
 
   class Search
     attr_accessor :path
index ccc26ac..090f63f 100644 (file)
@@ -23,7 +23,7 @@
   <tbody>
 <% for arc in @arcs %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to arc.code, arc %></td>
+    <td><%=link_to arc.code, arc_path(arc) %></td>
     <td><%= arc.extname %></td>
     <td><%= arc.location.code %></td>
     <td><%= arc.locked? ? 'yes' : 'no' %></td>
index a5e5a71..78cc00e 100644 (file)
@@ -19,7 +19,7 @@
   <tbody>
 <% for pmd in @pmds %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%= pmd.arc ? link_to(pmd.arc.code, pmd.arc) : '(none)' %></td>
+    <td><%= pmd.arc ? link_to(pmd.arc.code, arc_path(pmd.arc)) : '(none)' %></td>
     <td><%= pmd.path %></td>
   </tr>
 <% end %>
index 3671b0b..dd5b3c6 100644 (file)
@@ -34,7 +34,7 @@
   <tbody>
 <% for arc in @thumb.arcs %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to arc.code, arc %></td>
+    <td><%=link_to arc.code, arc_path(arc) %></td>
     <td><%= arc.extname %></td>
     <td><%= arc.location.code %></td>
     <td><%= arc.locked? ? 'yes' : 'no' %></td>
index ecece29..5471b65 100644 (file)
@@ -19,7 +19,7 @@
   <tbody>
 <% for vmd in @vmds %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to vmd.arc.code, vmd.arc %></td>
+    <td><%=link_to vmd.arc.code, arc_path(vmd.arc) %></td>
     <td><%= vmd.path %></td>
   </tr>
 <% end %>
index ac3d227..27fccd0 100644 (file)
@@ -26,7 +26,7 @@
   <tbody>
 <% for arc in @arcs %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to arc.code, arc %></td>
+    <td><%=link_to arc.code, arc_path(arc) %></td>
     <td><%= arc.extname %></td>
     <td><%= arc.location.code %></td>
     <td><%= arc.locked? ? 'yes' : 'no' %></td>
@@ -59,7 +59,7 @@
   <tbody>
 <% for pmd in @pmds %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to pmd.arc.code, pmd.arc %></td>
+    <td><%=link_to pmd.arc.code, arc_path(pmd.arc) %></td>
     <td><%= pmd.arc.extname %></td>
     <td><%= pmd.arc.location.code %></td>
     <td><%= pmd.path %></td>
@@ -91,7 +91,7 @@
   <tbody>
 <% for vmd in @vmds %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to vmd.arc.code, vmd.arc %></td>
+    <td><%=link_to vmd.arc.code, arc_path(vmd.arc) %></td>
     <td><%= vmd.arc.extname %></td>
     <td><%= vmd.arc.location.code %></td>
     <td><%= vmd.path %></td>
   <tbody>
 <% for x in @xes %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to x.arc.code, x.arc %></td>
+    <td><%=link_to x.arc.code, arc_path(x.arc) %></td>
     <td><%= x.arc.extname %></td>
     <td><%= x.arc.location.code %></td>
     <td><%= x.path %></td>
   <tbody>
 <% for thumb in @thumbs %>
   <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 2b6289c..0b72ae1 100644 (file)
@@ -19,7 +19,7 @@
   <tbody>
 <% for x in @xes %>
   <tr class="<%= cycle('odd', 'even') %>">
-    <td><%=link_to x.arc.code, x.arc %></td>
+    <td><%=link_to x.arc.code, arc_path(x.arc) %></td>
     <td><%= x.path %></td>
   </tr>
 <% end %>