Commit Graph

9526 Commits

Author SHA1 Message Date
Godfrey Chan
0d4d52a1cf Add missing require 2014-08-18 21:33:00 -07:00
Rafael Mendonça França
9cb4d3e03b Deprecate TagAssertion instead of removing 2014-08-18 20:20:41 -03:00
Rafael Mendonça França
d2d809868c Merge pull request #15889 from carnesmedia/model-name
Use #model_name on instances instead of classes
2014-08-17 23:01:13 -03:00
Rafael Mendonça França
cdc00aba62 Merge branch 'loofah'
Conflicts:
	Gemfile
2014-08-17 22:51:13 -03:00
Rafael Mendonça França
c78da4d5c4 Merge branch 'master' into loofah
Conflicts:
	actionpack/CHANGELOG.md
2014-08-17 22:38:22 -03:00
Lucas Mazza
9ee64f07f7 Deprecate NamedRouteCollection#helpers.
This method was removed at 210b338db20b1cdd0684f40bd78b52ed16148b99 but it is
used by third party gems to check if a named route was defined. To help on the
upgrade path on 4.2.0 we bring it back and emit a deprecation warning.
2014-08-17 22:36:22 -03:00
Godfrey Chan
e158ee50e6 Use AS::JSON for (de)serializing cookies
Use the Active Support JSON encoder for cookie jars using the `:json` or
`:hybrid` serializer. This allows you to serialize custom Ruby objects into
cookies by defining the `#as_json` hook on such objects.

Fixes #16520.
2014-08-17 12:41:42 -07:00
Godfrey Chan
a485633b16 responders 1.x won't do it. Told you to RTFM for details! 2014-08-17 12:19:23 -07:00
Godfrey Chan
b662273df3 The gem is called 'responders' 2014-08-17 11:58:17 -07:00
Godfrey Chan
24226c51f0 Raise a more helpful error for people who are using these extracted features 2014-08-17 11:54:09 -07:00
Godfrey Chan
beff925c32 Merge pull request #16467 from strzalek/cookies-digest-config-option2
Cookies digest config option (pt. 2)

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_dispatch/middleware/cookies.rb
2014-08-17 11:23:14 -07:00
Godfrey Chan
14965baa09 Merge pull request #16484 from strzalek/remove-redundant-null-serializer
Remove redundant NullSerializer
2014-08-17 11:07:00 -07:00
José Valim
ee77770d57 Move respond_with to the responders gem
respond_with (and consequently the class-level respond_to)
are being removed from Rails. Instead of moving it to a 3rd
library, the functionality will be moved to responders gem
(at github.com/plataformatec/responders) which already provides
some responders extensions.
2014-08-17 13:20:22 -04:00
Jeremy Kemper
6c96602bc1 When your templates change, browser caches bust automatically.
New default: the template digest is automatically included in your ETags.
When you call `fresh_when @post`, the digest for `posts/show.html.erb`
is mixed in so future changes to the HTML will blow HTTP caches for you.
This makes it easy to HTTP-cache many more of your actions.

If you render a different template, you can now pass the `:template`
option to include its digest instead:

  fresh_when @post, template: 'widgets/show'

Pass `template: false` to skip the lookup. To turn this off entirely, set:

  config.action_controller.etag_with_template_digest = false
2014-08-17 06:52:17 -07:00
Aaron Patterson
6c51cc85da extract methods and metaprogram less. 2014-08-14 10:23:28 -07:00
Yves Senn
a1ddde15ae remove deprecated MissingHelperError proxy.
The error was moved outside of the `ClassMethods` module.
2014-08-14 09:37:21 +02:00
Yves Senn
9c91c168ab Merge pull request #16027 from tgxworld/template_assertions
Fixes to ActionController::TemplateAssertions
2014-08-14 08:38:35 +02:00
Aaron Patterson
43ce6e22b1 ask the scope object if it is a resource_method_scope 2014-08-13 19:47:26 -07:00
Aaron Patterson
e4cb3819df ask the scope for the action name 2014-08-13 19:44:05 -07:00
Aaron Patterson
374d66be3e reduce calls to scope_level
this will help us to encapsulate magical symbols so hopefully we can
eliminate hardcoded magic symbols
2014-08-13 19:40:57 -07:00
Aaron Patterson
047af8dd3c change to attr_reader 2014-08-13 19:30:47 -07:00
Aaron Patterson
677bc212eb scope_level is no longer a hash key, just use the ivar 2014-08-13 19:30:47 -07:00
Aaron Patterson
19bb6770c0 move the scope level key fully inside the scope object 2014-08-13 19:30:46 -07:00
Aaron Patterson
911ef972a5 move scope_level to a method on the scope object
now we don't have to have a hard coded key
2014-08-13 19:30:46 -07:00
Aaron Patterson
0127f02826 only look up scope level once
avoid hash lookups and remove depency on the instance
2014-08-13 19:13:58 -07:00
Aaron Patterson
91608dc342 only test prefix once
we don't need to repeat if statements
2014-08-13 18:47:16 -07:00
Aaron Patterson
318eea062e pass consistent parameters to canonical_action?
now we only have to look up @scope[:scope_level] once per call to
canonical_action? and we don't have a variable named "flag"
2014-08-13 18:42:26 -07:00
Aaron Patterson
3b908cba28 fewer operations on the options hash
since we pass `as` down, then we won't have to do an insert / delete
dance with the options hash
2014-08-13 18:34:21 -07:00
Aaron Patterson
d4981c393b this should be accessing the hash, not calling a method 2014-08-13 14:31:55 -07:00
Łukasz Strzałkowski
1a6ca03aec Remove redundant NullSerializer
Use one from ActiveSupport::MessageEncryptor module.
2014-08-13 23:09:19 +02:00
Guo Xiang Tan
b1ba333ea7 Fix assert_template for files.
The test was not failing for `assert_template file: nil` when a file
has been rendered.
2014-08-14 00:03:32 +08:00
Aditya Kapoor
2c8714568b [ci skip] correct default cache store class 2014-08-13 18:56:03 +05:30
Łukasz Strzałkowski
29be3f5d83 Add config option for cookies digest
You can now configure custom digest for cookies in the same way as `serializer`:

  config.action_dispatch.cookies_digest = 'SHA256'
