OSDN Git Service

added arc.locked
authornomeu <nomeu@nomeu.org>
Sun, 20 Jun 2010 01:36:11 +0000 (10:36 +0900)
committernomeu <nomeu@nomeu.org>
Sun, 20 Jun 2010 01:36:11 +0000 (10:36 +0900)
app/views/arcs/index.html.erb
app/views/arcs/show.html.erb
app/views/welcome/index.html.erb
db/migrate/20100620012643_add_locked_to_arc.rb [new file with mode: 0644]
db/schema.rb

index f154f14..57e0a3e 100644 (file)
@@ -14,6 +14,7 @@
     <th><%= _'Arc|Code' %></th>
     <th><%= _'Arc|Extname' %></th>
     <th><%= _'Arc|Location' %></th>
+    <th><%= _'Arc|Locked' %></th>
     <th><%= _'Arc|Summary' %></th>
     <th><%= _'Arc|Origname' %></th>
   </tr>
@@ -25,6 +26,7 @@
     <td><%=link_to h(arc.code), arc %></td>
     <td><%=h arc.extname %></td>
     <td><%=h arc.location.code %></td>
+    <td><%=h(arc.locked? ? 'yes' : 'no') %></td>
     <td><%=h arc.summary %></td>
     <td><%=h arc.origname %></td>
   </tr>
index 9f8e717..4856635 100644 (file)
 </p>
 
 <p>
+  <b><%= _'Arc|Locked' %>:</b>
+  <%=h(@arc.locked? ? 'yes' : 'no') %>
+</p>
+
+<p>
   <b><%= _'Arc|Summary' %>:</b>
   <%=h @arc.summary %>
 </p>
index d7cbf4e..726027d 100644 (file)
@@ -17,6 +17,7 @@
     <th><%= _'Arc|Code' %></th>
     <th><%= _'Arc|Extname' %></th>
     <th><%= _'Arc|Location' %></th>
+    <th><%= _'Arc|Locked' %></th>
     <th><%= _'Arc|Summary' %></th>
     <th><%= _'Arc|Origname' %></th>
   </tr>
@@ -28,6 +29,7 @@
     <td><%=link_to h(arc.code), arc %></td>
     <td><%=h arc.extname %></td>
     <td><%=h arc.location.code %></td>
+    <td><%=h(arc.locked? ? 'yes' : 'no') %></td>
     <td><%=h arc.summary %></td>
     <td><%=h arc.origname %></td>
   </tr>
diff --git a/db/migrate/20100620012643_add_locked_to_arc.rb b/db/migrate/20100620012643_add_locked_to_arc.rb
new file mode 100644 (file)
index 0000000..af31146
--- /dev/null
@@ -0,0 +1,9 @@
+class AddLockedToArc < ActiveRecord::Migration
+  def self.up
+    add_column :arcs, :locked, :boolean, :default => false, :null => false
+  end
+
+  def self.down
+    remove_column :arcs, :locked
+  end
+end
index bfb1ce5..b669a14 100644 (file)
@@ -9,7 +9,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20100614140952) do
+ActiveRecord::Schema.define(:version => 20100620012643) do
 
   create_table "arc_thumbs", :force => true do |t|
     t.integer  "arc_id"
@@ -21,13 +21,14 @@ ActiveRecord::Schema.define(:version => 20100614140952) do
   add_index "arc_thumbs", ["arc_id", "thumb_id"], :name => "index_arc_thumbs_on_arc_id_and_thumb_id", :unique => true
 
   create_table "arcs", :force => true do |t|
-    t.string   "code",        :limit => 10, :null => false
-    t.string   "extname",     :limit => 10, :null => false
+    t.string   "code",        :limit => 10,                    :null => false
+    t.string   "extname",     :limit => 10,                    :null => false
     t.integer  "location_id"
     t.string   "summary"
     t.string   "origname"
     t.datetime "created_at"
     t.datetime "updated_at"
+    t.boolean  "locked",                    :default => false, :null => false
   end
 
   create_table "locations", :force => true do |t|