Skip to content

Commit

Permalink
Added recent scope to Comments for RSS future. Fixed the callback to …
Browse files Browse the repository at this point in the history
…be simpler and not call the response data again since it gets executed anyways.
  • Loading branch information
mtodd committed Oct 9, 2008
1 parent 615b5e8 commit 032cde7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/models/comment.rb
Expand Up @@ -15,4 +15,10 @@ class Comment
belongs_to :user
belongs_to :page

### Scopes

def self.recent
all(:created_at.gt => (Time.now - 1*24*60*60))
end

end
2 changes: 1 addition & 1 deletion app/views/comments/index.js.erb
Expand Up @@ -52,7 +52,7 @@ $(function(){

// submit form
if(!$('#new-comment-form').hasClass('errors')) {
$.post($(this).attr('action'), params, function(data, status){eval(data);}, 'script');
$.post($(this).attr('action'), params, function(d,s){}, 'script');
} else {
$('#new-comment-form .submit :input').attr('disable', false);
}
Expand Down

0 comments on commit 032cde7

Please sign in to comment.