Commit Graph

21424 Commits

Author SHA1 Message Date
Xavier Noria
b2d94322e6 fixes a couple of regexps, the suite showed warnings about them
A couple of things worth mentioning here:

 - "{" is a metacharacter, should be escaped
   if it is meant to match a "{". The code
   worked, though, because the regexp engine
   is tolerant to this, but issued warnings.

 - gsub accepts a string as first argument.
   That's the best idiom to use when your
   pattern has no metacharacters, since gsub
   interprets the string as an exact substring
   to look for, rather than a regexp. The
   benefit is that your pattern is crystal
   clear and needs no backslashes.
2011-03-27 20:45:23 +02:00
David Heinemeier Hansson
cc6fa2f4d7 Fix alias_method, add test 2011-03-27 11:20:54 -07:00
Aaron Patterson
a9d27c04ab cleaning up typecast test a little 2011-03-26 17:16:33 -07:00
Aaron Patterson
5013fe3a1d refactoring tz to a variable rather than repeating it 2011-03-26 17:04:54 -07:00
David Heinemeier Hansson
f8a05ad297 Allow FormHelper#form_for to specify the :method as a direct option instead of through the :html hash [DHH] 2011-03-26 14:45:00 -07:00
Aaron Patterson
dea3d2dd20 adding a test for attributes after type cast. thanks nragaz. ❤️ 2011-03-26 11:50:31 -07:00
David Heinemeier Hansson
cb3e96a447 Make JavaScriptHelper#j() an alias for JavaScriptHelper#escape_javascript() -- note this then supersedes the Object#j() method that the JSON gem adds within templates using the JavaScriptHelper [DHH] 2011-03-26 10:28:39 -07:00
Sebastian Martinez
45c233ef81 Removed #update_attribute method. New #update_column method.
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-26 12:09:04 -03:00
Xavier Noria
eb8beb32b0 Merge branch 'master' of git://github.com/lifo/docrails 2011-03-26 00:13:37 +01:00
Sebastian Martinez
6ee5d9244c impact recent updates to #first! and #last! methods 2011-03-25 20:07:13 -03:00
Xavier Noria
9d9b873b95 removes unnecessary selfs, and mentions that first! and last! take no arguments in their API docs 2011-03-26 00:02:40 +01:00
Xavier Noria
6383f6704f Merge branch 'master' of git://github.com/lifo/docrails 2011-03-25 23:47:57 +01:00
Sebastian Martinez
a0946692c1 Update AR querying guide with #first! and #last! new methods 2011-03-25 19:34:45 -03:00
Pratik Naik
25be204e3c No arguments for first! and last! 2011-03-25 22:30:36 +00:00
Josh Susser
65dce01091 comment typo fix 2011-03-25 12:28:37 -07:00
Aaron Patterson
7333f50abc fixing whitespace errors. 💣 2011-03-25 12:10:11 -07:00
Josh Kalderimis
5170d210e8 correction to the outputted controller name in the diagnostics error template, test included
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-24 19:43:48 -03:00
Josh Susser
5214e73850 add #first! and #last! to models & relations 2011-03-24 09:55:51 -07:00
Andrew White
9772de8d45 Fix filter :only and :except with implicit actions
The method_name argument is "default_render" for implicit actions
so use the action_name attribute to determine which callbacks to run.

