[refs #194] add creator to issue
This commit is contained in:
parent
55379ed9c8
commit
76beb6a277
|
@ -4,6 +4,7 @@ class Issue < ActiveRecord::Base
|
|||
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
belongs_to :creator, :class_name => 'User', :foreign_key => 'creator_id'
|
||||
|
||||
has_many :comments, :as => :commentable, :dependent => :destroy #, :finder_sql => proc { "comments.commentable_id = '#{self.id}' AND comments.commentable_type = '#{self.class.name}'"}
|
||||
has_many :subscribes, :as => :subscribeable, :dependent => :destroy #, :finder_sql => proc { "subscribes.subscribeable_id = '#{self.id}' AND subscribes.subscribeable_type = '#{self.class.name}'"}
|
||||
|
|
|
@ -96,6 +96,10 @@ class User < ActiveRecord::Base
|
|||
email.downcase == commit.committer.email.downcase
|
||||
end
|
||||
|
||||
def avatar(size)
|
||||
"https://secure.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}?s=#{size}&r=pg"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def create_settings_notifier
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
class AddCreatorToIssue < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :issues, :creator_id, :integer
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue