Skip to content

Commit

Permalink
will not generate permalink if title is blank
Browse files Browse the repository at this point in the history
  • Loading branch information
jipiboily committed Jun 14, 2012
1 parent 0778e97 commit 6e086ae
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/models/monologue/posts_revision.rb
Expand Up @@ -48,8 +48,8 @@ def url_exists?
private

def generate_url
return if self.title.blank?
year = self.published_at.class == ActiveSupport::TimeWithZone ? self.published_at.year : DateTime.now.year
self.title = "" if self.title.nil?
base_title = "#{year}/#{self.title.parameterize}"
url_empty = self.url.nil? || self.url.strip == ""
self.url = base_title if url_empty
Expand Down

0 comments on commit 6e086ae

Please sign in to comment.