Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix deprecated old railsisms

  • Loading branch information...
commit de91be2f6af1d4b9c665e9c876a96f0333c2f58b 1 parent 43f7bab
@johnl authored
View
2  app/controllers/news_articles_controller.rb
@@ -26,7 +26,7 @@ def index
def show
@article = NewsArticle.find(params[:id])
- @versions = @article.versions.find(:all, :order => 'version asc', :select => "id, votes, version, title, created_at")
+ @versions = @article.versions.all(:order => 'version asc', :select => "id, votes, version, title, created_at")
respond_to do |format|
format.html
format.rss { render :content_type => 'application/rss+xml', :layout => false }
View
4 app/controllers/versions_controller.rb
@@ -24,12 +24,12 @@ def show
@version = NewsArticleVersion.find(params[:id])
@article = @version.news_article
end
- @versions = @article.versions.find(:all, :order => 'version asc')
+ @versions = @article.versions.all(:order => 'version asc')
end
def diff
@article = NewsArticle.find(params[:article_id])
- @versions = @article.versions.find :all, :order => 'version asc'
+ @versions = @article.versions.all(:order => 'version asc')
@va = @article.versions.find_by_version!(params[:version_a])
@vb = @article.versions.find_by_version!(params[:version_b])
View
2  app/models/news_article.rb
@@ -88,7 +88,7 @@ def update_from_page(page)
end
def latest_text_hash
- versions.find(:first, :select => 'text_hash', :order => 'version desc').text_hash rescue nil
+ versions.first(:select => 'text_hash', :order => 'version desc').text_hash rescue nil
end
def count_versions_by_hash(count_hash)
View
4 app/models/news_article_version.rb
@@ -1,6 +1,6 @@
# News Sniffer
-# Copyright (C) 2007-2008 John Leach
+# Copyright (C) 2007-2012 John Leach
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -95,7 +95,7 @@ def self.xapian_db
private
def self.xapian_db_path
- File.join(RAILS_ROOT, 'xapian/news_article_versions')
+ File.join(Rails.root, 'xapian/news_article_versions')
end
def setup_text
View
2  app/views/admin/login.rhtml
@@ -1,7 +1,7 @@
<% if session[:admin] %>
<p>You are currently logged in. Click here to <%= link_to "log out", :action => 'logout' %></p>
<% else %>
-<% form_tag :action => 'login' do %>
+<%= form_tag :action => 'login' do %>
<p>Enter password <%= password_field_tag 'pswd'%> <%= submit_tag 'Login' %></p>
<% end %>
<% end %>
View
2  app/views/versions/index.html.erb
@@ -3,7 +3,7 @@
<% end %>
<div id="search">
-<% form_tag versions_url, :method => :get do %>
+<%= form_tag versions_url, :method => :get do %>
<%= text_field_tag 'q', @search, :class => 'searchbox', :size => 40 %>
<%= submit_tag ' Search ' %>
<% end %>
View
2  app/views/versions/search.rhtml
@@ -1,6 +1,6 @@
<h2>News Article Search</h2>
<p><%= link_to "Help with more advanced searches", :controller => "pages", :action => :revisionista_search %></p>
-<% form_tag search_versions_url, :method => :get do %>
+<%= form_tag search_versions_url, :method => :get do %>
<%= text_field_tag 'q', @search, :class => 'searchbox', :size => 40 %>
<%= submit_tag ' Search ' %>
<% end %>
Please sign in to comment.
Something went wrong with that request. Please try again.