Permalink
Browse files

Cleanup Rails upgrade

  • Loading branch information...
1 parent 4f66aa1 commit 7d04b937432323adb3077d657eb92cd5431d883d @maccman committed Mar 22, 2009
Showing with 0 additions and 43,896 deletions.
  1. +0 −14 vendor/rails/actionmailer/lib/action_mailer/vendor.rb
  2. +0 −69 vendor/rails/actionpack/lib/action_controller/assertions.rb
  3. +0 −18 vendor/rails/actionpack/lib/action_controller/caching/sql_cache.rb
  4. +0 −53 vendor/rails/actionpack/lib/action_controller/cgi_ext/session.rb
  5. +0 −169 vendor/rails/actionpack/lib/action_controller/components.rb
  6. +0 −303 vendor/rails/actionpack/lib/action_controller/rack_process.rb
  7. +0 −169 vendor/rails/actionpack/lib/action_controller/request_profiler.rb
  8. +0 −340 vendor/rails/actionpack/lib/action_controller/session/active_record_store.rb
  9. +0 −32 vendor/rails/actionpack/lib/action_controller/session/drb_server.rb
  10. +0 −35 vendor/rails/actionpack/lib/action_controller/session/drb_store.rb
  11. +0 −263 vendor/rails/actionpack/test/controller/cgi_test.rb
  12. +0 −156 vendor/rails/actionpack/test/controller/components_test.rb
  13. +0 −54 vendor/rails/actionpack/test/controller/http_authentication_test.rb
  14. +0 −43 vendor/rails/actionpack/test/controller/integration_upload_test.rb
  15. +0 −89 vendor/rails/actionpack/test/controller/session_fixation_test.rb
  16. +0 −178 vendor/rails/actionpack/test/controller/session_management_test.rb
  17. +0 −6 vendor/rails/activesupport/lib/active_support/testing/core_ext/test.rb
  18. +0 −72 vendor/rails/activesupport/lib/active_support/testing/core_ext/test/unit/assertions.rb
  19. +0 −194 vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n.rb
  20. +0 −216 vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/backend/simple.rb
  21. +0 −53 vendor/rails/activesupport/lib/active_support/vendor/i18n-0.0.1/i18n/exceptions.rb
  22. +0 −849 vendor/rails/activesupport/lib/active_support/vendor/memcache-client-1.5.1/memcache.rb
  23. +0 −1,021 vendor/rails/activesupport/lib/active_support/vendor/xml-simple-1.0.11/xmlsimple.rb
  24. +0 −3 vendor/rails/railties/bin/performance/request
  25. +0 −3 vendor/rails/railties/bin/process/inspector
  26. +0 −3 vendor/rails/railties/bin/process/reaper
  27. +0 −3 vendor/rails/railties/bin/process/spawner
  28. +0 −17 vendor/rails/railties/config.ru
  29. +0 −40 vendor/rails/railties/configs/apache.conf
  30. +0 −54 vendor/rails/railties/configs/lighttpd.conf
  31. +0 −1,185 vendor/rails/railties/doc/guides/html/2_2_release_notes.html
  32. +0 −1,270 vendor/rails/railties/doc/guides/html/actioncontroller_basics.html
  33. +0 −749 vendor/rails/railties/doc/guides/html/activerecord_validations_callbacks.html
  34. +0 −2,585 vendor/rails/railties/doc/guides/html/association_basics.html
  35. +0 −240 vendor/rails/railties/doc/guides/html/authors.html
  36. +0 −1,018 vendor/rails/railties/doc/guides/html/benchmarking_and_profiling.html
  37. +0 −583 vendor/rails/railties/doc/guides/html/caching_with_rails.html
  38. +0 −434 vendor/rails/railties/doc/guides/html/command_line.html
  39. +0 −438 vendor/rails/railties/doc/guides/html/configuring.html
  40. +0 −1,594 vendor/rails/railties/doc/guides/html/creating_plugins.html
  41. +0 −1,175 vendor/rails/railties/doc/guides/html/debugging_rails_applications.html
  42. +0 −1,090 vendor/rails/railties/doc/guides/html/finders.html
  43. +0 −638 vendor/rails/railties/doc/guides/html/form_helpers.html
  44. +0 −2,066 vendor/rails/railties/doc/guides/html/getting_started_with_rails.html
  45. +0 −349 vendor/rails/railties/doc/guides/html/index.html
  46. +0 −1,406 vendor/rails/railties/doc/guides/html/layouts_and_rendering.html
  47. +0 −921 vendor/rails/railties/doc/guides/html/migrations.html
  48. +0 −2,213 vendor/rails/railties/doc/guides/html/routing_outside_in.html
  49. +0 −1,346 vendor/rails/railties/doc/guides/html/security.html
  50. +0 −1,859 vendor/rails/railties/doc/guides/html/testing_rails_applications.html
  51. +0 −435 vendor/rails/railties/doc/guides/source/2_2_release_notes.txt
  52. +0 −5 vendor/rails/railties/doc/guides/source/actioncontroller_basics/changelog.txt
  53. +0 −34 vendor/rails/railties/doc/guides/source/actioncontroller_basics/cookies.txt
  54. +0 −32 vendor/rails/railties/doc/guides/source/actioncontroller_basics/csrf.txt
  55. +0 −119 vendor/rails/railties/doc/guides/source/actioncontroller_basics/filters.txt
  56. +0 −24 vendor/rails/railties/doc/guides/source/actioncontroller_basics/http_auth.txt
  57. +0 −40 vendor/rails/railties/doc/guides/source/actioncontroller_basics/index.txt
  58. +0 −9 vendor/rails/railties/doc/guides/source/actioncontroller_basics/introduction.txt
  59. +0 −39 vendor/rails/railties/doc/guides/source/actioncontroller_basics/methods.txt
  60. +0 −14 vendor/rails/railties/doc/guides/source/actioncontroller_basics/parameter_filtering.txt
  61. +0 −93 vendor/rails/railties/doc/guides/source/actioncontroller_basics/params.txt
  62. +0 −43 vendor/rails/railties/doc/guides/source/actioncontroller_basics/request_response_objects.txt
  63. +0 −67 vendor/rails/railties/doc/guides/source/actioncontroller_basics/rescue.txt
  64. +0 −187 vendor/rails/railties/doc/guides/source/actioncontroller_basics/session.txt
  65. +0 −91 vendor/rails/railties/doc/guides/source/actioncontroller_basics/streaming.txt
  66. +0 −40 vendor/rails/railties/doc/guides/source/actioncontroller_basics/verification.txt
  67. +0 −181 vendor/rails/railties/doc/guides/source/active_record_basics.txt
  68. +0 −404 vendor/rails/railties/doc/guides/source/activerecord_validations_callbacks.txt
  69. +0 −1,840 vendor/rails/railties/doc/guides/source/association_basics.txt
  70. +0 −39 vendor/rails/railties/doc/guides/source/authors.txt
  71. +0 −95 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/appendix.txt
  72. +0 −105 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/digging_deeper.txt
  73. +0 −185 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/edge_rails_features.txt
  74. +0 −27 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/gameplan.txt
  75. +0 −242 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/index.txt
  76. +0 −179 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/rubyprof.txt
  77. +0 −57 vendor/rails/railties/doc/guides/source/benchmarking_and_profiling/statistics.txt
  78. +0 −367 vendor/rails/railties/doc/guides/source/caching_with_rails.txt
  79. +0 −147 vendor/rails/railties/doc/guides/source/command_line.txt
  80. +0 −225 vendor/rails/railties/doc/guides/source/configuring.txt
  81. +0 −191 vendor/rails/railties/doc/guides/source/creating_plugins/acts_as_yaffle.txt
  82. +0 −46 vendor/rails/railties/doc/guides/source/creating_plugins/appendix.txt
  83. +0 −59 vendor/rails/railties/doc/guides/source/creating_plugins/controllers.txt
  84. +0 −123 vendor/rails/railties/doc/guides/source/creating_plugins/core_ext.txt
  85. +0 −69 vendor/rails/railties/doc/guides/source/creating_plugins/custom_route.txt
  86. +0 −1 vendor/rails/railties/doc/guides/source/creating_plugins/gem.txt
  87. +0 −89 vendor/rails/railties/doc/guides/source/creating_plugins/generator_method.txt
  88. +0 −51 vendor/rails/railties/doc/guides/source/creating_plugins/helpers.txt
  89. +0 −52 vendor/rails/railties/doc/guides/source/creating_plugins/index.txt
  90. +0 −156 vendor/rails/railties/doc/guides/source/creating_plugins/migration_generator.txt
  91. +0 −76 vendor/rails/railties/doc/guides/source/creating_plugins/models.txt
  92. +0 −69 vendor/rails/railties/doc/guides/source/creating_plugins/odds_and_ends.txt
  93. +0 −230 vendor/rails/railties/doc/guides/source/creating_plugins/test_setup.txt
  94. +0 −733 vendor/rails/railties/doc/guides/source/debugging_rails_applications.txt
  95. +0 −668 vendor/rails/railties/doc/guides/source/finders.txt
  96. +0 −345 vendor/rails/railties/doc/guides/source/form_helpers.txt
  97. +0 −1,256 vendor/rails/railties/doc/guides/source/getting_started_with_rails.txt
  98. BIN vendor/rails/railties/doc/guides/source/images/belongs_to.png
  99. BIN vendor/rails/railties/doc/guides/source/images/bullet.gif
  100. BIN vendor/rails/railties/doc/guides/source/images/csrf.png
  101. BIN vendor/rails/railties/doc/guides/source/images/habtm.png
  102. BIN vendor/rails/railties/doc/guides/source/images/has_many.png
  103. BIN vendor/rails/railties/doc/guides/source/images/has_many_through.png
  104. BIN vendor/rails/railties/doc/guides/source/images/has_one.png
  105. BIN vendor/rails/railties/doc/guides/source/images/has_one_through.png
  106. BIN vendor/rails/railties/doc/guides/source/images/header_backdrop.png
  107. +0 −5 vendor/rails/railties/doc/guides/source/images/icons/README
  108. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/1.png
  109. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/10.png
  110. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/11.png
  111. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/12.png
  112. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/13.png
  113. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/14.png
  114. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/15.png
  115. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/2.png
  116. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/3.png
  117. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/4.png
  118. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/5.png
  119. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/6.png
  120. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/7.png
  121. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/8.png
  122. BIN vendor/rails/railties/doc/guides/source/images/icons/callouts/9.png
  123. BIN vendor/rails/railties/doc/guides/source/images/icons/caution.png
  124. BIN vendor/rails/railties/doc/guides/source/images/icons/example.png
  125. BIN vendor/rails/railties/doc/guides/source/images/icons/home.png
  126. BIN vendor/rails/railties/doc/guides/source/images/icons/important.png
  127. BIN vendor/rails/railties/doc/guides/source/images/icons/next.png
  128. BIN vendor/rails/railties/doc/guides/source/images/icons/note.png
  129. BIN vendor/rails/railties/doc/guides/source/images/icons/prev.png
  130. BIN vendor/rails/railties/doc/guides/source/images/icons/tip.png
  131. BIN vendor/rails/railties/doc/guides/source/images/icons/up.png
  132. BIN vendor/rails/railties/doc/guides/source/images/icons/warning.png
  133. BIN vendor/rails/railties/doc/guides/source/images/polymorphic.png
  134. BIN vendor/rails/railties/doc/guides/source/images/rails_logo_remix.gif
  135. BIN vendor/rails/railties/doc/guides/source/images/ruby_on_rails_by_mike_rundle2.gif
  136. BIN vendor/rails/railties/doc/guides/source/images/session_fixation.png
  137. +0 −118 vendor/rails/railties/doc/guides/source/index.txt
  138. +0 −982 vendor/rails/railties/doc/guides/source/layouts_and_rendering.txt
  139. +0 −85 vendor/rails/railties/doc/guides/source/migrations/anatomy_of_a_migration.txt
  140. +0 −5 vendor/rails/railties/doc/guides/source/migrations/changelog.txt
  141. +0 −109 vendor/rails/railties/doc/guides/source/migrations/creating_a_migration.txt
  142. +0 −8 vendor/rails/railties/doc/guides/source/migrations/foreign_keys.txt
  143. +0 −22 vendor/rails/railties/doc/guides/source/migrations/index.txt
  144. +0 −111 vendor/rails/railties/doc/guides/source/migrations/rakeing_around.txt
  145. +0 −47 vendor/rails/railties/doc/guides/source/migrations/scheming.txt
  146. +0 −46 vendor/rails/railties/doc/guides/source/migrations/using_models_in_migrations.txt
  147. +0 −159 vendor/rails/railties/doc/guides/source/migrations/writing_a_migration.txt
  148. +0 −986 vendor/rails/railties/doc/guides/source/routing_outside_in.txt
  149. +0 −984 vendor/rails/railties/doc/guides/source/security.txt
  150. +0 −358 vendor/rails/railties/doc/guides/source/stylesheets/base.css
  151. +0 −35 vendor/rails/railties/doc/guides/source/stylesheets/forms.css
  152. +0 −82 vendor/rails/railties/doc/guides/source/stylesheets/more.css
  153. +0 −97 vendor/rails/railties/doc/guides/source/templates/guides.html.erb
  154. +0 −165 vendor/rails/railties/doc/guides/source/templates/inline.css
  155. +0 −995 vendor/rails/railties/doc/guides/source/testing_rails_applications.txt
  156. +0 −15 vendor/rails/railties/helpers/application.rb
  157. +0 −6 vendor/rails/railties/lib/commands/performance/request.rb
  158. +0 −68 vendor/rails/railties/lib/commands/process/inspector.rb
  159. +0 −149 vendor/rails/railties/lib/commands/process/reaper.rb
  160. +0 −219 vendor/rails/railties/lib/commands/process/spawner.rb
  161. +0 −57 vendor/rails/railties/lib/commands/process/spinner.rb
  162. +0 −31 vendor/rails/railties/lib/commands/servers/base.rb
  163. +0 −94 vendor/rails/railties/lib/commands/servers/lighttpd.rb
  164. +0 −69 vendor/rails/railties/lib/commands/servers/mongrel.rb
  165. +0 −16 vendor/rails/railties/lib/commands/servers/new_mongrel.rb
  166. +0 −25 vendor/rails/railties/lib/commands/servers/thin.rb
  167. +0 −66 vendor/rails/railties/lib/commands/servers/webrick.rb
  168. +0 −342 vendor/rails/railties/lib/rails/mongrel_server/commands.rb
  169. +0 −55 vendor/rails/railties/lib/rails/mongrel_server/handler.rb
  170. +0 −28 vendor/rails/railties/lib/rails/rack/logger.rb
