diff --git a/app/presenters/comment_presenter.rb b/app/presenters/comment_presenter.rb index bdc16785f..7575f1819 100644 --- a/app/presenters/comment_presenter.rb +++ b/app/presenters/comment_presenter.rb @@ -55,7 +55,7 @@ class CommentPresenter < ApplicationPresenter end def image - @image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(@user.email.downcase)}?s=40&r=pg" + @image ||= helpers.avatar_url(@user, :medium) end def date diff --git a/app/presenters/git_presenters/commit_as_message_presenter.rb b/app/presenters/git_presenters/commit_as_message_presenter.rb index fe85874de..e09ad4172 100644 --- a/app/presenters/git_presenters/commit_as_message_presenter.rb +++ b/app/presenters/git_presenters/commit_as_message_presenter.rb @@ -22,7 +22,12 @@ class GitPresenters::CommitAsMessagePresenter < ApplicationPresenter end def image - @image ||= "https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(committer.email.downcase)}?s=40&r=pg" + c = committer + @image ||= if c.class == User + helpers.avatar_url(c, :medium) + else + helpers.avatar_url_by_email(c.email, :medium) + end end def date diff --git a/db/schema.rb b/db/schema.rb index b145fe88c..7c7a52e57 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -286,11 +286,11 @@ ActiveRecord::Schema.define(:version => 20120321130436) do t.text "description" t.string "ancestry" t.boolean "has_issues", :default => true + t.boolean "has_wiki", :default => false t.string "srpm_file_name" t.string "srpm_content_type" t.integer "srpm_file_size" t.datetime "srpm_updated_at" - t.boolean "has_wiki", :default => false t.string "default_branch", :default => "master" t.boolean "is_rpm", :default => true end @@ -311,7 +311,6 @@ ActiveRecord::Schema.define(:version => 20120321130436) do end add_index "register_requests", ["email"], :name => "index_register_requests_on_email", :unique => true, :case_sensitive => false - add_index "register_requests", ["token"], :name => "index_register_requests_on_token", :unique => true, :case_sensitive => false create_table "relations", :force => true do |t| t.integer "object_id" @@ -371,6 +370,7 @@ ActiveRecord::Schema.define(:version => 20120321130436) do t.string "email", :default => "", :null => false t.string "encrypted_password", :limit => 128, :default => "", :null => false t.string "reset_password_token" + t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.datetime "created_at" t.datetime "updated_at" @@ -378,7 +378,6 @@ ActiveRecord::Schema.define(:version => 20120321130436) do t.string "uname" t.string "role" t.string "language", :default => "en" - t.datetime "reset_password_sent_at" t.integer "own_projects_count", :default => 0, :null => false t.text "professional_experience" t.string "site" diff --git a/lib/rosa_presenter/lib/base.rb b/lib/rosa_presenter/lib/base.rb index 46c94fedf..eff0f3387 100644 --- a/lib/rosa_presenter/lib/base.rb +++ b/lib/rosa_presenter/lib/base.rb @@ -15,6 +15,10 @@ module RosaPresenter Thread.current[:rosa_presenter_controller] end + def helpers + controller.view_context + end + # TODO it needs to be refactored! class << self def present(item, opts, &block)