Skip to content

Commit

Permalink
Move clear_coords into GeocodingUtilities. [#43]
Browse files Browse the repository at this point in the history
  • Loading branch information
marnen committed Oct 20, 2009
1 parent c53434a commit fc8356b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 8 deletions.
4 changes: 0 additions & 4 deletions app/models/event.rb
Expand Up @@ -99,10 +99,6 @@ def allow_show?(user)
!(role_of user).nil?
end

def clear_coords
self.coords = nil
end

# TODO: should this method be public?
# Returns the #Role of the #User for the #Event.
def role_of(user)
Expand Down
4 changes: 0 additions & 4 deletions app/models/user.rb
Expand Up @@ -91,10 +91,6 @@ def to_s(format = :first_last)
end

protected
def clear_coords
self.coords = nil
end

def password_required?
crypted_password.blank? || !password.blank? || !password_confirmation.blank?
end
Expand Down
5 changes: 5 additions & 0 deletions lib/geocoding_utilities.rb
Expand Up @@ -14,4 +14,9 @@ def coords_from_string(string)
raise "Geocoding failed with code #{geo.status} for #{string}"
end
end

# Clears the coordinates of the model so they will refresh themselves next time Model.coords is called
def clear_coords
self.coords = nil
end
end

0 comments on commit fc8356b

Please sign in to comment.