@@ -1,14 +0,0 @@
-# Prefer gems to the bundled libs.
-require 'rubygems'
-
-begin
- gem 'tmail', '~> 1.2.3'
-rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/tmail-1.2.3"
-end
-
-begin
- gem 'text-format', '>= 0.6.3'
-rescue Gem::LoadError
- $:.unshift "#{File.dirname(__FILE__)}/vendor/text-format-0.6.3"
-end
@@ -1,69 +0,0 @@
-require 'test/unit/assertions'
-
-module ActionController #:nodoc:
- # In addition to these specific assertions, you also have easy access to various collections that the regular test/unit assertions
- # can be used against. These collections are:
- #
- # * assigns: Instance variables assigned in the action that are available for the view.
- # * session: Objects being saved in the session.
- # * flash: The flash objects currently in the session.
- # * cookies: Cookies being sent to the user on this request.
- #
- # These collections can be used just like any other hash:
- #
- # assert_not_nil assigns(:person) # makes sure that a @person instance variable was set
- # assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave"
- # assert flash.empty? # makes sure that there's nothing in the flash
- #
- # For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To
- # appease our yearning for symbols, though, an alternative accessor has been devised using a method call instead of index referencing.
- # So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work.
- #
- # On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.
- #
- # For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another
- # action call which can then be asserted against.
- #
- # == Manipulating the request collections
- #
- # The collections described above link to the response, so you can test if what the actions were expected to do happened. But
- # sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions
- # and cookies, though. For sessions, you just do:
- #
- # @request.session[:key] = "value"
- #
- # For cookies, you need to manually create the cookie, like this:
- #
- # @request.cookies["key"] = CGI::Cookie.new("key", "value")
- #
- # == Testing named routes
- #
- # If you're using named routes, they can be easily tested using the original named routes' methods straight in the test case.
- # Example:
- #
- # assert_redirected_to page_url(:title => 'foo')
- module Assertions
- def self.included(klass)
- %w(response selector tag dom routing model).each do |kind|
- require "action_controller/assertions/#{kind}_assertions"
- klass.module_eval { include const_get("#{kind.camelize}Assertions") }
- end
- end
-
- def clean_backtrace(&block)
- yield
- rescue Test::Unit::AssertionFailedError => error
- framework_path = Regexp.new(File.expand_path("#{File.dirname(__FILE__)}/assertions"))
- error.backtrace.reject! { |line| File.expand_path(line) =~ framework_path }
- raise
- end
- end
-end
-
-module Test #:nodoc:
- module Unit #:nodoc:
- class TestCase #:nodoc:
- include ActionController::Assertions
- end
- end
-end
@@ -1,18 +0,0 @@
-module ActionController #:nodoc:
- module Caching
- module SqlCache
- def self.included(base) #:nodoc:
- if defined?(ActiveRecord) && ActiveRecord::Base.respond_to?(:cache)
- base.alias_method_chain :perform_action, :caching
- end
- end
-
- protected
- def perform_action_with_caching
- ActiveRecord::Base.cache do
- perform_action_without_caching
- end
- end
- end
- end
-end
@@ -1,53 +0,0 @@
-require 'digest/md5'
-require 'cgi/session'
-require 'cgi/session/pstore'
-
-class CGI #:nodoc:
- # * Expose the CGI instance to session stores.
- # * Don't require 'digest/md5' whenever a new session id is generated.
- class Session #:nodoc:
- def self.generate_unique_id(constant = nil)
- ActiveSupport::SecureRandom.hex(16)
- end
-
- # Make the CGI instance available to session stores.
- attr_reader :cgi
- attr_reader :dbman
- alias_method :initialize_without_cgi_reader, :initialize
- def initialize(cgi, options = {})
- @cgi = cgi
- initialize_without_cgi_reader(cgi, options)
- end
-
- private
- # Create a new session id.
- def create_new_id
- @new_session = true
- self.class.generate_unique_id
- end
-
- # * Don't require 'digest/md5' whenever a new session is started.
- class PStore #:nodoc:
- def initialize(session, option={})
- dir = option['tmpdir'] || Dir::tmpdir
- prefix = option['prefix'] || ''
- id = session.session_id
- md5 = Digest::MD5.hexdigest(id)[0,16]
- path = dir+"/"+prefix+md5
- path.untaint
- if File::exist?(path)
- @hash = nil
- else
- unless session.new_session
- raise CGI::Session::NoSession, "uninitialized session"
- end
- @hash = {}
- end
- @p = ::PStore.new(path)
- @p.transaction do |p|
- File.chmod(0600, p.path)
- end
- end
- end
- end
-end
@@ -1,169 +0,0 @@
-module ActionController #:nodoc:
- # Components allow you to call other actions for their rendered response while executing another action. You can either delegate
- # the entire response rendering or you can mix a partial response in with your other content.
- #
- # class WeblogController < ActionController::Base
- # # Performs a method and then lets hello_world output its render
- # def delegate_action
- # do_other_stuff_before_hello_world
- # render_component :controller => "greeter", :action => "hello_world", :params => { :person => "david" }
- # end
- # end
- #
- # class GreeterController < ActionController::Base
- # def hello_world
- # render :text => "#{params[:person]} says, Hello World!"
- # end
- # end
- #
- # The same can be done in a view to do a partial rendering:
- #
- # Let's see a greeting:
- # <%= render_component :controller => "greeter", :action => "hello_world" %>
- #
- # It is also possible to specify the controller as a class constant, bypassing the inflector
- # code to compute the controller class at runtime:
- #
- # <%= render_component :controller => GreeterController, :action => "hello_world" %>
- #
- # == When to use components
- #
- # Components should be used with care. They're significantly slower than simply splitting reusable parts into partials and
- # conceptually more complicated. Don't use components as a way of separating concerns inside a single application. Instead,
- # reserve components to those rare cases where you truly have reusable view and controller elements that can be employed
- # across many applications at once.
- #
- # So to repeat: Components are a special-purpose approach that can often be replaced with better use of partials and filters.
- module Components
- def self.included(base) #:nodoc:
- base.class_eval do
- include InstanceMethods
- include ActiveSupport::Deprecation
- extend ClassMethods
- helper HelperMethods
-
- # If this controller was instantiated to process a component request,
- # +parent_controller+ points to the instantiator of this controller.
- attr_accessor :parent_controller
-
- alias_method_chain :process_cleanup, :components
- alias_method_chain :set_session_options, :components
- alias_method_chain :flash, :components
-
- alias_method :component_request?, :parent_controller
- end
- end
-
- module ClassMethods
- # Track parent controller to identify component requests
- def process_with_components(request, response, parent_controller = nil) #:nodoc:
- controller = new
- controller.parent_controller = parent_controller
- controller.process(request, response)
- end
- end
-
- module HelperMethods
- def render_component(options)
- @controller.__send__(:render_component_as_string, options)
- end
- end
-
- module InstanceMethods
- # Extracts the action_name from the request parameters and performs that action.
- def process_with_components(request, response, method = :perform_action, *arguments) #:nodoc:
- flash.discard if component_request?
- process_without_components(request, response, method, *arguments)
- end
-
- protected
- # Renders the component specified as the response for the current method
- def render_component(options) #:doc:
- component_logging(options) do
- render_for_text(component_response(options, true).body, response.headers["Status"])
- end
- end
- deprecate :render_component => "Please install render_component plugin from http://github.com/rails/render_component/tree/master"
-
- # Returns the component response as a string
- def render_component_as_string(options) #:doc:
- component_logging(options) do
- response = component_response(options, false)
-
- if redirected = response.redirected_to
- render_component_as_string(redirected)
- else
- response.body
- end
- end
- end
- deprecate :render_component_as_string => "Please install render_component plugin from http://github.com/rails/render_component/tree/master"
-
- def flash_with_components(refresh = false) #:nodoc:
- if !defined?(@_flash) || refresh
- @_flash =
- if defined?(@parent_controller)
- @parent_controller.flash
- else
- flash_without_components
- end
- end
- @_flash
- end
-
- private
- def component_response(options, reuse_response)
- klass = component_class(options)
- request = request_for_component(klass.controller_name, options)
- new_response = reuse_response ? response : response.dup
-
- klass.process_with_components(request, new_response, self)
- end
-
- # determine the controller class for the component request
- def component_class(options)
- if controller = options[:controller]
- controller.is_a?(Class) ? controller : "#{controller.camelize}Controller".constantize
- else
- self.class
- end
- end
-
- # Create a new request object based on the current request.
- # The new request inherits the session from the current request,
- # bypassing any session options set for the component controller's class
- def request_for_component(controller_name, options)
- new_request = request.dup
- new_request.session = request.session
-
- new_request.instance_variable_set(
- :@parameters,
- (options[:params] || {}).with_indifferent_access.update(
- "controller" => controller_name, "action" => options[:action], "id" => options[:id]
- )
- )
-
- new_request
- end
-
- def component_logging(options)
- if logger
- logger.info "Start rendering component (#{options.inspect}): "
- result = yield
- logger.info "\n\nEnd of component rendering"
- result
- else
- yield
- end
- end
-
- def set_session_options_with_components(request)
- set_session_options_without_components(request) unless component_request?
- end
-
- def process_cleanup_with_components
- process_cleanup_without_components unless component_request?
- end
- end
- end
-end
Oops, something went wrong.

0 comments on commit 7d04b93

Please sign in to comment.