aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/abstract_controller
Commit message (Collapse)AuthorAgeFilesLines
* [Abstract Controller] require => require_relativeAkira Matsuda2017-07-012-2/+2
|
* Remove useless class checking for `ActiveSupport::Callbacks`s result_lambdafatkodima2017-06-271-1/+1
|
* Allow translate default option to accept an array similar to i18n.t. Fixes ↵Vipul A M2017-06-151-1/+1
| | | | #29441
* Add option for class_attribute default (#29270)David Heinemeier Hansson2017-05-292-7/+3
| | | | | | | | | | | | * Allow a default value to be declared for class_attribute * Convert to using class_attribute default rather than explicit setter * Removed instance_accessor option by mistake * False is a valid default value * Documentation
* Merge pull request #29072 from ↵Robin Dupret2017-05-211-0/+20
|\ | | | | | | | | dixpac/dixpac/add_documentation_for_validate_and_callback_order_of_execution Improving docs for callbacks execution order [ci skip]
| * Improving docs for callbacks execution order [ci skip]dixpac2017-05-211-0/+20
| | | | | | | | | | When define callbacks latest definition on the same callback/method overwrites previous ones.
* | Merge pull request #29134 from joshaidan/document-action-nameAlex Kitchens2017-05-191-0/+8
|\ \ | | | | | | Add documentation to accessors in AbstractController::Base
| * | Clarified description of formats [ci skip]Brian Jones2017-05-191-1/+1
| | |
| * | Added missing punctuation [ci skip]Brian Jones2017-05-181-3/+3
| | |
| * | Specify only the body of the response is returned [ci skip]Brian Jones2017-05-181-1/+1
| | |
| * | Document accessors response_body, action_name, formats [ci skip]Brian Jones2017-05-171-0/+8
| |/
* / Use recyclable cache keys (#29092)David Heinemeier Hansson2017-05-181-7/+28
|/
* Unfreeze interpolated string because it's useless.Stan Lo2017-02-191-1/+1
|
* Freeze fragment cache related instrument name.Stan Lo2017-02-071-1/+1
| | | | | | | | | | | | | ActionMailer::Base#instrument_name and ActionController::Base#instrument_name will be frequently called once caching is enabled. So it's better to freeze them instead of create new string on every call. Also, the instrument name in #instrument_fragment_cache will usually be "write_fragment.action_controller" or "read_fragment.action_controller". So freezing them might also gain some performance improvement. We have done something like this in other places: https://github.com/rails/rails/blob/master/actionview/lib/action_view/template.rb#L348
* Change ActionView ERB Handler from Erubis to ErubiJeremy Evans2017-01-251-2/+0
| | | | | | | | | | | | | | | | | | | | | | | Erubi offers the following advantages for Rails: * Works with ruby's --enable-frozen-string-literal option * Has 88% smaller memory footprint * Does no freedom patching (Erubis adds a method to Kernel) * Has simpler internals (1 file, <150 lines of code) * Has an open development model (Erubis doesn't have a public source control repository or bug tracker) * Is not dead (Erubis hasn't been updated since 2011) Erubi is a simplified fork of Erubis that contains just the parts that are generally needed (which includes the parts that Rails uses). The only intentional difference in behavior is that it does not include support for <%=== tags for debug output. That could be added to the ActionView ERB handler if it is desired. The Erubis template handler remains in a deprecated state so that code that accesses it directly does not break. It can be removed after Rails 5.1.
* Extract variant setter to process methodJon Moss2017-01-021-4/+4
| | | | | | | Provide an API interface similar to how format is handled in Controllers. In situations where variants are not needed (ex: in Action Mailer) the method will simply trigger a no-op, and will not affect end users.
* Privatize unneededly protected methods in Action PackAkira Matsuda2016-12-242-3/+3
|
* Merge pull request #26905 from bogdanvlviv/docsAndrew White2016-11-131-4/+4
|\ | | | | Add missing `+` around a some literals.
| * Add missing `+` around a some literals.bogdanvlviv2016-10-271-4/+4
| | | | | | | | | | | | Mainly around `nil` [ci skip]
* | Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
| |
* | removes requires already present in active_support/railsXavier Noria2016-10-271-2/+0
|/
* Remove deprecated methods related to controller filtersRafael Mendonça França2016-10-091-39/+0
| | | | | | | | | | `skip_action_callback`, `skip_filter`, `before_filter`, `prepend_before_filter`, `skip_before_filter`, `append_before_filter`, `around_filter` `prepend_around_filter`, `skip_around_filter`, `append_around_filter`, `after_filter`, `prepend_after_filter`, `skip_after_filter` and `append_after_filter`.
* Fix broken comments indentation caused by rubocop auto-correct [ci skip]Ryuta Kamizono2016-09-141-6/+6
| | | | | | All indentation was normalized by rubocop auto-correct at 80e66cc4d90bf8c15d1a5f6e3152e90147f00772. But comments was still kept absolute position. This commit aligns comments with method definitions for consistency.
* Add three new rubocop rulesRafael Mendonça França2016-08-162-2/+2
| | | | | | | | Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
* code gardening: removes redundant selfsXavier Noria2016-08-081-1/+1
| | | | | | | | | A few have been left for aesthetic reasons, but have made a pass and removed most of them. Note that if the method `foo` returns an array, `foo << 1` is a regular push, nothing to do with assignments, so no self required.
* Modify LogSubscriber for single partial's cache message.Stan Lo2016-08-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implement naive partial caching mechanism. Add test for LogSubscriber Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it. Fixed tests Remove useless settings Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload. Update test's hash syntax Add configuration to enable/disable fragment caching logging Remove unless test and add new test to ensure cache info won't effect next rendering's log Move :enable_fragment_cache_logging config from ActionView to ActionPack Apply new config to tests Update actionview's changelog Update configuration guide Improve actionview's changelog Refactor PartialRenderer#render and log tests Mute subscriber's log instead of disabling instrumentation. Fix typo, remove useless comment and use new hash syntax Improve actionpack's log_subscriber test Fix rebase mistake Apply new config to all caching intstrument actions
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-12/+12
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-066-19/+19
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* render_to_string Regression Outside of Real Requests in Rails 5.0.0.rc1 (#25308)Brandon Medenwald2016-06-091-1/+1
| | | | | | * Restore the functionality of PR#14129, but do so with not nil to better indicate the purpose of the conditional * Add a test when render_to_string called on ActionController::Base.new()
* Use `#performed?` to terminate controller callbacksJeff Kreeftmeijer2016-06-032-1/+8
| | | | | | | | | | | | | | | Since 69009f, `ActionController::Metal::DataStreaming#send_file` doesn't set `@_response_body` anymore. `AbstractController::Callbacks` used `@_response_body` in its callback terminator, so it failed to halt the callback cycle when using `#send_file` from a `before_action`. Instead, it now uses `#performed?` on `AbstractController::Base` and `ActionController::Metal`, which checks `response.committed?`, besides checking if `@_response_body` is set, if possible. Example application: https://gist.github.com/jeffkreeftmeijer/78ae4572f36b198e729724b0cf79ef8e
* Revert "Make sure the cache is always populated"Rafael Mendonça França2016-05-201-5/+1
| | | | | | This reverts commit 0ce7eae7418f1b9bb06b351c1f26d50c3674c0d0. Tests were broken https://travis-ci.org/rails/rails/jobs/131850726#L520
* Make sure the cache is always populatedAaron Patterson2016-05-201-1/+5
| | | | This way we don't have to make multiple calls on anonymous controllers
* Move protected instance variable to the right placeRafael Mendonça França2016-05-051-3/+1
| | | | | | | | | There were a lot of protected instance variables in AbsctractController::Rendering that were related to Action Controller and Action View. Moving to ActionController::Base's protected instance list we make it closer to where they are really defined.
* Actioncable and Actionpack documentation typos [ci skip]Tom Kadwill2016-04-211-1/+1
|
* Break up a circular require between AP/AVSean Griffin2016-03-113-3/+6
| | | | | | | | | | | | | | | | | | Right now referencing the constant `AbstractController::Rendering` causes `ActionView::Base` to be loaded, and thus the load hooks for action_view are run. If that load hook references any part of action view that then references action controller (such as `ActionView::TestCase`), the constant `AbstractController::Rendering` will attempt to be autoloaded and blow up. With this change, `ActionView::LoadPaths` no longer requires `ActionView::Base` (which it had no reason to require). There was a needed class from `AbstractController::Base` in the Rendering module, which I've moved into its own file so we don't need to load all of `AbstractController::Base` there. This commit fixes https://github.com/rails/rails-controller-testing/issues/21
* Merge pull request #24091 from mcfiredrill/fix-helper-method-docsRafael França2016-03-071-1/+2
|\ | | | | clarify that helper_method makes both methods available in the view [ci skip]
| * clarify that helper_method makes both methods available in the viewTony Miller2016-03-071-1/+2
| | | | | | | | | | It's probably obvious to most, but clarify that `:helper_method` will make both of these methods available to the view.
* | Move Caching module to Abstract ControllerRafael Mendonça França2016-02-232-0/+205
|/ | | | | | Abstract Controller is the common component between Action Mailer and Action Controller so if we need to share the caching component it need to be there.
* fix permitted? conditional for `render` callsAaron Patterson2016-01-261-3/+6
|
* Fix undefined error for `ActionController::Parameters`Jon Moss2016-01-261-6/+3
|
* Merge branch '5-0-beta-sec'Aaron Patterson2016-01-251-1/+7
|\ | | | | | | | | | | | | | | | | | | | | * 5-0-beta-sec: bumping version fix version update task to deal with .beta1.1 Eliminate instance level writers for class accessors allow :file to be outside rails root, but anything else must be inside the rails view directory Don't short-circuit reject_if proc stop caching mime types globally use secure string comparisons for basic auth username / password
| * allow :file to be outside rails root, but anything else must be inside the ↵Aaron Patterson2016-01-221-1/+7
| | | | | | | | | | | | rails view directory CVE-2016-0752
* | Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-12-201-2/+2
|\ \ | |/ |/|
| * Add missing punctuation mark [ci skip]Gaurav Sharma2015-11-181-2/+2
| |
* | Deprecate passing string to define callback.yui-knk2015-12-161-1/+2
|/
* Merge branch 'master' of github.com:rails/docrailsVijay Dev2015-11-151-5/+5
|\
| * adding missing `.` Gaurav Sharma2015-11-151-5/+5
| |
* | remove present? call; we do not need itAaron Patterson2015-11-021-1/+1
|/
* Revert "ActionController::Base#process() now only takes an action name"Aaron Patterson2015-10-291-2/+2
| | | | This reverts commit 9f93a5efbba3e1cbf0bfa700a17ec8d1ef60d7c6.