From f1e474c7493a6475587618bbece0734148874fed Mon Sep 17 00:00:00 2001 From: Viktor Date: Mon, 14 May 2012 11:54:50 +0300 Subject: [PATCH 1/3] 191_admin/All Comments change of sequence of comments --- app/controllers/administration/comments_controller.rb | 2 +- app/models/comment.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/administration/comments_controller.rb b/app/controllers/administration/comments_controller.rb index 562c110..7827f55 100644 --- a/app/controllers/administration/comments_controller.rb +++ b/app/controllers/administration/comments_controller.rb @@ -3,7 +3,7 @@ class Administration::CommentsController < Administration::MainController before_filter :find_comment, :except => [:index, :new, :create] before_filter :build_comment, :only => [:new, :create] def index - @search = Comment.includes(:post).search(params[:search] || {"meta_sort" => "id.asc"}) + @search = Comment.includes(:post).search(params[:search] || {"meta_sort" => "id.desc"}) @comments = @search.paginate(:per_page => 50, :page => params[:page]) end diff --git a/app/models/comment.rb b/app/models/comment.rb index 6722ab1..2ffac3a 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -4,7 +4,7 @@ class Comment < ActiveRecord::Base attr_accessor :current_admin belongs_to :post - after_create :notify_admin + #after_create :notify_admin validates :content, :post_id, :author, :presence => true validates :content, :length => {:minimum => 1, :maximum => 10000} @@ -14,7 +14,7 @@ class Comment < ActiveRecord::Base protected def notify_admin - AdminMailer.comment_notifier(id).deliver + AdminMailer.comment_notifier(id).deliver! end def check_author From ee635a909d52d9a02a3bab3f23226ab2a26495c0 Mon Sep 17 00:00:00 2001 From: Viktor Date: Tue, 15 May 2012 14:44:56 +0300 Subject: [PATCH 2/3] 191_admin_all_comments MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit изменение очередности коментариев --- app/models/comment.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/models/comment.rb b/app/models/comment.rb index 2ffac3a..6722ab1 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -4,7 +4,7 @@ class Comment < ActiveRecord::Base attr_accessor :current_admin belongs_to :post - #after_create :notify_admin + after_create :notify_admin validates :content, :post_id, :author, :presence => true validates :content, :length => {:minimum => 1, :maximum => 10000} @@ -14,7 +14,7 @@ class Comment < ActiveRecord::Base protected def notify_admin - AdminMailer.comment_notifier(id).deliver! + AdminMailer.comment_notifier(id).deliver end def check_author From e026fa99290a74aff1347c99ea2c0d204ff4fd67 Mon Sep 17 00:00:00 2001 From: Viktor Markevich Date: Tue, 20 May 2014 09:39:20 +0300 Subject: [PATCH 3/3] old changes --- .rvmrc | 2 +- app/assets/images/no-avatar.gif | Bin script/rails | 0 3 files changed, 1 insertion(+), 1 deletion(-) mode change 100755 => 100644 app/assets/images/no-avatar.gif mode change 100755 => 100644 script/rails diff --git a/.rvmrc b/.rvmrc index 6de9988..68c31c5 100644 --- a/.rvmrc +++ b/.rvmrc @@ -1 +1 @@ -rvm ruby-1.9.2-p290@ruby-blog +rvm ruby-1.9.2-p290@ruby-blog --create diff --git a/app/assets/images/no-avatar.gif b/app/assets/images/no-avatar.gif old mode 100755 new mode 100644 diff --git a/script/rails b/script/rails old mode 100755 new mode 100644