diff options
author | Piotr Sarnacki <drogus@gmail.com> | 2012-06-09 14:20:31 +0200 |
---|---|---|
committer | Piotr Sarnacki <drogus@gmail.com> | 2012-08-28 10:51:03 +0200 |
commit | 264624049ea02a76a84e88023f611820bfdde9eb (patch) | |
tree | 9a335e0111164fab6bed1dc0d1816c1590115157 /actionpack | |
parent | 7185e35971f4a18f48a7d67e5c86c2fcf87bdb66 (diff) | |
download | rails-264624049ea02a76a84e88023f611820bfdde9eb.tar.gz rails-264624049ea02a76a84e88023f611820bfdde9eb.tar.bz2 rails-264624049ea02a76a84e88023f611820bfdde9eb.zip |
Move ActionController::RecordIdentifier to ActionView
Since it's more about DOM classes and ids it belongs to Action View
better. What's more, it's more convenient to make it part of Action View
to follow the rule that Action Pack can depend on Action View, but not
the other way round.
Diffstat (limited to 'actionpack')
-rw-r--r-- | actionpack/lib/action_controller.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_controller/base.rb | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view.rb | 1 | ||||
-rw-r--r-- | actionpack/lib/action_view/helpers/record_tag_helper.rb | 4 | ||||
-rw-r--r-- | actionpack/lib/action_view/record_identifier.rb (renamed from actionpack/lib/action_controller/record_identifier.rb) | 2 | ||||
-rw-r--r-- | actionpack/lib/action_view/test_case.rb | 2 | ||||
-rw-r--r-- | actionpack/test/template/record_identifier_test.rb (renamed from actionpack/test/controller/record_identifier_test.rb) | 2 |
7 files changed, 6 insertions, 11 deletions
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb index 153e13f2db..09029633fc 100644 --- a/actionpack/lib/action_controller.rb +++ b/actionpack/lib/action_controller.rb @@ -46,10 +46,6 @@ module ActionController autoload :TestCase, 'action_controller/test_case' autoload :TemplateAssertions, 'action_controller/test_case' - eager_autoload do - autoload :RecordIdentifier - end - def self.eager_load! super ActionController::Caching.eager_load! diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index 0d79e046a1..ed76470596 100644 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -203,7 +203,7 @@ module ActionController ForceSSL, Streaming, DataStreaming, - RecordIdentifier, + ActionView::RecordIdentifier, HttpAuthentication::Basic::ControllerMethods, HttpAuthentication::Digest::ControllerMethods, HttpAuthentication::Token::ControllerMethods, diff --git a/actionpack/lib/action_view.rb b/actionpack/lib/action_view.rb index 9d11c284f5..72aba968d1 100644 --- a/actionpack/lib/action_view.rb +++ b/actionpack/lib/action_view.rb @@ -36,6 +36,7 @@ module ActionView autoload :Helpers autoload :LookupContext autoload :PathSet + autoload :RecordIdentifier autoload :Template autoload_under "renderer" do diff --git a/actionpack/lib/action_view/helpers/record_tag_helper.rb b/actionpack/lib/action_view/helpers/record_tag_helper.rb index 9b35f076e5..dded9aab7c 100644 --- a/actionpack/lib/action_view/helpers/record_tag_helper.rb +++ b/actionpack/lib/action_view/helpers/record_tag_helper.rb @@ -1,10 +1,8 @@ -require 'action_controller/record_identifier' - module ActionView # = Action View Record Tag Helpers module Helpers module RecordTagHelper - include ActionController::RecordIdentifier + include ActionView::RecordIdentifier # Produces a wrapper DIV element with id and class parameters that # relate to the specified Active Record object. Usage example: diff --git a/actionpack/lib/action_controller/record_identifier.rb b/actionpack/lib/action_view/record_identifier.rb index d3ac406618..0f4fc8aa75 100644 --- a/actionpack/lib/action_controller/record_identifier.rb +++ b/actionpack/lib/action_view/record_identifier.rb @@ -1,7 +1,7 @@ require 'active_support/core_ext/module' require 'action_controller/model_naming' -module ActionController +module ActionView # The record identifier encapsulates a number of naming conventions for dealing with records, like Active Records or # pretty much any other model type that has an id. These patterns are then used to try elevate the view actions to # a higher logical level. diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb index 55f79bf761..17c70b7e95 100644 --- a/actionpack/lib/action_view/test_case.rb +++ b/actionpack/lib/action_view/test_case.rb @@ -38,10 +38,10 @@ module ActionView include ActionView::Context include ActionDispatch::Routing::PolymorphicRoutes - include ActionController::RecordIdentifier include AbstractController::Helpers include ActionView::Helpers + include ActionView::RecordIdentifier delegate :lookup_context, :to => :controller attr_accessor :controller, :output_buffer, :rendered diff --git a/actionpack/test/controller/record_identifier_test.rb b/actionpack/test/template/record_identifier_test.rb index eb38b81e85..a7f1420059 100644 --- a/actionpack/test/controller/record_identifier_test.rb +++ b/actionpack/test/template/record_identifier_test.rb @@ -2,7 +2,7 @@ require 'abstract_unit' require 'controller/fake_models' class RecordIdentifierTest < ActiveSupport::TestCase - include ActionController::RecordIdentifier + include ActionView::RecordIdentifier def setup @klass = Comment |