2014-08-12 21:57:51 +02:00
Rafael Mendonça França
a2400308ea Merge branch 'master' into loofah
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/controller/integration_test.rb
	actionview/CHANGELOG.md
2014-08-12 11:10:42 -03:00
Akshay Vishnoi
51a759a745 use 'based on' instead of 'based off' [ci skip] 2014-08-12 18:40:14 +05:30
Santiago Pastorino
9c6c5aa929 Merge pull request #16440 from tgxworld/pass_log_in_block
Pass block for logging.
2014-08-09 10:42:45 -03:00
Guo Xiang Tan
bc53543cb3 Pass block for logging.
This follows the good practice listed on http://guides.rubyonrails.org/debugging_rails_applications.html#impact-of-logs-on-performance.
2014-08-09 13:47:24 +08:00
Santiago Pastorino
d70ba48c4d Revert "Merge pull request #16434 from strzalek/cookies-digest-config-option"
This reverts commit 705977620539e2be6548027042f33175ebdc2505, reversing
changes made to dde91e9bf5ab246f0f684b40288b272f4ba9a699.

IT BROKE THE BUILD!!!
2014-08-08 18:20:33 -03:00
Łukasz Strzałkowski
cfbedd3479 Add config option for cookies digest
You can now configure custom digest for cookies in the same way as `serializer`:

config.action_dispatch.cookies_digest = \SHA256'
2014-08-08 21:20:27 +02:00
Ryan Dao
1ed264bc60 Retrieve source code for the entire stack trace
Provide the ability to extract the source code of the entire exception stack
trace, not just the frame raising the error. This improves debugging
capability of the error page, especially for framework-related errors.
2014-08-08 15:04:55 +07:00
Guo Xiang Tan
14508aec70 Remove ActionController::RaiseActionExceptions.
The latest modification to the code was done in https://github.com/rails/rails/commit/5e3517ea. In Rails 3.2,
`ActionController#rescue_action` was deprecated and `rescue_action_without_handler` is no longer being used.
2014-08-07 17:43:36 +08:00
Aaron Patterson
2090615d39 refactor Redirecting so we do not need a controller instance 2014-08-06 14:17:57 -07:00
Aaron Patterson
3300fdedc7 avoid testing only_path
we know that this call only wants the path returned, so lets call a
method that returns the path.
2014-08-04 18:20:07 -07:00
Santiago Pastorino
930110b045 Regenerate sid when sbdy tries to fixate the session
Fixed broken test.

Thanks Stephen Richards for reporting.
2014-08-04 11:33:19 -03:00
Jack Danger Canty
0b8f35dd9c Using no_result_var in Journey's parser generator
Previously the generated parser had an intermediate local variable
`result` that really useful if you're building up a stateful object but
Journey always discards the result argument to the reduce functions.

This produces a simpler parser for anybody who actually wants to read
the thing.

Sadly, there's no real performance speedup with this change.
2014-08-03 15:23:56 -07:00
Vijay Dev
3bf2a4c0d2 Merge branch 'master' of github.com:rails/docrails
Conflicts:
	guides/source/testing.md
2014-08-02 12:09:07 +00:00
Vijay Dev
d9bd75a0d8 copy edits[ci skip] 2014-08-02 12:05:26 +00:00
Aaron Patterson
ea7fc2e7c0 just set the host, no need for another hash allocation / merge! 2014-08-01 11:55:47 -07:00
Aaron Patterson
8cbcd19d70 always return a string from find_script_name
this allows us to avoid nil checks on the return value
2014-08-01 11:45:59 -07:00
Aaron Patterson
e9bbe4a106 use get instead of accessing the named routes internals 2014-07-31 15:26:53 -07:00