Merge branch '345-update_to_rails4' of abf.rosalinux.ru:abf/rosa-build into 345-update_to_rails4

This commit is contained in:
Alexander Machehin 2014-03-27 13:07:44 +06:00
commit 3194c07896
10 changed files with 22 additions and 18 deletions

View File

@ -10,7 +10,7 @@ class Groups::ProfileController < Groups::BaseController
def show
@path, page = group_path(@group), params[:page].to_i
@projects = @group.own_projects.opened.search(params[:search]).recent
@projects = @group.own_projects.search(params[:search]).recent
if request.xhr?
if params[:visibility] != 'hidden'
@projects = @projects.opened
@ -20,6 +20,7 @@ class Groups::ProfileController < Groups::BaseController
end
render partial: 'shared/profile_projects', layout: nil, locals: {projects: paginate_projects(page)}
else
@projects = @projects.opened
@projects = paginate_projects(page)
end
end

View File

@ -13,6 +13,7 @@ class Users::ProfileController < Users::BaseController
end
render partial: 'shared/profile_projects', layout: nil, locals: {projects: paginate_projects(page)}
else
@projects = @projects.opened
@projects = paginate_projects(page)
end
end

View File

@ -2,12 +2,12 @@ module Feed::Issue
extend ActiveSupport::Concern
included do
after_create :new_issue_notifications
after_commit :new_issue_notifications, on: :create
after_create :send_assign_notifications, if: ->(i) { i.assignee }
after_commit :send_assign_notifications, on: :create, if: ->(i) { i.assignee }
after_update -> { send_assign_notifications(:update) }
after_create :send_hooks
after_commit :send_hooks, on: :create
after_update -> { send_hooks(:update) }, if: ->(i) { i.previous_changes['status'].present? }
end

View File

@ -2,7 +2,7 @@ module Feed::User
extend ActiveSupport::Concern
included do
after_create :new_user_notification
after_commit :new_user_notification, on: :create
end
private

View File

@ -11,8 +11,8 @@ module Git
validates_attachment_content_type :srpm, content_type: ['application/octet-stream', "application/x-rpm", "application/x-redhat-package-manager"], message: I18n.t('layout.invalid_content_type')
after_create :create_git_repo
after_create {|p| p.fork_git_repo unless p.is_root?} # later with resque
after_create {|p| p.import_attached_srpm if p.srpm?} # later with resque # should be after create_git_repo
after_commit(on: :create) {|p| p.fork_git_repo unless p.is_root?} # later with resque
after_commit(on: :create) {|p| p.import_attached_srpm if p.srpm?} # later with resque # should be after create_git_repo
after_destroy :destroy_git_repo
# after_rollback -> { destroy_git_repo rescue true if new_record? }

View File

@ -19,7 +19,7 @@ class MassBuild < ActiveRecord::Base
validates :projects_list, length: {maximum: 500_000}, presence: true
validates_inclusion_of :auto_publish, :increase_release_tag, in: [true, false]
after_create :build_all
after_commit :build_all, on: :create
before_validation :set_data, on: :create
COUNT_STATUSES = [

View File

@ -15,9 +15,9 @@ json.product_build_list do |json|
json.created_at @product_build_list.created_at.to_i
json.updated_at @product_build_list.updated_at.to_i
json.results (@product_build_list.results || []) do |json_logs, result|
json_logs.file_name result['file_name']
json_logs.size result['size']
json_logs.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}"
json.results (@product_build_list.results || []) do |result|
json.file_name result['file_name']
json.size result['size']
json.url "#{APP_CONFIG['file_store_url']}/api/v1/file_stores/#{result['sha1']}"
end
end

View File

@ -1,11 +1,11 @@
-user= User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
- name_with_owner = "#{project_owner}/#{project_name}"
.top
.image= link_to(image_tag(avatar_url(user, :small), alt: 'avatar'), user_path(user)) if user.persisted?
.text
%span
= raw t("notifications.bodies.new_comment_notification.title", user_link: user_link(user, user_name))
= raw t("notifications.bodies.new_comment_notification.commit_content", {commit_link: link_to(commit_message, commit_path(project_owner, project_name, commit_id) + "#comment#{comment_id}")})
- name_with_owner = "#{project_owner}/#{project_name}"
= raw t("notifications.bodies.new_comment_notification.commit_content", {commit_link: link_to(commit_message, commit_path(name_with_owner, commit_id) + "#comment#{comment_id}")})
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_path(name_with_owner)) )
.both
= datetime_moment activity_feed.created_at, tag: :span, class: 'date'

View File

@ -3,6 +3,7 @@
%p
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
= t('notifications.bodies.delete_branch', branch_name: branch_name, user_link: _user_link).html_safe
= raw t("notifications.bodies.project", project_link: link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) )
- name_with_owner = "#{project_owner}/#{project_name}"
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) )
= render 'footer'

View File

@ -1,18 +1,19 @@
- user = User.where(email: user_email).first || User.new(email: user_email) if defined?(user_email)
- name_with_owner = "#{project_owner}/#{project_name}"
%p
- _user_link = defined?(user_email) ? user_link(user, defined?(user_name) ? user_name : user_email, true) : nil
= raw t("notifications.bodies.#{change_type}_branch", {branch_name: branch_name, user_link: _user_link})
= raw t("notifications.bodies.project", project_link: link_to("#{project_owner}/#{project_name}", project_url(project_owner, project_name)) )
= raw t("notifications.bodies.project", project_link: link_to(name_with_owner, project_url(name_with_owner)) )
%p
- last_commits.each do |commit|
= link_to shortest_hash_id(commit[0]), commit_url(project_owner, project_name, commit[0])
= link_to shortest_hash_id(commit[0]), commit_url(name_with_owner, commit[0])
= commit[1]
%br
- if defined? other_commits
%br
=link_to t('notifications.bodies.more_commits', count: other_commits_count, commits: commits_pluralize(other_commits_count)),
diff_url(project_owner, project_name, diff: other_commits)
diff_url(name_with_owner, diff: other_commits)
= render 'footer'