Skip to content

Commit

Permalink
made RSS links absolute URLs [#4 state:resolved]
Browse files Browse the repository at this point in the history
  • Loading branch information
nakajima committed Jul 30, 2008
1 parent faf1ae6 commit 2b8d828
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
7 changes: 2 additions & 5 deletions app/helpers/application_helper.rb
Expand Up @@ -71,13 +71,10 @@ def host_helper

def feed_url_for(post)
case post
when Article
post.from_feed? ? post.permalink : url_for(post)
when Tweet
when Tweet, Link
post.permalink
when Link
else
url_for(post)
post.from_feed? ? post.permalink : "http://#{host_helper}#{url_for(post)}"
end
end

Expand Down
4 changes: 4 additions & 0 deletions app/models/post.rb
Expand Up @@ -22,6 +22,10 @@ def name
header
end

def from_feed?
!!feed_id && (feed_id != 0)
end

def type
attributes['type']
end
Expand Down
4 changes: 0 additions & 4 deletions app/models/posts/article.rb
Expand Up @@ -17,10 +17,6 @@ def allow_comments?
feed_id.nil?
end

def from_feed?
!!feed_id && (feed_id != 0)
end

def link(root='')
from_feed? ? permalink : super
end
Expand Down

0 comments on commit 2b8d828

Please sign in to comment.