diff --git a/app/helpers/no_uses_helper.rb b/app/helpers/no_uses_helper.rb index a7a5ac24b..2baaf23b6 100644 --- a/app/helpers/no_uses_helper.rb +++ b/app/helpers/no_uses_helper.rb @@ -8,7 +8,7 @@ module NoUsesHelper css = no_use_css(objects) << options[0].to_s # ([watcher_css(objects), watched ? 'icon icon-fav ' : 'icon icon-fav-off '].join(' ') << options[0].to_s) - text = clicked ? l(:no_use) : l(:cancel_no_use) + text = clicked ? l(:cancel_no_use) : l(:no_use) url = no_uses_path( :object_type => objects.first.class.to_s.underscore, diff --git a/app/helpers/user_score_helper.rb b/app/helpers/user_score_helper.rb index 43ee05db8..d9ab8730a 100644 --- a/app/helpers/user_score_helper.rb +++ b/app/helpers/user_score_helper.rb @@ -297,6 +297,14 @@ module UserScoreHelper return (commit_count + issue_details_count) end + + + def calculate_attachments(user) + attachments = Attachment.where("container_type IS NOT NULL AND container_type <> 'Issue' AND author_id = ?", user.id).count + + return attachments + + end def calculate_user_score(user) collaboration = calculate_collaboration_count(user) diff --git a/app/models/relative_memo.rb b/app/models/relative_memo.rb index 6a4706633..24504241e 100644 --- a/app/models/relative_memo.rb +++ b/app/models/relative_memo.rb @@ -17,7 +17,7 @@ class RelativeMemo < ActiveRecord::Base # validates_length_of :subject, maximum: 50 #validates_length_of :content, maximum: 3072 validate :cannot_reply_to_locked_topic, :on => :create - validates_uniqueness_of :osp_id, :scope => [:subject, :context] + validates_uniqueness_of :osp_id, :scope => [:subject, :content] acts_as_tree :counter_cache => :replies_count, :order => "#{RelativeMemo.table_name}.created_at ASC" acts_as_attachable diff --git a/app/views/layouts/base_opensource_p.html.erb b/app/views/layouts/base_opensource_p.html.erb index da743f3a9..e184bdc21 100644 --- a/app/views/layouts/base_opensource_p.html.erb +++ b/app/views/layouts/base_opensource_p.html.erb @@ -48,7 +48,7 @@