diff options
author | Daniel Vincent Grippi <Dan@SPEEDRACER.local> | 2010-09-14 02:11:38 +0400 |
---|---|---|
committer | Daniel Vincent Grippi <Dan@SPEEDRACER.local> | 2010-09-14 02:11:38 +0400 |
commit | 48403996f05ee6d3c93045fb745b3715ed27048b (patch) | |
tree | 1eb2eabfd9f41e408303fecf6422a6d3963ea795 | |
parent | 2fae1049d91e39ad7e2b65478c889d518ebdaf20 (diff) | |
parent | a7231d041edc07bd7eafdc04c27ff04292517924 (diff) |
Merge branch 'master' of github.com:diaspora/diaspora
-rw-r--r-- | app/models/user.rb | 6 | ||||
-rw-r--r-- | app/views/users/edit.html.haml | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb index 26e140b9d..43c2d3d06 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -48,10 +48,13 @@ class User before_validation_on_create :setup_person before_validation :do_bad_things + before_save :downcase_username def self.find_for_authentication(conditions={}) if conditions[:username] =~ /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i # email regex conditions[:email] = conditions.delete(:username) + else + conditions[:username].downcase! end super end @@ -322,6 +325,9 @@ class User self.person.save! end + def downcase_username + username.downcase! + end def as_json(opts={}) diff --git a/app/views/users/edit.html.haml b/app/views/users/edit.html.haml index 20c30ea11..3df6e1edf 100644 --- a/app/views/users/edit.html.haml +++ b/app/views/users/edit.html.haml @@ -35,11 +35,11 @@ = p.hidden_field :image_url, :value => @profile.image_url, :id => 'image_url_field' - for photo in @photos - if photo.url(:thumb_medium) == @profile.image_url - %div.small_photo{:id => photo.url(:thumb_medium), :class=>'selected'} + %div.small_photo{:id => request.host + photo.url(:thumb_medium), :class=>'selected'} = check_box_tag 'checked_photo', true, true = link_to image_tag(photo.url(:thumb_medium)), "#" - else - %div.small_photo{:id => photo.url(:thumb_medium)} + %div.small_photo{:id => request.host + photo.url(:thumb_medium)} = check_box_tag 'checked_photo' = link_to image_tag(photo.url(:thumb_medium)), "#" =will_paginate @photos |