mirror of
https://github.com/ENSL/ensl.org.git
synced 2024-11-15 09:21:25 +00:00
Hotfix: Error when changing articles status
This commit is contained in:
parent
4aa83bf4cd
commit
849f81e27d
2 changed files with 3 additions and 3 deletions
|
@ -55,7 +55,7 @@ class ArticlesController < ApplicationController
|
|||
|
||||
def update
|
||||
raise AccessError unless @article.can_update? cuser, params[:article]
|
||||
if @article.update_attributes params[:article]
|
||||
if @article.update_attributes(params[:article])
|
||||
flash[:notice] = t(:articles_update)
|
||||
redirect_to @article
|
||||
else
|
||||
|
|
|
@ -114,11 +114,11 @@ class Article < ActiveRecord::Base
|
|||
if (new_record? or status_changed?) and status == STATUS_PUBLISHED
|
||||
case category.domain
|
||||
when Category::DOMAIN_NEWS
|
||||
Profile.all(includes: :user, conditions: "notify_news = 1").each do |p|
|
||||
Profile.includes(:user).all(conditions: "notify_news = 1").each do |p|
|
||||
Notifications.news p.user, self if p.user
|
||||
end
|
||||
when Category::DOMAIN_ARTICLES
|
||||
Profile.all(includes: :user, conditions: "notify_articles = 1").each do |p|
|
||||
Profile.includes(:user).all(conditions: "notify_articles = 1").each do |p|
|
||||
Notifications.article p.user, self if p.user
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue