Skip to content
This repository has been archived by the owner on Dec 12, 2021. It is now read-only.

Commit

Permalink
using .all instead of .find(:all)
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanb committed Nov 11, 2008
1 parent 8aececb commit 4daa66b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion rails_generators/nifty_scaffold/templates/actions/index.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
def index
@<%= plural_name %> = <%= class_name %>.find(:all)
@<%= plural_name %> = <%= class_name %>.all
end
6 changes: 3 additions & 3 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ class Column
attr_accessor :name, :default, :type, :limit, :null, :sql_type, :precision, :scale

def initialize(name, default, sql_type = nil)
@name=name
@default=default
@type=@sql_type=sql_type
@name = name
@default = default
@type = @sql_type = sql_type
end

def human_name
Expand Down
2 changes: 1 addition & 1 deletion test/test_nifty_scaffold_generator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class TestNiftyScaffoldGenerator < Test::Unit::TestCase
should "generate controller with index action" do
assert_generated_file "app/controllers/line_items_controller.rb" do |body|
assert_match "def index", body
assert_match "@line_items = LineItem.find(:all)", body
assert_match "@line_items = LineItem.all", body
assert_no_match(/ def index/, body)
end
end
Expand Down

0 comments on commit 4daa66b

Please sign in to comment.