Commit 0495a57

mo khan <mo@mokhan.ca>
2013-06-23 05:02:05
add location information to each Need
1 parent f77ddd6
app/models/need.rb
@@ -1,5 +1,5 @@
 class Need < ActiveRecord::Base
   belongs_to :user
-  attr_accessible :description, :user_id
+  attr_accessible :description, :address, :latitude, :longitude
   acts_as_taggable
 end
db/migrate/20130623045925_add_location_to_needs.rb
@@ -0,0 +1,7 @@
+class AddLocationToNeeds < ActiveRecord::Migration
+  def change
+    add_column :needs, :address, :string
+    add_column :needs, :latitude, :float
+    add_column :needs, :longitude, :float
+  end
+end
db/schema.rb
@@ -11,7 +11,7 @@
 #
 # It's strongly recommended to check this file into your version control system.
 
-ActiveRecord::Schema.define(:version => 20130623021548) do
+ActiveRecord::Schema.define(:version => 20130623045925) do
 
   create_table "active_admin_comments", :force => true do |t|
     t.string   "resource_id",   :null => false
@@ -51,6 +51,9 @@ ActiveRecord::Schema.define(:version => 20130623021548) do
     t.integer  "user_id"
     t.datetime "created_at",  :null => false
     t.datetime "updated_at",  :null => false
+    t.string   "address"
+    t.float    "latitude"
+    t.float    "longitude"
   end
 
   create_table "neighbourhoods", :force => true do |t|