Commit Graph

10419 Commits

Author SHA1 Message Date
Akira Matsuda
230d43fbf5 Ruby 1.9.2 compat: Array#* uses to_str instead of to_s to join values since Ruby 1.9.2
[#2959 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-05 17:08:02 -07:00
James Tucker
b7052b8dc3 Dont require thin as the thin rack adapter is now upstream
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-05 23:00:33 +01:00
James Hill
cfd421daa2 Allow validations to use values from custom readers [#2936 state:resolved]
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-05 11:45:01 -05:00
Matthew Rudy Jacobs
64268a0b06 Make sure javascript_include_tag/stylesheet_link_tag does not append ".js" or ".css" onto external urls [#1664 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
2009-08-05 15:58:55 +01:00
Geoff Buesing
bfafe8c405 Revert "fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years" [#2019 state:wontfix]
This reverts commit 55d1d12c32.
2009-08-05 08:26:12 -05:00
Joshua Peek
f8d3c72c39 Extract generic attribute method generation to AMo 2009-08-04 23:36:05 -05:00
Joshua Peek
64eecdd131 whitespace 2009-08-04 16:28:44 -05:00
Paul Gillard
bada18dc36 Added reset_attribute! method to ActiveRecord::AttributeMethods::Dirty which will reset an attribute to its original value should it have changed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-04 16:23:08 -05:00
Paul Gillard
c30a0ce3c8 Modified ActiveRecord::AttributeMethods to allow classes to specify attribute method prefixes and/or suffixes. Previously only suffixes were allowed.
Signed-off-by: Joshua Peek <josh@joshpeek.com>
2009-08-04 16:19:19 -05:00
Joshua Peek
aad5a30bf2 Add simple support for ActiveModel's StateMachine for ActiveRecord 2009-08-04 11:03:57 -05:00
Matt Ganderup
55d1d12c32 fallback_string_to_date sets Date._parse comp arg to true, so that strings with two-digit years, e.g. '1/1/09', are interpreted as modern years [#2019 state:resolved] 2009-08-03 22:41:56 -05:00
Geoff Buesing
6f97ad07de quoted_date converts time-like objects to ActiveRecord::Base.default_timezone before serialization. This allows you to use Time.now in find conditions and have it correctly be serialized as the current time in UTC when default_timezone == :utc [#2946 state:resolved] 2009-08-03 22:03:47 -05:00
Joshua Peek
9b68877897 Track generated attribute methods in a separate module 2009-08-02 21:06:35 -05:00
Yehuda Katz
b53f006901 Remove legacy processing and content_length
* convert_content_type! is handled by assign_default_content_type_and_charset!
  * set_content_length! should be handled by the endpoint server. Otherwise
    each middleware that modifies the body has to do the expensive work of
    recalculating content_length.
  * convert_language! appears to be legacy. There are no tests for this
  * convert_cookies! should be handled by the new HeaderHash in Rack
  * Use an integer for .status's internal representation to avoid needing to
    do String manipulation just to find out the status
2009-08-02 19:39:33 -04:00
Yehuda Katz
503ce1d01c Update cache_control to be a Hash of options that is used to build the header.
* Significantly simplifies setting and modifying cache control in other areas
2009-08-02 19:39:33 -04:00
Jeremy Kemper
f2a35723c8 Ruby 1.9: fix encoding for test_file_stream 2009-08-01 20:26:05 -07:00
Sava Chankov
ec94c2550d Ruby 1.9: fix Content-Length for multibyte send_data streaming
[#2661 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2009-08-01 20:25:59 -07:00
Jeremy Kemper
a606727606 Extract String#bytesize shim 2009-08-01 18:34:41 -07:00
Jeremy Kemper
cdf60e46cc SQLite: drop support for 'dbfile' option in favor of 'database.' 2009-08-01 18:22:12 -07:00
Joshua Peek
62fd1d3716 Start separating primary key concerns 2009-07-30 17:54:02 -05:00
Joshua Peek
ded3d97c5a Make sure we use send for the default attribute method body because the suffix maybe an invalid method name 2009-07-30 17:54:02 -05:00
Joshua Peek
1ae7eb5200 Make sure to reset defined methods after calling attribute_method_suffix 2009-07-30 17:54:02 -05:00
Joshua Peek
d599ea27c5 Move attribute_types_cached_by_default into attribute methods reading concern 2009-07-30 17:54:02 -05:00
Joshua Peek
89e9efcbe2 Don't need to pass attr_name to evaluate_attribute_method anymore 2009-07-30 17:54:01 -05:00
Joshua Peek
2c30c9fe6c Undefine id and let it automatically be generated 2009-07-30 17:54:01 -05:00
Joshua Peek
f8d2c77c90 Redirect method missing for primary key to read_attribute 2009-07-30 17:54:01 -05:00
Joshua Peek
9cdcfb4fc5 ditto for id= 2009-07-30 17:54:01 -05:00
Joshua Peek
831c38ffc7 Don't define id_before_type_cast, just let it be generated on its own 2009-07-30 17:54:01 -05:00
Joshua Peek
1841fd54e6 Move id attribute methods into their related concern 2009-07-30 17:54:01 -05:00
Joshua Peek
3e58f8e191 Restore DangerousAttributeError 2009-07-30 17:54:00 -05:00
Joshua Peek
e129c5673a Wrap up attribute method reset concerns in 'undefine_attribute_methods' 2009-07-30 17:54:00 -05:00
Joshua Peek
586baf8ffe read_attribute is always available through attribute 2009-07-30 17:54:00 -05:00
Joshua Peek
bd07c5ca8e cache_attributes is related to attribute reading 2009-07-30 17:54:00 -05:00
Joshua Peek
94dabf9b4b Generate methods for all suffixes 2009-07-30 17:54:00 -05:00
Joshua Peek
c2b075bed0 Concernify AR AttributeMethods 2009-07-30 17:53:59 -05:00
Yehuda Katz
2c2ca833a5 Removed default_internal, which was preventing round-tripping of some encodings. 2009-07-30 09:55:17 -07:00
Pratik Naik
83537bf090 Generator config should be commented by default 2009-07-30 17:49:48 +01:00
Pratik Naik
61d995f7ed Remove whitespaces from the default mailer file 2009-07-30 17:49:48 +01:00
Marc Love
d860c89170 Fix tag helpers so that all HTML element boolean attributes render according to the specs. Added all boolean attributes listed in the XHTML 1.0 specs (http://www.w3.org/TR/xhtml1/guidelines.html) and HTML 5 specs (http://www.whatwg.org/specs/web-apps/current-work). HTML 5 boolean attribute rendering was broken in commit 1e2d722960 / [#2864 state:resolved].
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-30 09:48:27 -07:00
Jeremy Kemper
d83b182857 Revert "Methods invoked within named scope Procs should respect the scope stack. [#1267 state:resolved]"
This reverts commit 6a13376525.

Conflicts:

	activerecord/test/cases/named_scope_test.rb
2009-07-29 16:54:54 -07:00
José Valim
e566fc0577 Merge branch 'master' of git://github.com/rails/rails 2009-07-29 21:22:56 +02:00
José Valim
d209aea7d8 Remove last TODO.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:04 -07:00
José Valim
fa0cf663fe Add a couple more tests to respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
09de34ca56 Added respond_with.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
bbe86077c2 Added tests for respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
67b2d08c0a Ensure that the proper accept header value is set during tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:03 -07:00
José Valim
b51632d34d Improve request test coverage by adding formats and negotiate_mime tests.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
7e280c3bff Remove Mime::ALL from Mime::SET.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3e8ba616ef Refactor even more Responder. Move mime negotiation to request and added respond_to class method.
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00
José Valim
3f445b316d Refactor Responder to only calculate available mime types. Those are sent to the controller that knows what to do with it (render a block or call default render).
Signed-off-by: Yehuda Katz <wycats@gmail.com>
2009-07-29 12:06:02 -07:00