add admin suppliers controller specs

This commit is contained in:
2012-12-05 01:29:56 +01:00
parent fe7c061d37
commit e1e1ad3af1
4 changed files with 142 additions and 46 deletions
+2
View File
@@ -28,6 +28,8 @@ class Supplier
view :by_email, key: :email
validates :name, presence: true
def location=(val)
lat, lng = val.strip.split(/[ ,]+/).map(&:to_f)
self.lat = lat