Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

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.
  • Loading branch information...
commit d373113570886c0ce7f81eb3b534378311e75351 1 parent d11d3c6
@drogus drogus authored
View
4 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!
View
2  actionpack/lib/action_controller/base.rb
@@ -203,7 +203,7 @@ def self.without_modules(*modules)
ForceSSL,
Streaming,
DataStreaming,
- RecordIdentifier,
+ ActionView::RecordIdentifier,
HttpAuthentication::Basic::ControllerMethods,
HttpAuthentication::Digest::ControllerMethods,
HttpAuthentication::Token::ControllerMethods,
View
1  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
View
4 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:
View
2  ...ib/action_controller/record_identifier.rb → ...pack/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.
View
2  actionpack/lib/action_view/test_case.rb
@@ -38,10 +38,10 @@ module Behavior
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
View
2  ...test/controller/record_identifier_test.rb → ...k/test/template/record_identifier_test.rb
@@ -2,7 +2,7 @@
require 'controller/fake_models'
class RecordIdentifierTest < ActiveSupport::TestCase
- include ActionController::RecordIdentifier
+ include ActionView::RecordIdentifier
def setup
@klass = Comment

0 comments on commit d373113

Please sign in to comment.
Something went wrong with that request. Please try again.