Commit 560f0b22dffac3a1ccf315ceba918d2b45b687d7
Committed by
Marcos Pereira
1 parent
12ab2e97
Exists in
staging
and in
32 other branches
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 |