From: Ira W. Snyder Date: Thu, 22 Nov 2007 05:20:41 +0000 (-0800) Subject: Use a text field for the customers address X-Git-Tag: turned-in~74 X-Git-Url: https://irasnyder.com/gitweb/?a=commitdiff_plain;h=134e6957256c2331e73fbab9ea527cba040c684d;hp=3650c5f411112965a12718b75ccbedde3186fa15;p=cs356-p2-videostore.git Use a text field for the customers address This is probably a better decision than just using a string. I can break it into address pieces later, but that can wait. Signed-off-by: Ira W. Snyder --- diff --git a/app/views/customer/_form.rhtml b/app/views/customer/_form.rhtml index df2a4b0..3107334 100644 --- a/app/views/customer/_form.rhtml +++ b/app/views/customer/_form.rhtml @@ -5,7 +5,7 @@ <%= text_field 'customer', 'name' %>


-<%= text_field 'customer', 'address' %>

+<%= text_area 'customer', 'address' %>


<%= text_field 'customer', 'email' %>

diff --git a/db/development.sqlite3 b/db/development.sqlite3 index 1c7c325..72eb9b0 100644 Binary files a/db/development.sqlite3 and b/db/development.sqlite3 differ diff --git a/db/migrate/010_customers_text_address.rb b/db/migrate/010_customers_text_address.rb new file mode 100644 index 0000000..7e9d968 --- /dev/null +++ b/db/migrate/010_customers_text_address.rb @@ -0,0 +1,9 @@ +class CustomersTextAddress < ActiveRecord::Migration + def self.up + change_column :customers, :address, :text + end + + def self.down + change_column :customers, :address, :string + end +end diff --git a/db/schema.rb b/db/schema.rb index 692ee89..5c26969 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -2,7 +2,7 @@ # migrations feature of ActiveRecord to incrementally modify your database, and # then regenerate this schema definition. -ActiveRecord::Schema.define(:version => 9) do +ActiveRecord::Schema.define(:version => 10) do create_table "coitems", :force => true do |t| t.column "customer_id", :integer @@ -13,10 +13,10 @@ ActiveRecord::Schema.define(:version => 9) do create_table "customers", :force => true do |t| t.column "name", :string - t.column "address", :string + t.column "address", :text, :limit => 255 t.column "email", :string t.column "phone", :string - t.column "debt", :decimal, :precision => 8, :scale => 2, :default => 0.0 + t.column "debt", :decimal, :default => 0.0 end create_table "rentables", :force => true do |t|