Skip to content
This repository has been archived by the owner on May 5, 2018. It is now read-only.

Commit

Permalink
renamed a column
Browse files Browse the repository at this point in the history
  • Loading branch information
florida committed Nov 14, 2012
1 parent 8d3d9b8 commit 741945d
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/views/admin/products/_form.html.erb
Expand Up @@ -32,8 +32,8 @@
<%= f.text_field :image_url %>
</section>
<section class="field">
<%= f.label :availability %>
<%= f.check_box :availability %>
<%= f.label :available %>
<%= f.check_box :available %>
</section>
<section class="actions">
<%= f.submit %>
Expand Down
@@ -0,0 +1,9 @@
class RenameColumnAvailabilityToAvailableInProducts < ActiveRecord::Migration
def up
rename_column :products, :availability, :available
end

def down
rename_column :products, :available, :availability
end
end
8 changes: 4 additions & 4 deletions db/schema.rb
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20121114042640) do
ActiveRecord::Schema.define(:version => 20121114043900) do

create_table "lineitems", :force => true do |t|
t.integer "product_id"
Expand Down Expand Up @@ -40,10 +40,10 @@
t.text "description"
t.float "price"
t.integer "stock_no"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "image_url"
t.boolean "availability"
t.boolean "available"
end

create_table "users", :force => true do |t|
Expand Down

0 comments on commit 741945d

Please sign in to comment.