[#5673 state:resolved]
2011-03-23 23:32:44 +00:00
Manfred Stienstra
5da9a74bd3 Add a failing test case for an implicit action with a before filter.
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-03-23 23:32:44 +00:00
Adam Meehan
c5908a8649 Fix before_type_cast for timezone aware attributes by caching converted value on write. Also remove read method reload arg on timezone attributes. 2011-03-23 15:38:51 -07:00
Murray Steele
54c963c89b Make clearing of HABTM join table contents happen in an after_destory callback.
The old method of redefining destroy meant that clearing the HABTM join table would happen as long as the call to destroy succeeded.  Which meant if there was a before_destroy that stopped the instance being destroyed using normal means (returning false, raising ActiveRecord::Rollback) rather than exceptional means the join table would be cleared even though the instance wasn't destroyed.  Doing it in an after_destroy hook avoids this and has the advantage of happening inside the DB transaction too.
2011-03-23 14:45:21 -07:00
Murray Steele
8ee81d21fb Failing test case to show that habtm join table contents are removed when a model is destroyed but the destruction is blocked by a before_destroy. 2011-03-23 14:45:21 -07:00
Xavier Noria
3b91b3726d Merge branch 'master' of git://github.com/lifo/docrails 2011-03-23 21:52:33 +01:00
Aditya Sanghi
3a7c7dc73d Fix test for prepend giving a false positive. [#5716 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-03-23 18:06:30 +01:00
Diego Carrion
a1edbf7206 parse dates to yaml in json arrays
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-22 21:09:54 -03:00
Diego Carrion
7004434ad8 test json decoding with time parsing disabled with all backends and respect ActiveSupport.parse_json_times when converting to yaml
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-03-22 21:09:54 -03:00
Santiago Pastorino
450f7cf01b use class_eval with a string when it's possible 2011-03-22 20:11:36 -03:00
Santiago Pastorino
baa237c974 Allow to read and write AR attributes with non valid identifiers 2011-03-22 20:02:32 -03:00
Santiago Pastorino
da6c7bd4b4 Do not in place modify what table_name returns 2011-03-22 19:36:16 -03:00
Dr Nic Williams
ee8ca49414 Update 'Getting Started on Windows' tip to go to one-click Rails Installer 2011-03-22 15:13:55 -07:00
Ryan Bigg
137ff0402a Caching guide: Capitalize 'Note' so that it's rendered as a proper note 2011-03-23 08:33:06 +11:00
Piotr Sarnacki
e06c448002 Install rb-fsevent gem if ENV[RB_FSEVENT] is set 2011-03-22 19:36:12 +01:00
Aaron Patterson
ed97c39517 adding missing require 2011-03-22 10:10:33 -07:00
Aaron Patterson
2ef6270f8f Merge branch 'master' into fuuu
* master:
  Do not show optional (.:format) block for wildcard route [#6605 state:resolved]
  pushing id insertion and prefetch primary keys down to Relation#insert
  use prepared statements to fetch the last insert id
  escaping binary data encoding when inserting to sqlite3. Thanks Naruse! [#6559 state:resolved]
  schemas set by set_table_name are respected by the mysql adapter. [#5322 state:resolved]
  Reapply extensions when using except and only
  SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this test
  Improved resolver docs a bit
  [action_view] docs for FileSystemResolver
  [action_view] added custom patterns to template resolver
2011-03-22 09:34:33 -07:00
Prem Sichanugrist
2ddfdba9a0 Do not show optional (.:format) block for wildcard route [#6605 state:resolved]
This will make the output of `rake routes` to be correctly match to the behavior of the application, as the regular expression used to match the path is greedy and won't capture the format part by default
2011-03-22 09:19:40 -07:00
Aaron Patterson
15d3cc21f4 pushing id insertion and prefetch primary keys down to Relation#insert 2011-03-22 09:18:01 -07:00
Ryan Bigg
5a44951186 Querying guide: mention that performing a where on an relation that contains an includes statement will generate a LEFT OUTER JOIN rather than an INNER JOIN or another query 2011-03-22 12:16:15 +11:00
Ryan Bigg
c24e5548fd Querying guide: mention that performing a where on an relation that contains an includes statement will generate a LEFT OUTER JOIN rather than an INNER JOIN or another query 2011-03-22 12:16:13 +11:00
Aaron Patterson
3378d77b04 use prepared statements to fetch the last insert id 2011-03-21 16:32:13 -07:00
Aaron Patterson
88636f7195 escaping binary data encoding when inserting to sqlite3. Thanks Naruse! [#6559 state:resolved] 2011-03-21 14:49:07 -07:00
Aaron Patterson
ea8fcfb729 schemas set by set_table_name are respected by the mysql adapter. [#5322 state:resolved] 2011-03-21 11:20:45 -07:00
Iain Hecker
96b9fc4400 Reapply extensions when using except and only 2011-03-21 10:29:45 -07:00
Aaron Patterson
55bf087da1 SJIS is an alias to Windows-31J in ruby trunk. Use SHIFT_JIS for this test 2011-03-21 10:00:30 -07:00
Gabriel Horner
6c309f04c9 Beef up Rails::Railtie::Configuration docs 2011-03-19 19:53:36 -04:00
José Valim
1413c9b1d5 Improved resolver docs a bit 2011-03-19 16:06:50 -07:00
Chris Kowalik
d76fadbd7d [action_view] docs for FileSystemResolver 2011-03-20 07:01:47 +08:00
Chris Kowalik
de1fe5e8a7 [action_view] added custom patterns to template resolver 2011-03-20 07:01:46 +08:00
Jon Leighton
6ab65bec61 Merge branch 'master' into nested_has_many_through 2011-03-18 23:15:01 +00:00
Jon Leighton
5b84aebd14 Add order clauses to fix some tests which were failing under 1.8 on oracle and postgres 2011-03-18 23:14:45 +00:00