Commit e3bed4c4

mo khan <mo@mokhan.ca>
2013-12-29 23:43:07
update user lat long before save which happen everytime they log in because devise updates the last_signed_in_at field.
1 parent d1c7cd5
Changed files (1)
app
models
app/models/user.rb
@@ -6,7 +6,7 @@ class User < ActiveRecord::Base
     end
   end
 
-  after_validation :geocode, :reverse_geocode
+  before_save :geocode, :reverse_geocode
   validates :name,  :presence => true
   validates :website, :format => URI::regexp(%w(http https)), :allow_blank => true
   devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable, :token_authenticatable