Basic site flow improvements and devise handling

This commit is contained in:
2014-07-16 11:20:11 +02:00
parent de298a529b
commit a302123c6b
20 changed files with 134 additions and 85 deletions
+2 -1
View File
@@ -39,8 +39,9 @@ class Supplier
view :by_email, key: :email
validates :name, presence: true
validates :email, email: true
validates :iens_profile, numericality: {allow_blank: true}
validates :password, confirmation: true
validates :password, confirmation: true, presence: {if: ->(r){ r.new_record? }}
def location=(val)
lat, lng = val.is_a?(Array) ? val : val.strip.split(/[ ,]+/).map(&:to_f)