Commit af7c8de7

mo k <mo@mokhan.ca>
2012-05-31 12:39:12
add lat and long migrations and add to model.
1 parent d8a9811
app/models/user.rb
@@ -15,7 +15,7 @@ class User < ActiveRecord::Base
   has_many :authentications
   has_and_belongs_to_many :interests, :join_table => 'users_interests', :uniq => true, :autosave => true
   devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable
-  attr_accessible :name, :email, :website, :twitter, :facebook, :city, :password, :password_confirmation, :remember_me
+  attr_accessible :name, :email, :website, :twitter, :facebook, :city, :latitude, :longitude, :password, :password_confirmation, :remember_me
   has_many :creations, :dependent => :destroy
   has_many :favorites, :dependent => :destroy
 
db/migrate/20120531123416_add_latitude_and_longitude_to_users.rb
@@ -0,0 +1,6 @@
+class AddLatitudeAndLongitudeToUsers < ActiveRecord::Migration
+  def change
+    add_column :users, :latitude, :float
+    add_column :users, :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 => 20120529130122) do
+ActiveRecord::Schema.define(:version => 20120531123416) do
 
   create_table "active_admin_comments", :force => true do |t|
     t.integer  "resource_id",   :null => false
@@ -105,6 +105,8 @@ ActiveRecord::Schema.define(:version => 20120529130122) do
     t.string   "twitter"
     t.string   "facebook"
     t.string   "city"
+    t.float    "latitude"
+    t.float    "longitude"
   end
 
   add_index "users", ["email"], :name => "index_users_on_email", :unique => true