Commit Graph

4714 Commits

Author SHA1 Message Date
Jeremy Kemper
781985f7f2 Cookie session store: empty and unchanged sessions don't write a cookie.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6226 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 16:35:24 +00:00
Michael Koziarski
c9770d8a5a Allow users to provide custom formatters to Logger. [aeden] Closes #7106, #2484
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6225 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-25 00:07:54 +00:00
Rick Olson
ad9bacb189 fix app generator
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6224 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-24 22:36:52 +00:00
David Heinemeier Hansson
08a533645e Make it a default assumption that you want all helpers, all the time (yeah, yeah)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6222 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-24 20:33:47 +00:00
David Heinemeier Hansson
f95dfff966 Added helper(:all) as a way to include all helpers from app/helpers/**/*.rb in ApplicationController [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6221 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-24 20:31:34 +00:00
David Heinemeier Hansson
351eea1fcd No s on config
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6214 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-23 01:10:25 +00:00
David Heinemeier Hansson
7bf757d8b8 Include two default initializers as examples
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6213 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-23 00:53:22 +00:00
David Heinemeier Hansson
c6d6082562 Added config/initializers where all ruby files within it are automatically loaded after the Rails configuration is done, so you don't have to litter the environment.rb file with a ton of mixed stuff [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6212 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-23 00:32:27 +00:00
David Heinemeier Hansson
b50a05cac3 Move session settings closer together
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6211 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-23 00:09:22 +00:00
Jamis Buck
f9a4774e0e Make sure parsed emails recognize attachments nested in multpart parts (closes #6714)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6207 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 19:04:00 +00:00
Jamis Buck
b6923c2b29 Fix broken tests
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6206 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 19:02:14 +00:00
Jeremy Kemper
f2fb711152 Ruby 1.8.6 compatibility.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6204 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 11:00:06 +00:00
Jeremy Kemper
236fe10fe9 Integration tests: introduce methods for other HTTP methods. Closes #6353.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6203 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 09:28:10 +00:00
Jeremy Kemper
f425bba9cf Use the query cache iff Active Record is configured.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6202 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 08:14:47 +00:00
Jeremy Kemper
c8f7860d50 CGI escape the session cookie.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6200 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 01:17:28 +00:00
Jeremy Kemper
223509ba7d Oops, don't omit the session_key since it's used as the cookie name.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6199 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 01:07:51 +00:00
Jeremy Kemper
5a1251dc2d Session configuration in config/environment.rb instead of app/controllers/application.rb
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6198 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-22 00:57:02 +00:00
Jeremy Kemper
45dd256889 Missed commit for [6184]. Generate a random secret for new app's cookie session store.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6197 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 23:13:32 +00:00
David Heinemeier Hansson
25bb98e42d Added database connection as a yield parameter to ActiveRecord::Base.transaction so you can manually rollback [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6196 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 22:13:39 +00:00
Tobias Lütke
7842caed94 Fixed query cache when multiple database connections were involved
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6195 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 21:54:41 +00:00
Tobias Lütke
2ffbc6115e Enable active record cache automatically for all actions
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 18:08:39 +00:00
David Heinemeier Hansson
9b854c22b1 Added subdirectory test
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6188 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 15:58:42 +00:00
David Heinemeier Hansson
7f55931f80 Make sure that the filesystem is not involved with asset hosting
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6187 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 15:28:37 +00:00
Jeremy Kemper
de0a0d700e Routing: better support for escaped values in route segments. Closes #7544.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6185 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 10:05:07 +00:00
Jeremy Kemper
f29857690f Introduce a cookie-based session store as the Rails default. Sessions typically contain at most a user_id and flash message; both fit within the 4K cookie size limit. A secure hash is included with the cookie to ensure data integrity (a user cannot alter his user_id without knowing the secret key included in the hash). If you have more than 4K of session data or don't want your data to be visible to the user, pick another session store. Cookie-based sessions are dramatically faster than the alternatives.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6184 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 09:17:38 +00:00
David Heinemeier Hansson
2afc01b7ce Make assert_select access content_type through accessor instead of header
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6181 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 00:40:58 +00:00
David Heinemeier Hansson
21187c0fb4 Apply the rest of Chads patch
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-21 00:29:44 +00:00
Tobias Lütke
b5419cd66e You can now use cache in instance hierachies. This allows ActiveRecord::Base.cache { } usage to cache everything
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6179 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 23:42:04 +00:00
David Heinemeier Hansson
e105653066 Added .erb and .builder as preferred aliases to the now deprecated .rhtml and .rxml extensions [Chad Fowler]. This is done to separate the renderer from the mime type. .erb templates are often used to render emails, atom, csv, whatever. So labeling them .rhtml doesn't make too much sense. The same goes for .rxml, which can be used to build everything from HTML to Atom to whatever. .rhtml and .rxml will continue to work until Rails 3.0, though. So this is a slow phasing out. All generators and examples will start using the new aliases, though.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6178 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 22:09:12 +00:00
Michael Koziarski
89cb34c9cf Stop swallowing errors during rake test [Koz]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6176 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-20 03:15:26 +00:00
Jeremy Kemper
772e02dd62 Factor out unique id generator. Expose cgi to session store.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6174 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 23:51:25 +00:00
David Heinemeier Hansson
9e4c8b8858 Fix tests depending too deep
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6169 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:25:01 +00:00
David Heinemeier Hansson
94fa0ed053 Its ETag not Etag
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6168 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:10:19 +00:00
David Heinemeier Hansson
bd0cd04374 Set cache-control to private if theres an etag available (and the cache-control hasnt been overwritten already)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 02:04:26 +00:00
David Heinemeier Hansson
372db1cd9e Dont ask for no caching if we have a etag to base that decision on
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6166 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 01:33:35 +00:00
David Heinemeier Hansson
7ec0204ecd Move etagging down to response, so renders with layouts dont screw it up [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6165 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-19 00:27:19 +00:00
David Heinemeier Hansson
aad7fbde68 Added caching option to AssetTagHelper#stylesheet_link_tag and AssetTagHelper#javascript_include_tag [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6164 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 23:54:20 +00:00
David Heinemeier Hansson
109d4ac954 Allow people to set their own etags, if they want more control over the process (closes #7580) []
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6163 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 16:32:05 +00:00
Jeremy Kemper
c9260c556c Add request protocol to asset host if not given. Prefer setting asset host as hostname only, no request protocol.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6162 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 07:23:57 +00:00
Jeremy Kemper
90c1207c38 Work around the two connection per host browser limit: use asset%d.myapp.com to distribute asset requests among asset[0123].myapp.com. Use a DNS wildcard or CNAMEs to map these hosts to your asset server. See http://www.die.net/musings/page_load_time/ for background.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6161 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 06:44:20 +00:00
Jeremy Kemper
4fd84aae90 Etagging ignores appended and block responses.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6160 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 00:47:18 +00:00
David Heinemeier Hansson
392c7f7314 Added default mime type for CSS (Mime::CSS) [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6159 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-18 00:00:14 +00:00
David Heinemeier Hansson
2e55095f6f Added that rendering will automatically insert the etag header on 200 OK responses. The etag is calculated using MD5 of the response body. If a request comes in that has a matching etag, the response will be changed to a 304 Not Modified and the response body will be set to an empty string. [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6158 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-17 18:16:44 +00:00
David Heinemeier Hansson
cfa7df3fbb Added X-Runtime to all responses with the request run time [DHH] (rename from X-Benchmark)
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6157 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-17 05:11:55 +00:00
David Heinemeier Hansson
c74c78c88d Added X-Benchmark to all responses with the same benchmark data as goes into the log [DHH]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6156 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-16 21:13:02 +00:00
David Heinemeier Hansson
06669f8b13 In tests, content_type can be nil, which would disturb accepts/format
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6155 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 18:52:08 +00:00
Rick Olson
e312cc3215 remove Mime::PLAIN from tests so its not confused with the default Mime::TEXT mime type
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6153 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 16:40:38 +00:00
Rick Olson
5d54b8f07c Add Mime::Type convenience methods to check the current mime type. [Rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6152 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-15 16:25:46 +00:00
Jeremy Kemper
5b7630e174 MySQL disallows TEXT defaults so don't test for them.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6149 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-11 09:17:10 +00:00
Jeremy Kemper
002c0aeef3 Hash#to_query CGI-escapes its keys.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6148 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
2007-02-11 06:29:04 +00:00