Skip to content

Commit

Permalink
Rename ActiveRecordHelper to ActiveModelHelper
Browse files Browse the repository at this point in the history
  • Loading branch information
wycats committed Jul 19, 2009
1 parent b00cac4 commit f2f5cdc
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions actionpack/lib/action_view/helpers.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,6 +1,6 @@
module ActionView #:nodoc: module ActionView #:nodoc:
module Helpers #:nodoc: module Helpers #:nodoc:
autoload :ActiveRecordHelper, 'action_view/helpers/active_record_helper' autoload :ActiveModelHelper, 'action_view/helpers/active_model_helper'
autoload :AssetTagHelper, 'action_view/helpers/asset_tag_helper' autoload :AssetTagHelper, 'action_view/helpers/asset_tag_helper'
autoload :AtomFeedHelper, 'action_view/helpers/atom_feed_helper' autoload :AtomFeedHelper, 'action_view/helpers/atom_feed_helper'
autoload :BenchmarkHelper, 'action_view/helpers/benchmark_helper' autoload :BenchmarkHelper, 'action_view/helpers/benchmark_helper'
Expand Down Expand Up @@ -31,7 +31,7 @@ module ClassMethods
include SanitizeHelper::ClassMethods include SanitizeHelper::ClassMethods
end end


include ActiveRecordHelper include ActiveModelHelper
include AssetTagHelper include AssetTagHelper
include AtomFeedHelper include AtomFeedHelper
include BenchmarkHelper include BenchmarkHelper
Expand Down
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ module Helpers
# method that creates a complete form for all the basic content types of the record (not associations or aggregations, though). This # method that creates a complete form for all the basic content types of the record (not associations or aggregations, though). This
# is a great way of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form. # is a great way of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form.
# In that case, it's better to use the +input+ method and the specialized +form+ methods in link:classes/ActionView/Helpers/FormHelper.html # In that case, it's better to use the +input+ method and the specialized +form+ methods in link:classes/ActionView/Helpers/FormHelper.html
module ActiveRecordHelper module ActiveModelHelper
# Returns a default input tag for the type of object returned by the method. For example, if <tt>@post</tt> # Returns a default input tag for the type of object returned by the method. For example, if <tt>@post</tt>
# has an attribute +title+ mapped to a +VARCHAR+ column that holds "Hello World": # has an attribute +title+ mapped to a +VARCHAR+ column that holds "Hello World":
# #
Expand Down
2 changes: 0 additions & 2 deletions actionpack/lib/action_view/helpers/form_helper.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -1044,8 +1044,6 @@ def fields_for_with_nested_attributes(association_name, args, block)
end end


def fields_for_nested_model(name, object, args, block) def fields_for_nested_model(name, object, args, block)
object = convert_to_model(object)

if object.new_record? if object.new_record?
@template.fields_for(name, object, *args, &block) @template.fields_for(name, object, *args, &block)
else else
Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/template/active_record_helper_i18n_test.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


class ActiveRecordHelperI18nTest < Test::Unit::TestCase class ActiveRecordHelperI18nTest < Test::Unit::TestCase
include ActionView::Context include ActionView::Context
include ActionView::Helpers::ActiveRecordHelper include ActionView::Helpers::ActiveModelHelper


attr_reader :request attr_reader :request


Expand Down
2 changes: 1 addition & 1 deletion actionpack/test/template/active_record_helper_test.rb
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,7 @@
require 'abstract_unit' require 'abstract_unit'


class ActiveRecordHelperTest < ActionView::TestCase class ActiveRecordHelperTest < ActionView::TestCase
tests ActionView::Helpers::ActiveRecordHelper tests ActionView::Helpers::ActiveModelHelper


silence_warnings do silence_warnings do
class Post < Struct.new(:title, :author_name, :body, :secret, :written_on) class Post < Struct.new(:title, :author_name, :body, :secret, :written_on)
Expand Down

0 comments on commit f2f5cdc

Please sign in to comment.