diff --git a/app/controllers/articles_controller.rb b/app/controllers/articles_controller.rb index 9fda95e..a909aca 100644 --- a/app/controllers/articles_controller.rb +++ b/app/controllers/articles_controller.rb @@ -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 diff --git a/app/models/article.rb b/app/models/article.rb index c2edaf1..c0c5128 100644 --- a/app/models/article.rb +++ b/app/models/article.rb @@ -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