Commit 9dd039186e0a3815bbb3242b5e3e26f7d8e26920
1 parent
a9c44bb8
Exists in
stable-spb-1.4
Fix article initialize method
Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
Showing
1 changed file
with
1 additions
and
1 deletions
Show diff stats
app/models/article.rb
@@ -29,7 +29,7 @@ class Article < ActiveRecord::Base | @@ -29,7 +29,7 @@ class Article < ActiveRecord::Base | ||
29 | def initialize(*params) | 29 | def initialize(*params) |
30 | super | 30 | super |
31 | 31 | ||
32 | - if !params.blank? | 32 | + if params.present? && params.first.present? |
33 | if params.first.has_key?(:profile) && !params.first[:profile].blank? | 33 | if params.first.has_key?(:profile) && !params.first[:profile].blank? |
34 | profile = params.first[:profile] | 34 | profile = params.first[:profile] |
35 | self.published = false unless profile.public_profile | 35 | self.published = false unless profile.public_profile |