Compare commits

..

5760 Commits

Author SHA1 Message Date
Charlie Somerville
4fc14b1f71 3.2.19.github9 2014-11-10 15:30:19 +11:00
Charlie Somerville
7c89fc489d Merge pull request #36 from github/3-2-github+ambiguous-times
Force a period when local times are ambiguous
2014-11-10 15:26:47 +11:00
John Barnette
7a559d389c Force a period when local times are ambiguous
This commit includes the essence of
https://github.com/rails/rails/pull/17409.
2014-11-10 12:56:35 +11:00
Dirkjan Bussink
726e996306 New version because of Proc#bind removal 2014-10-09 08:42:43 +02:00
Dirkjan Bussink
eadedf7189 Merge pull request #34 from github/dbussink/rails32-proc-bind
Remove Proc#bind from Rails 3.2
2014-10-09 08:42:11 +02:00
Dirkjan Bussink
c831f67d8b Remove Proc#bind from Rails 3.2 2014-10-08 14:08:40 +02:00
Charlie Somerville
b6f150c40c 3.2.19.github7 2014-10-07 16:41:52 +11:00
Charlie Somerville
76ad4030e5 whoops, we don't want to create an output_buffer local 2014-10-07 16:35:37 +11:00
Charlie Somerville
0a3c7ba903 3.2.19.github6 2014-10-07 16:29:46 +11:00
Charlie Somerville
d69e65ab34 use bytesize and byteslice rather than length and slice! 2014-10-07 16:29:14 +11:00
Charlie Somerville
56d2614309 3.2.19.github5 2014-09-26 16:58:46 +10:00
Rob Sanheim
0afd326c36 Move commit exception handling to a method so we can override
It looks like these methods all get included into the AbstractAdapter,
and then in github/github we have our own Adapter as an internal gem.

So this should be easy enough to override in our vendor'ed adapter.

This will allow us to still grab errors that happen in `after_commit`
which would normally be swallowed in Rails 3.0 (and beyond).

Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
2014-09-26 16:25:08 +10:00
Rob Sanheim
c957f5f609 only _run_commit_callbacks when destroyed or persisted:
should fix issues with commit callbacks getting called when the record
is not persisted (yet) in a inner transaction or due to some other edge
case.

see also caabed6c76

Conflicts:
	activerecord/lib/active_record/transactions.rb
2014-09-26 16:19:59 +10:00
Charlie Somerville
90ded51cc1 3.2.19.github4 2014-09-26 15:42:58 +10:00
Charlie Somerville
74b7cb9868 Merge pull request #31 from github/3-2-github+json-sessions
[3.2] JSON sessions
2014-09-26 15:32:46 +10:00
Charlie Somerville
bce8b07309 ignore nil session["flash"] 2014-09-26 15:26:13 +10:00
Greg Ose
3fe553fa31 more like 3.2 2014-09-24 13:25:13 -05:00
Greg Ose
e1c7a232ca update FlashHash for 3.2 2014-09-24 12:39:03 -05:00
Charlie Somerville
283923f530 we don't care about deserializing old marshal sessions anymore 2014-09-23 16:41:38 +10:00
Greg Ose
18d37237c4 attribute flash hash test source 2014-09-23 16:22:28 +10:00
Greg Ose
b30301bb6d clearer comment on session value format 2014-09-23 16:22:25 +10:00
Greg Ose
d12475ba60 support old marshalled cookies 2014-09-23 16:22:15 +10:00
Greg Ose
d106a28675 not until 4.0 2014-09-23 16:22:10 +10:00
Greg Ose
67b3fd5cb8 Custom cookie serializer test
Adapted from
b23ffd0dac/actionpack/test/dispatch/cookies_test.rb (L382-L413)
2014-09-23 16:21:49 +10:00
Greg Ose
0342deaa22 update flash hash test for 3.0 backport 2014-09-23 16:21:44 +10:00
Greg Ose
91bbe59e17 add flash hash tests 2014-09-23 16:21:37 +10:00
Greg Ose
f0895f838f 📗? Update tests and FlashHash cleanup
* Make FlashHash more like 4.1 (654a2de7a9)
* Move tests to stringified keys (b97e087321)
* Fix tests to properly load / store to session
2014-09-23 16:19:09 +10:00
Greg Ose
c9a54ce81d actually backport flash to 3.0 instead of 3.2 2014-09-23 16:16:54 +10:00
Greg Ose
f6844fc683 move serialization option from cookie option to global env option 2014-09-23 16:14:57 +10:00
Greg Ose
b09eac885e initial conversion to rails 4 flash hash, debugging marshalling issue 2014-09-23 16:13:23 +10:00
Greg Ose
1edd8b587b serializer option for cookie store 2014-09-23 16:07:59 +10:00
Charlie Somerville
7ed2b48747 3.2.19.github3 2014-09-19 18:26:43 +10:00
Charlie Somerville
8b5e2df964 shut this deprecation warning up for now 2014-09-19 18:26:17 +10:00
Charlie Somerville
7688a79035 Merge pull request #30 from github/3-2-github+timezones
[3.2] Unfuck timezones for db quoting
2014-09-19 18:25:37 +10:00
Charlie Somerville
ec80c63332 Time#to_time converts it back to local 2014-09-19 17:51:43 +10:00
Charlie Somerville
7edb47effd dup before changing to utc 2014-09-19 17:51:39 +10:00
Charlie Somerville
24bdb8141e fix tests 2014-09-19 17:51:27 +10:00
Charlie Somerville
78e6c36ba3 convert times to local when quoting for db 2014-09-19 17:50:29 +10:00
Charlie Somerville
923ee6adf8 3.2.19.github2 2014-09-18 18:05:34 +10:00
Arthur Neves
7cbeae9a5c Make sure transaction state resets after commit
[fixes #12566]

Conflicts:
	activerecord/test/cases/transaction_callbacks_test.rb
2014-09-18 14:23:36 +10:00
Charlie Somerville
e27d15746c 3.2.19.github1 2014-09-16 11:50:45 +10:00
Charlie Somerville
ff7bbf364f Merge pull request #28 from github/3-2-github+rip-out-sprockets
[3.2] Rip out Sprockets
2014-09-16 11:49:05 +10:00
Charlie Somerville
7a882329ed more 2014-09-15 15:00:13 +10:00
Charlie Somerville
730e5c4fa3 this test also 2014-09-15 14:49:45 +10:00
Charlie Somerville
e61bcf3d9d kill this test 2014-09-15 14:47:21 +10:00
Charlie Somerville
7ce60331c3 more more more 2014-09-15 14:44:52 +10:00
Charlie Somerville
7d31e49b1e rip out more sprockets stuffs 2014-09-15 14:38:42 +10:00
Charlie Somerville
7f3ec3496d remove sprockets dependency 2014-09-15 14:36:51 +10:00
Charlie Somerville
88827a2cab rip out a bunch of sprockets stuff 2014-09-15 14:35:28 +10:00
Charlie Somerville
94331729a1 rename SprocketsApp here to RackApp to not confuse me when grepping 2014-09-15 14:35:17 +10:00
Charlie Somerville
4040266a60 update Gemfile.lock and vendor/cache 2014-09-15 14:09:33 +10:00
Charlie Somerville
7684d715ef Merge remote-tracking branch 'upstream/3-2-stable' into 3-2-github 2014-09-15 14:04:33 +10:00
Charlie Somerville
9cbc2c3550 ci on ruby 2.1.2 2014-09-15 14:02:45 +10:00
Charlie Somerville
aa7515977f bundle --local 2014-09-15 14:01:51 +10:00
Santiago Pastorino
11fd052aa8 Regenerate sid when sbdy tries to fixate the session
Fixed broken test.

Thanks Stephen Richards for reporting.
2014-08-04 11:36:43 -03:00
Rafael Mendonça França
c43f20a404 Merge branch '3-2-sec' into 3-2-stable 2014-07-02 14:18:47 -03:00
Rafael Mendonça França
53c845cb18 Preparing for 3.2.19 release 2014-07-02 12:55:09 -03:00
Rafael Mendonça França
1f2192e46d Check against bit string values using multiline regexp
Fix CVE-2014-3482.
2014-07-02 12:49:01 -03:00
Rafael Mendonça França
3622858ed5 Use a version of execjs compatible with Ruby 1.8 2014-06-26 22:10:32 -03:00
Rafael Mendonça França
297bff7f8f Make sure Active Support configurations are applied correctly
Before this patch configuration set using config.active_support
would not be set.

Closes #15364
2014-06-26 18:40:23 -03:00
Guillermo Iguaran
bc90ea63e9 Revert "Merge pull request #15794 from vishalzambre/patch-1"
This reverts commit 6d800a909e, reversing
changes made to 6a051299f9.

We don't apply non-security fixes to 3-2-stable branch!!!
2014-06-18 00:37:46 -05:00
Guillermo Iguaran
6d800a909e Merge pull request #15794 from vishalzambre/patch-1
File.exists? is a deprecated name, use File.exist?
2014-06-18 00:33:00 -05:00
Vishal Zambre
fca3cc23fa File.exists? is a deprecated name, use File.exist?
File.exists? is a deprecated name, use File.exist?
2014-06-18 10:51:27 +05:30
Aaron Patterson
6a051299f9 Feature detect based on Ruby version.
I didn't want to do this, FNM_EXTGLOB is defined on 2.1.x, but Dir.glob
returns the wrong value on Ruby less than 2.2.0.  Checking for a
case-insensitive FS seems too hard, so just check Ruby version  Checking
for a case-insensitive FS seems too hard, so just check Ruby version.
2014-05-18 12:00:57 -07:00
Aaron Patterson
c40df47055 feature detect for FNM_EXTGLOB for older Ruby. Fixes #15053 2014-05-10 11:53:02 -07:00
Aaron Patterson
03e016f22a use fnmatch to test for case insensitive file systems
this is due to:

  https://bugs.ruby-lang.org/issues/5994
2014-05-09 14:46:46 -07:00
Rafael Mendonça França
bbec7d72be Merge branch '3-2-sec' into 3-2-stable
Conflicts:
	actionpack/CHANGELOG.md
2014-05-06 13:31:07 -03:00
Rafael Mendonça França
50d6b4549d Fix broken tests of the previous release 2014-05-06 13:03:21 -03:00
Rafael Mendonça França
4e8f1d2588 Preparing for 3.2.18 release 2014-05-06 11:33:10 -03:00
Rafael Mendonça França
0f3b7d1a31 Only accept actions without File::SEPARATOR in the name.
This will avoid directory traversal in implicit render.

Fixes: CVE-2014-0130
2014-05-05 11:37:34 -03:00
Charlie Somerville
4bbf1da870 Merge pull request #57 from github/3-2-github+builder-3.2
Bump to builder 3.2
2014-04-10 23:04:35 +10:00
Charlie Somerville
a54e2e4a72 bump to builder 3.2 2014-04-10 22:53:51 +10:00
Charlie Somerville
c5cb8cd58f commit unrelated Gemfile changes 2014-04-10 22:53:51 +10:00
Charlie Somerville
1f230b83a5 Merge pull request #56 from github/3-2-github+ci
Get 3-2-github CI'd
2014-04-10 21:51:16 +10:00
Charlie Somerville
bb861052e8 only run tests with sqlite 2014-04-10 21:35:48 +10:00
Charlie Somerville
32f98697a7 go away generator tests 2014-04-10 21:22:06 +10:00
Charlie Somerville
a09c04585e rm this test because it fails and we don't particularly care about plugins 2014-04-10 20:35:10 +10:00
Charlie Somerville
3672a16373 don't override singleton_class? if it already exists 2014-04-10 20:27:14 +10:00
Charlie Somerville
c9acba55f1 define info_signal for new minitests 2014-04-10 19:47:39 +10:00
Charlie Somerville
76cd0b9ecd check in Gemfile.lock because the lack of it is causing problems 2014-04-10 19:23:27 +10:00
Charlie Somerville
e8bfacec38 remove --local from Gemfile 2014-04-10 19:23:27 +10:00
Charlie Somerville
112c9bdecf delete unnecessary platforms 2014-04-10 19:23:11 +10:00
Charlie Somerville
f20f5f8d20 check in gems 2014-04-10 19:12:24 +10:00
Charlie Somerville
3bb90b907a add script/cibuild 2014-04-10 19:10:09 +10:00
Rafael Mendonça França
a3bda38467 Merge branch '3-2-17' into 3-2-stable
Conflicts:
	actionpack/CHANGELOG.md
2014-02-18 15:57:32 -03:00
Rafael Mendonça França
666e9f65bd Preparing for 3.2.17 release 2014-02-18 15:16:57 -03:00
Rafael Mendonça França
388d2f8888 Use the reference for the mime type to get the format
Before we were calling to_sym in the mime type, even when it is unknown
what can cause denial of service since symbols are not removed by the
garbage collector.

Fixes: CVE-2014-0082
2014-02-18 15:02:54 -03:00
Rafael Mendonça França
eaa2101b29 Escape format, negative_format and units options of number helpers
Previously the values of these options were trusted leading to
potential XSS vulnerabilities.

Fixes: CVE-2014-0081
2014-02-18 15:02:29 -03:00
Damien Mathieu
5a84d3eb81 Merge pull request #13613 from simi/patch-1
Fix force_ssl.rb documentation. Close tt tag.
2014-01-06 06:29:25 -08:00
Josef Šimánek
c13eb1c727 Fix force_ssl.rb documentation. Close tt tag.
[ci skip]
2014-01-06 15:28:35 +01:00
Rafael Mendonça França
3a429e6b5d Merge pull request #13315 from tyre/patch-1
Update Session Store Documentation
2013-12-13 18:02:20 -08:00
Chris Maddox
1805682efa Update Session Store Documentation
session_id doesn't need to be a text column, just string (VARCHAR)
2013-12-13 17:02:16 -08:00
Carlos Antonio da Silva
31a485fa5a Merge pull request #13183 from sorah/never_ignore_i18n_translate_raise_option
Escalate missing error when :raise is true in translate helper, fix regression introduced by security fix.

Conflicts:
	actionpack/CHANGELOG.md
2013-12-04 22:34:15 -02:00
Rafael Mendonça França
c82025fcd6 Fix documentation of number_to_currency helper
Now users have to explicit mark the unit as safe if they trust it.

Closes #13161
2013-12-04 10:22:46 -02:00
Rafael Mendonça França
9c60e3df9f Merge pull request #13162 from makandra/3-2-stable
Repair a test broken by the number_to_currency XSS fix
2013-12-04 04:14:55 -08:00
Tobias Kraze
9e625d6465 repair a test broken by the number_to_currency XSS fix 2013-12-04 12:16:05 +01:00
Aaron Patterson
64226302d8 updating the changelog 2013-12-02 16:17:19 -08:00
Michael Koziarski
d5a4095ca5 Deep Munge the parameters for GET and POST
The previous implementation of this functionality could be accidentally
subverted by instantiating a raw Rack::Request before the first Rails::Request
was constructed.

Fixes CVE-2013-6417

Conflicts:
	actionpack/lib/action_dispatch/http/request.rb
2013-12-02 14:14:35 -08:00
Michael Koziarski
78790e4bce Stop using i18n's built in HTML error handling.
i18n doesn't depend on active support which means it can't use our html_safe
code to do its escaping when generating the spans.  Rather than try to sanitize
the output from i18n, just revert to our old behaviour of rescuing the error
and constructing the tag ourselves.

Fixes: CVE-2013-4491

Conflicts:
	actionpack/lib/action_view/helpers/translation_helper.rb

Backport: 50afd8eec9d088ad5a2d41f00a05520d5b78a6a0
2013-12-02 14:02:15 -08:00
Michael Koziarski
5ed70c591f Escape the unit value provided to number_to_currency
Fixes CVE-2013-6415

Previously the values were trusted blindly allowing for potential XSS attacks.
2013-12-02 13:49:41 -08:00
Aaron Patterson
bee3b7f937 Only use valid mime type symbols as cache keys
CVE-2013-6414
2013-11-30 17:03:18 -08:00
Aaron Patterson
5f844d6cc6 Merge branch '3-2-sec' into 3-2-stable
* 3-2-sec:
  updating changelogs
  bumping to 3.2.15
  bumping to rc3
  Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
  Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
  bumping to rc2
  Merge pull request #12443 from arthurnn/add_inverse_of_add_target
  bumping version to 3.2.15.rc1
  Remove the use of String#% when formatting durations in log messages

Conflicts:
	activerecord/CHANGELOG.md
2013-10-16 10:20:36 -07:00
Aaron Patterson
538f8ba0c1 updating changelogs 2013-10-16 10:01:01 -07:00
Aaron Patterson
2a0c4403fd bumping to 3.2.15 2013-10-15 11:48:53 -07:00
Aaron Patterson
eb8807e84d Merge branch '3-2-15' into 3-2-sec
* 3-2-15:
  bumping to rc3
  Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
  Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
  bumping to rc2
  Merge pull request #12443 from arthurnn/add_inverse_of_add_target
  bumping version to 3.2.15.rc1
  Fix STI scopes using benolee's suggestion. Fixes #11939
2013-10-15 11:15:08 -07:00
Aaron Patterson
e3abd78ee5 bumping to rc3 2013-10-11 14:16:06 -07:00
Rafael Mendonça França
38aefa51c3 Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
This reverts commit ccd11d5891, reversing
changes made to 54c05acdba.

Reason: This caused a regression when the associated record is created
in a before_create callback. See
https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:55:12 -03:00
Rafael Mendonça França
fbc69ac560 Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
This reverts commit 7ed5bdc834, reversing
changes made to 31c79e291f.

Reason: this caused a regression when the associated record is creted in
a before_create callback.

See https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:55:07 -03:00
Rafael Mendonça França
6a185aa0a8 Revert "Merge pull request #12413 from arthurnn/inverse_of_on_build"
This reverts commit ccd11d5891, reversing
changes made to 54c05acdba.

Reason: This caused a regression when the associated record is created
in a before_create callback. See
https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:41:37 -03:00
Rafael Mendonça França
9639f65af5 Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"
This reverts commit 7ed5bdc834, reversing
changes made to 31c79e291f.

Reason: this caused a regression when the associated record is creted in
a before_create callback.

See https://github.com/rails/rails/pull/12413#issuecomment-25848163
2013-10-10 14:40:24 -03:00
Aaron Patterson
5ede19b772 bumping to rc2 2013-10-04 13:46:35 -07:00
Rafael Mendonça França
73dff26125 Merge pull request #12443 from arthurnn/add_inverse_of_add_target
Add inverse of add target
2013-10-04 13:58:36 -03:00
Rafael Mendonça França
7ed5bdc834 Merge pull request #12443 from arthurnn/add_inverse_of_add_target
Add inverse of add target
2013-10-04 09:57:17 -07:00
Arthur Neves
fc59e997d7 add regression test for set_inverse_instance on add_to_target 2013-10-04 11:15:55 -04:00
Arthur Neves
655396cc10 Add back set_inverse_instance on .add_to_target
We must have it in there too, so when an existent record is being concat to another,
we will have the inverse relation.
2013-10-04 10:15:22 -04:00
Aaron Patterson
5e277c8208 bumping version to 3.2.15.rc1 2013-10-03 11:52:44 -07:00
Aaron Patterson
31c79e291f Merge pull request #12084 from Ben-M/3-2-stable
Fix STI scopes using benolee's suggestion. Fixes #11939
2013-10-03 11:14:19 -07:00
Aaron Patterson
befeeb2d0a Merge branch '3-2-stable' into 3-2-sec
* 3-2-stable:
  make sure both headers are set before checking for ip spoofing
  Move set_inverse_instance to association.build_record
2013-10-03 10:27:58 -07:00
Andrew White
83c4b0a7f9 Merge pull request #12410 from tamird/fix-ip-spoof-errors
Fix ip spoof errors
2013-10-01 01:28:07 -07:00
Tamir Duberstein
85106decc4 make sure both headers are set before checking for ip spoofing 2013-10-01 01:26:07 -07:00
Michael Koziarski
5aee516b5e Remove the use of String#% when formatting durations in log messages
This avoids potential format string vulnerabilities where user-provided
data is interpolated into the log message before String#% is called.
2013-09-30 14:42:11 -07:00
Rafael Mendonça França
ccd11d5891 Merge pull request #12413 from arthurnn/inverse_of_on_build
Inverse of on build
2013-09-30 14:38:58 -07:00
Arthur Neves
679860400f Move set_inverse_instance to association.build_record
[fixes #10371]
2013-09-30 17:20:26 -04:00
Rafael Mendonça França
54c05acdba Merge pull request #12375 from arthurnn/inverse_after_find_or_initialize
Inverse after find or initialize
2013-09-28 17:22:01 -07:00
Rafael Mendonça França
50a96446bc Use Ruby 1.8 hash syntax 2013-09-28 20:56:15 -03:00
Arthur Neves
fed6ac9c66 fix inverse_of when find_or_initialize_by_*
inverse_of relation was not being set when calling find_or_initialize_by_ and the entry was
found on the db.
2013-09-26 14:55:10 -04:00
Rafael Mendonça França
e82cecae35 Merge pull request #12364 from arthurnn/test_fix_validate
Fix query counters when testing with IdentityMap on 3.2
2013-09-25 19:08:14 -07:00
Arthur Neves
e1bb9fc671 on tests: dont always touch firm on validate 2013-09-25 19:50:42 -04:00
Rafael Mendonça França
fdc3c08e55 Merge pull request #12359 from arthurnn/inverse_on_callbacks
Make sure inverse_of is visible on the has_many callbacks
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/models/company.rb
2013-09-25 16:31:00 -03:00
Rafael Mendonça França
c539c684aa Merge pull request #12196 from h-lame/fix-activesupport-cache-filestore-cleanup
Fix FileStore#cleanup to no longer rely on missing each_key method
Conflicts:
	activesupport/CHANGELOG.md
	activesupport/test/caching_test.rb
2013-09-12 16:04:10 -03:00
Eugene Kalenkovich
c9642e31b1 Fix FinderMethods#last unscoped primary key
Fixes table.joins(:relation).last(N) breaking on sqlite

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/finder_test.rb
2013-09-12 14:08:02 -03:00
Steve Klabnik
cff8d1d24d Merge pull request #9368 from CrowdFlower/3-2-stable
PR #5219 backported to 3-2
2013-09-10 13:23:57 -07:00
Santiago Pastorino
143e009546 Merge pull request #12176 from arthurnn/ar32_schema_cache
on SchemaCache use the connection getter instead of the obj given
2013-09-10 07:14:52 -07:00
Arthur Neves
f0301e3de6 on SchemaCache use the connection getter instead of the obj given 2013-09-09 13:47:07 -04:00
Brian Hahn
03ac291526 pass the extra params to the rack test environment so that routes with block constraints have access 2013-09-06 11:08:41 -07:00
Ben Maraney
cf1904f65b Fix STI scopes using benolee's suggestion. Fixes #11939 2013-08-30 12:58:41 +03:00
Aaron Patterson
59a3561045 Merge pull request #12048 from tjouan/app_generator-bin_perms-umask
Comply with current umask when generating new app
Conflicts:
	railties/lib/rails/generators/rails/app/app_generator.rb
2013-08-27 14:06:13 -07:00
Rafael Mendonça França
e0fc5da353 Merge pull request #12006 from kassio/11605-render-with-context-format
Render with context format
2013-08-25 19:31:42 -07:00
Kassio Borges
424a5a7d46 fix issue #11605 2013-08-24 15:24:36 -03:00
Eugene Kalenkovich
adf6e30e3a Fix 1.8.7 incompatible respond_to_missing 2013-08-18 16:46:44 -05:00
Guillermo Iguaran
6d9050bae4 Merge pull request #11930 from UncleGene/ties_test
Fix test incompatible with 1.8.7
2013-08-18 11:27:01 -07:00
Eugene Kalenkovich
93f1a7219b Fix test incompatible with 1.8.7 2013-08-18 11:20:31 -07:00
Teng Siong Ong
946ad5d9f9 Make rake doc:guides works again. Fix #10384.
Conflicts:
	railties/guides/rails_guides.rb
	railties/lib/rails/tasks/documentation.rake
2013-08-05 16:02:17 -04:00
Rafael Mendonça França
5f8a7d1d4d Merge pull request #11765 from kassio/load-fixtures-from-linked-folder
Load fixtures from linked folder
2013-08-05 12:56:31 -07:00
Kassio Borges
0ec701d50b Load fixtures from linked folders 2013-08-05 16:52:12 -03:00
Rafael Mendonça França
773eca0e12 Move changelog entry to the top [ci skip] 2013-07-30 21:59:10 -03:00
Rafael Mendonça França
1463fbeafb Fix broken test
quote_value is called on the object not the class
2013-07-24 16:21:37 -03:00
Ben Woosley
b4dea61a42 Tidy up the "Specified column type for quote_value" changes
This includes fixing typos in changelog, removing a deprecated
mocha/setup test require, and preferring the `column_for_attribute`
accessor over direct access to the columns_hash in the new code.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/locking/optimistic.rb
2013-07-24 13:20:30 -03:00
Alfred Wong
33e1604b3e Specified column type for quote_value
When calling quote_value the underlying connection sometimes requires
more information about the column to properly return the correct quoted
value.

I ran into this issue when using optimistic locking in JRuby and the
activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to
insert a integer into a NVARCHAR column type so we need to format it as
N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without
the column type being passed the connection adapter cannot properly return
the correct quote value because it doesn't know to return N'3' or '3'.

This patch is fairly straight forward where it just passes in the column
type into the quote_value, as it already has the ability to take in the column,
so it can properly handle at the connection level.

I've added the tests required to make sure that the quote_value method
is being passed the column type so that the underlying connection can
determine how to quote the value.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/locking/optimistic.rb
2013-07-24 13:18:21 -03:00
Rafael Mendonça França
c4b93f57e1 Merge pull request #11563 from 90yukke/fix-nomethoderror-on-non-attribute-equalities
Fix merge error when Equality LHS is non-attribute.
2013-07-23 05:29:17 -07:00
90yukke
b289519f4f Fix merge error when Equality LHS is non-attribute.
This is reworking of rails/rails/pull/7380 made for rails 3.
2013-07-23 10:38:00 +03:00
Rafael Mendonça França
e0db277be0 Fix actionpack CHANGELOG entry
It was included by git on the wrong release
2013-07-22 20:25:20 -03:00
Rafael Mendonça França
2b3ce8627b Merge branch '3-2-14' into 3-2-stable 2013-07-22 20:24:09 -03:00
Rafael Mendonça França
c69ccea6f2 Fix activemodel CHANGELOG 2013-07-22 20:23:42 -03:00
Rafael Mendonça França
2fcd13eff2 Preparing for 3.2.14 release 2013-07-22 12:05:41 -03:00
Rafael Mendonça França
47fb44fc7a Update CHANGELOG entry 2013-07-22 11:57:02 -03:00
Andrew White
d8353073d1 Add test to prevent route reloading regression
Journey doesn't clear its named route hash when the routes are reloaded but
Rails 3.2 isn't affected because Journey overwrites the existing route. This
is just a backport of the test to make sure it doesn't become affected in
some future release.
2013-07-21 17:48:24 +01:00
Rafael Mendonça França
ed19c02c8d Merge pull request #11486 from wolframarnold/3-2-stable_fix_respond_to_missing_in_tagged_loggging
3-2-stable patch: Add respond_to_missing? in TaggedLoggging
2013-07-18 10:46:52 -07:00
Rafael Mendonça França
39441f78e3 Merge pull request #10800 from 907th/fix-custom-message-for-assert_redirected_to
Fix #10842. `assert_redirected_to` does not show user-supplied message.
2013-07-17 22:12:42 -07:00
Alexey Chernenkov
0f5ba6e124 Fix assert_redirected_to does not show user-supplied message.
Issue: when `assert_redirected_to` fails due to the response redirect not
matching the expected redirect the user-supplied message (second parameter)
is not shown. This message is only shown if the response is not a redirect.
2013-07-18 10:54:36 +06:00
Wolfram Arnold
803008eb97 Add respond_to_missing? for TaggedLogging which is needed if another log abstracter wraps a TaggedLogging instance.
It's also best practice when overriding method_missing.
2013-07-17 18:26:55 -07:00
Carlos Antonio da Silva
ac5cc69571 Merge pull request #11468 from arunagw/removed_unsed_test
Removed unused test file
2013-07-17 09:49:06 -07:00
Arun Agrawal
fc0faaa590 Removed unused test file
This test file is not be running from a long time
This test is already covered in controller/caching_test.rb
2013-07-17 11:47:24 +02:00
Rafael Mendonça França
a96df04aac Preparing for 3.2.14.rc2 release 2013-07-16 13:00:33 -03:00
Rafael Mendonça França
1900a56669 Use Ruby 1.8 syntax 2013-07-15 17:45:20 -03:00
Rafael Mendonça França
66cba60103 Use Ruby 1.8 syntax 2013-07-15 17:44:49 -03:00
Yves Senn
1c2545a455 Merge pull request #11451 from jetthoughts/11450_do_not_resave_destroyed_association
Do not re-save destroyed association on saving parent object
Conflicts:
	activerecord/lib/active_record/autosave_association.rb

Conflicts:
	activerecord/CHANGELOG.md
2013-07-15 15:49:42 -03:00
Yves Senn
2ae2728d78 Merge pull request #11451 from jetthoughts/11450_do_not_resave_destroyed_association
Do not re-save destroyed association on saving parent object
Conflicts:
	activerecord/lib/active_record/autosave_association.rb
2013-07-15 15:48:43 -03:00
Rafael Mendonça França
facfc24f25 Preparing for 3.2.14.rc1 release 2013-07-12 21:06:50 -03:00
Andrew White
714cb5a436 Add missing require so that DateTime has the right superclass
If the DateTime core extensions were loaded before the Date core extensions
then you would get a superclass mismatch as DateTime hasn't been defined
yet so it gets set to Object by the acts_like core extension.

Fixes #11206

(cherry picked from commit 78f7d5b652000dbb1a11d34fe370c3fa82de840c)
2013-07-10 16:16:02 +01:00
Andrew White
b775987e72 Return local time for backwards compatibility 2013-07-09 15:40:59 +01:00
Andrew White
ccad803bf4 Retain offset and fraction when using Time.at_with_coercion
The standard Ruby behavior for Time.at is to return the same type of
time when passing an instance of Time as a single argument. Since the
an ActiveSupport::TimeWithZone instance may be a different timezone than
the system timezone and DateTime just understands offsets the best we
can do is to return an instance of Time with the correct offset.

It also maintains the correct fractional second value as well.

Fixes #11350.

Backports:
484253515c0e05760541dc48946361185c9e6904
1b3873730b96035a238dbff7627bd5942e6dc4e7
2013-07-09 14:04:49 +01:00
Rafael Mendonça França
d704c1cb98 Do not shallow the original exception in exec_cache
when result_error_field is not defined on result raise the original
exception.

Fixes #11260
2013-07-09 07:41:32 -03:00
Rafael Mendonça França
c4ad10e254 Remove git dependecy 2013-07-08 14:55:25 -03:00
Rafael Mendonça França
2ce875dfbd Add license to the gemspec 2013-07-08 14:51:19 -03:00
Rafael Mendonça França
b5830d168b New changelog entries always on the top [ci skip] 2013-07-06 20:14:50 -03:00
Rafael Mendonça França
a72a0eb85b Remove warning of assigned but unused variable 2013-07-06 17:16:37 -03:00
Rafael Mendonça França
29106ce99c Skip connection url test when the machine is using socket configuration.
The connection url parssing don't accept the socket option
2013-07-06 17:10:55 -03:00
Santiago Pastorino
e359e3ab93 Add missing require 2013-07-02 17:00:33 -07:00
Rafael Mendonça França
b9771813e3 Merge pull request #8881 from carsonreinke/3-2-stable
3-2-stable ActiveSupport::TaggedLogging logging progname issue
2013-07-01 11:36:19 -07:00
Carson Reinke
4265f1bccb Incorrectly providing program name the same as log message even when block is not provided. 2013-07-01 10:11:43 -04:00
Yves Senn
9a8f59340b unify duplicate CHANGELOG entry 2013-06-27 22:00:27 +02:00
Yves Senn
0a55bd7c6b Merge pull request #9173 from senny/backport_perftest_fix
Backport rails/rails-perftest#2 to fix rake test:benchmark
2013-06-27 12:55:36 -07:00
Yves Senn
b47f8d035e clear ARGV to prevent mintest autorun errors:
Minitest expects the first argument in `ARGV` to be the path to a test file.
Because `rails benchmarker` and `rails profiler` define an on-the-fly test-case,
using the first `ARGV` to pass the code to execute this results in:

```
/Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:167:in `block in non_options': file not found: 1000.times{"a string"} (ArgumentError)
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `map!'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:146:in `non_options'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:207:in `non_options'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:52:in `process_args'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:891:in `_run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/minitest/unit.rb:884:in `run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:21:in `run'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:326:in `block (2 levels) in autorun'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:27:in `run_once'
	from /Users/senny/.rbenv/versions/1.9.3-p374/lib/ruby/1.9.1/test/unit.rb:325:in `block in autorun'
```

clearing ARGV after defining the test-case solves this issue.
2013-06-27 21:11:03 +02:00
Yves Senn
1db54d7d01 Backport rails/rails-perftest#2 to fix rake test:benchmark 2013-06-27 20:44:08 +02:00
Yves Senn
63d4894a58 Merge pull request #11019 from tkhr/test_case_for_issue_10393
Add test case for issue #10393 and fix warning message
2013-06-25 23:42:35 -07:00
Yves Senn
cacfa8e3fb build fix, fall back to old hash syntax 2013-06-26 08:33:44 +02:00
chapmajs
839efc5b6d Allow global override of default STI inheritance column
This change fixes a bug by which 3.2-STABLE users can't globally override the default STI inheritance column with `ActiveRecord::Base.inheritance_column = 'some_column'`. 3.2-STABLE users are forced to use a deprecated method or monkey patch it otherwise.

Test case written by tkhr <takehiro0740@gmail.com>.
2013-06-26 14:55:18 +09:00
Yves Senn
b23e0d6639 Merge pull request #9893 from JonRowe/add_test_to_assert_association_doesnt_overwrite
Add a test to assert autosaving associations doesn't overwrite id accessor methods
2013-06-25 22:45:36 -07:00
Carlos Antonio da Silva
cde6ead573 Move changelog entry to the top [ci skip] 2013-06-25 22:05:54 -03:00
Carlos Antonio da Silva
07c6262c25 Merge pull request #10373 from janko-m/fix-store-accessor
Fix a bug in ActiveRecord::Store accessors
2013-06-25 22:03:01 -03:00
Yves Senn
27b3883846 Revert "Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader""
This reverts commit 5009b07887.

Also updated the CHANGELOG and adjusted the test-case to match the one on master.
2013-06-25 18:07:06 +02:00
Andrew White
b0c65978ab Use old style hash syntax for 3-2-stable 2013-06-25 12:24:06 +01:00
Andrew White
622e4ab424 Fix shorthand routes where controller and action are in the scope
Merge `:action` from routing scope and assign endpoint if both `:controller`
and `:action` are present. The endpoint assignment only occurs if there is
no `:to` present in the options hash so should only affect routes using the
shorthand syntax (i.e. endpoint is inferred from the the path).

Fixes #9856

Backport of 37b4276
2013-06-25 11:00:19 +01:00
Rafael Mendonça França
ca23e6d4d3 Add CHANGELOG entry for #10971
[ci skip]
2013-06-24 16:19:38 -03:00
Rafael Mendonça França
2553bd785c Merge pull request #10971 from dtaniwaki/escape_link_to_unless
Always escape the result of link_to_unless method
2013-06-24 16:15:56 -03:00
Rafael Mendonça França
119f27c519 Fix textile markup
Closes #11076

[ci skip]
2013-06-24 16:09:10 -03:00
Yves Senn
5009b07887 Revert "Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader"
This reverts commit 6675d71318, reversing
changes made to 919d1a19d5.

I missed to check the target branch and wrongly merged it into 3-2-stable directly.
2013-06-22 12:15:42 +02:00
Yves Senn
6675d71318 Merge pull request #10901 from armstrjare/fix_query_null_foreign_key_on_new_record_collection_ids_reader
Fixes CollectionAssociation#ids_reader returning incorrect ids for new records
2013-06-22 03:11:19 -07:00
Jared Armstrong
c2377f72d2 Fixes CollectionAssociation#ids_reader returning incorrect ids for new records 2013-06-21 13:03:54 +12:00
Xavier Noria
919d1a19d5 Merge pull request #11033 from robin850/patch-1
Update the feedback instructions
2013-06-20 14:48:44 -07:00
Robin Dupret
f3b84e2d96 Update the feedback instructions [ci skip]
Since docrails as moved from lifo/docrails to rails/docrails we have
to ask for commit rights or submit patches directly to the rails
repository
2013-06-20 21:35:44 +02:00
Yves Senn
b768647aa8 Merge pull request #10883 from ifeelgoods/3-2-stable
The default cache store is :file_store in caching_with_rails.textile
2013-06-19 02:19:51 -07:00
Matthieu Paret
31899da159 indicate the default Rails cache store
memory_store is the default cache store implementation if you call
ActiveSupport::Cache.lookup_store without arguments.
2013-06-19 11:06:16 +02:00
Rafael Mendonça França
9f754e801f Compare host scheme using case-insensitive regexp
Before:

    image_tag("HTTP://google.com")
    # => "<img alt=\"Google\" src=\"/assets/HTTP://google.com\" />"
    image_tag("http://google.com")
    # => "<img alt=\"Google\" src=\"http://google.com\" />"

After:

    image_tag("HTTP://google.com")
    # => "<img alt=\"Google\" src=\"HTTP://google.com\" />"
    image_tag("http://google.com")
    # => "<img alt=\"Google\" src=\"http://google.com\" />"

Backport of #10969
2013-06-16 22:05:26 -03:00
Rafael Mendonça França
7092467f06 nokogiri >= 1.6 doesn't work with ruby 1.8 2013-06-15 11:40:12 -03:00
Yves Senn
a51d4e6c25 Merge pull request #10925 from senny/10917_test_to_prevent_regression
regression test + mysql2 adapter raises correct error if conn is closed.
Conflicts:

	activerecord/CHANGELOG.md
2013-06-15 14:51:17 +02:00
Andrew White
f42e0fd3f4 Override Time.at to work with Time-like values
Time.at allows passing a single Time argument which is then converted
to an integer. The conversion code since 1.9.3r429 explicitly checks
for an instance of Time so we need to override it to allow DateTime
and ActiveSupport::TimeWithZone values.
2013-06-08 09:45:45 +01:00
Aaron Patterson
20daaf4e2a adding a test for #10830 2013-06-05 17:14:55 +09:00
Andrew White
8799cfa72d Restore rescue block for when IM is enabled 2013-05-24 13:02:19 +01:00
Andrew White
7101a857b4 Merge pull request #10745 from arunagw/build_fix_ruby187
Build fix ruby187
2013-05-24 03:35:20 -07:00
Arun Agrawal
0e14973a33 It's scoped in 3-2-stable!
scope => scoped
2013-05-24 11:20:43 +02:00
Arun Agrawal
b75c8e58ab Using 1.8.7 syntax for 3-2-stable 2013-05-24 11:20:20 +02:00
Rafael Mendonça França
d29399061e Merge pull request #10713 from senny/10693_fix_primary_key_option_on_has_many
Fix the `:primary_key` option for `has_many` associations.
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/has_many_association.rb
2013-05-23 18:45:12 -03:00
Rafael Mendonça França
f8c4805a82 Merge pull request #10681 from jholton/3-2-stable-fix_association_auto_save
autosave_association issue that occurs when table has unique index (3.2.x backport)
2013-05-22 15:38:15 -07:00
Rafael Mendonça França
b0f96d4436 Merge pull request #10646 from kennyj/fix_am_20130517
Fix ActionMailer testcase break with mail 2.5.4.
Conflicts:
	actionmailer/CHANGELOG.md
	actionmailer/test/mailers/base_mailer.rb
2013-05-20 15:50:36 -03:00
Johnny Holton
c2362461cd destroys association records before saving/inserting new association records
This is a backport of #10417

fixes bug introduced by  #3329
These are the conditions necessary to reproduce the bug:
- For an association, autosave => true.
- An association record is being destroyed
- A new association record is being created.
- There is a unique index one of the association's fields.
- The record being created has the same value as the record being
destroyed on the indexed field.

Before, the deletion of records was postponed until after all
insertions/saves.  Therefore the new record with the identical value in
the indexed field caused a non-unique value error to be thrown at the
database
level.

With this fix, the deletions happen first, before the insertions/saves.
Therefore the record with the duplicate value is gone from the database
before the new record is created, thereby avoiding the non-uniuqe value
error.
2013-05-18 18:20:52 -04:00
Rafael Mendonça França
0d8dbd131b Merge pull request #10578 from dingle/lu/back_port_to_json_fix
Support include_root_in_json for ActiveResource properly.
2013-05-15 18:00:11 -07:00
Xinjiang Lu
ec55866e39 Support include_root_in_json for ActiveResource properly.
This commit is a backport from
https://github.com/rails/activeresource/pull/29. The
ActiveResource's include_root_in_json option is broken for 3.2.x.
2013-05-15 20:22:18 -04:00
Rafael Mendonça França
5b020fa110 Merge pull request #10616 from Empact/backport-distinct-distinct
Backport a super-simplified version of #6792, fixing that #exists? can produce invalid SQL: "SELECT DISTINCT DISTINCT"
2013-05-14 07:21:30 -07:00
Ben Woosley
23c656c1bc Backport a super-simplified version of #6792, fixing
that #exists? and others can produce invalid SQL: "SELECT DISTINCT DISTINCT"

The combination of a :uniq => true association and the #distinct call
in #construct_limited_ids_condition combine to create invalid SQL, because
we're explicitly selecting DISTINCT, and also sending #distinct on to AREL,
via the relation#distinct_value.

Where #6792 was the forever fix, this is the minimal fix. Instead of
properly indicating the distinctness of the query through #uniq_value alone,
we use a literal select statement and set #uniq_value to always be falsey
2013-05-14 16:03:17 +02:00
Mikel Lindsaar
010ea715f2 Update mail to minimum version 2.5.4 2013-05-14 15:01:31 +10:00
Rafael Mendonça França
b1fb8efd9b Improve CHANGELOG entries
[ci skip]
2013-05-12 18:45:57 -03:00
Rafael Mendonça França
442b7c8ccf Merge pull request #7695 from benolee/backport_cc7dd66_and_c0ba0f0
backport runner fixes to 3-2-stable

Conflicts:
	railties/CHANGELOG.md
2013-05-12 15:13:47 -03:00
Rafael Mendonça França
5919a552e4 Merge pull request #10303 from ahorner/3-2-stable
Preserve context for joins while merging relations
2013-05-11 20:48:21 -07:00
Andrew Horner
c09829e03d Preserve context for joins while merging relations
This is a backport of #10164, already merged into
master. The issue is described in lengthy detail
in issues #3002 and #5494.
2013-05-11 22:41:47 -05:00
Rafael Mendonça França
5c6cf4e59e Merge pull request #10571 from dasch/dasch/restore-explain-fix
Don't try to EXPLAIN select_db calls
2013-05-11 16:01:44 -07:00
Daniel Schierbeck
ddaa5d5181 Don't try to EXPLAIN select_db calls
Now with a non-broken test.
2013-05-12 00:33:01 +02:00
Rafael Mendonça França
e2804c62df Add CHANGELOG entry removed by mistake [ci skip] 2013-05-11 18:49:36 -03:00
Xavier Noria
0549ebea22 Revert "Don't try to EXPLAIN select_db calls"
Reason: This was backported, but the test does not pass as is.

This reverts commit a33d320cf4.
2013-05-11 01:28:06 +02:00
Rafael Mendonça França
0be27b709b So not make Fixnum#/ private on Ruby verions less than 1.9.3
In those version to_date call Fixnum#/, what will cause a failure
2013-05-10 14:10:10 -03:00
Rafael Mendonça França
a59d661a82 Fix test to ruby 2.0
The default enconding changed on Ruby 2.0
2013-05-10 13:36:42 -03:00
Andrew White
a71119335e Merge pull request #10557 from arunagw/pluck-refactor-using-map
Using map. No need to run query again
2013-05-10 08:37:03 -07:00
Arun Agrawal
afedb090f0 Using map. No need to run query again 2013-05-10 17:33:47 +02:00
Xavier Noria
4fa860728f Merge pull request #10555 from dasch/dasch/3-2-stable
Don't try to EXPLAIN select_db calls
2013-05-10 08:05:54 -07:00
Daniel Schierbeck
a33d320cf4 Don't try to EXPLAIN select_db calls 2013-05-10 16:50:35 +02:00
Rafael Mendonça França
3589181122 Merge pull request #10552 from arunagw/pluck-fixed-3-2-stable
Pluck fixed 3 2 stable
2013-05-10 07:06:50 -07:00
Arun Agrawal
de5b89ddc9 Fixed pluck to be working with selects.
See #9777 for details.

Previously pluck is not returning what we wanted to
Added a test also to make sure it's working fine.
 
This will also fix the build for 1.8.7 as we 
were doing some sort on hash.

Thanks @pixeltrix for helping me out.

Thanks @linduxed for pairing with me.
2013-05-10 16:05:05 +02:00
Arun Agrawal
6ab3c73062 Remove useless else 2013-05-10 15:17:24 +02:00
Rafael Mendonça França
84c69a1653 Revert "Merge pull request #8209 from senny/backport_8176"
This reverts commit 7240202784, reversing
changes made to e4e2bcce75.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb

Reason: This caused a regression since it changed the behavior in a
stable release.

Fixes #9777
2013-05-08 23:34:24 -03:00
Rafael Mendonça França
c910388587 Revert "Remove unicode character encoding from ActiveSupport::JSON.encode"
This reverts commit 815a9431ab.

Conflicts:
	activesupport/test/json/encoding_test.rb

Reason: This was causing a regression where the resulting string is always
returning UTF-8. Also it changes the behavior of this method on a stable release.

Fixes #9498.
2013-05-08 21:03:37 -03:00
Carlos Antonio da Silva
8218a46adb Merge pull request #10496 from arunagw/build-fix-scaffold-generator
Build fix for scaffold generator
2013-05-07 05:13:49 -07:00
Arun Agrawal
8407ab10f0 Build fix for scaffold generator
3-2 behaves different when scaffolding.
2013-05-07 12:53:23 +02:00
Rafael Mendonça França
f8c4a31e0b Merge pull request #10489 from greenriver/ar_counter_cache_multiple_destroy
Confirm a record has not already been destroyed before decrementing counter cache

Conflicts:
	activerecord/CHANGELOG.md

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/builder/belongs_to.rb
2013-05-06 22:44:01 -03:00
Rafael Mendonça França
0b35a3aacc Merge pull request #10478 from cainlevy/patch-1
use canonical #controller_path logic in controller test cases
Conflicts:
	actionpack/lib/action_controller/test_case.rb
2013-05-06 22:19:46 -03:00
Rafael Mendonça França
fb90ce015f Merge pull request #10406 from greenriver/distance_of_time_rational
Correct time_ago_in_words to handle situation where Fixnum#/ returns a Rational (thanks to mathn)
2013-05-06 07:27:59 -07:00
Ben Tucker
5a6d9d5491 Merging in fix from #8222 2013-05-06 09:36:40 -04:00
Carlos Antonio da Silva
3c01a693d9 Merge pull request #10466 from prathamesh-sonpatki/scaffold-assets
Fix tests related to scaffolding generator with --assets=false switch
2013-05-05 11:31:15 -03:00
Rafael Mendonça França
927a04da40 Merge pull request #10448 from arunagw/bug-fix-scaffold-generator-master
Fixes Scaffold generator with --assets=false
Conflicts:
	railties/CHANGELOG.md

Conflicts:
	railties/CHANGELOG.md
	railties/lib/rails/generators/rails/scaffold/scaffold_generator.rb
2013-05-04 10:58:53 -03:00
Janko Marohnić
5519468523 Fix ActiveRecord::Store not tracking changes 2013-04-29 20:39:52 +02:00
Aaron Patterson
9d7a748a51 adding test for the symbol refs 2013-04-26 16:47:27 -07:00
Aaron Patterson
ba12ef6ae1 just clear the caches on clear! rather than replacing. fixes #10251 2013-04-17 11:36:08 -07:00
Aaron Patterson
03d071d3cf adding a test for root path in the app 2013-04-17 11:30:17 -07:00
Carlos Antonio da Silva
dddc093a1a Merge pull request #10246 from prathamesh-sonpatki/3.2.13-https-rubygems
Using secure source https://rubygems.org when generating new plugin with Rails 3.2
2013-04-17 05:23:03 -07:00
Prathamesh Sonpatki
cd548d9283 Use secure source in generated Gemfile for creating new plugin. Closes #10245 2013-04-17 17:40:52 +05:30
Carlos Antonio da Silva
624428b278 Fix "Scaling Rails Screencasts" link in caching guide
Closes #10241 [ci skip]
2013-04-16 20:25:34 -03:00
Carlos Antonio da Silva
130f96c432 Merge pull request #9688 from alexeymuranov/doc-nested-attributes-3-2
3-2-stable documentation: the possibility to use a hash of hashes for nested attributes
2013-04-13 15:11:26 -07:00
Alexey Muranov
efd86315a7 Document nested attributes as hash of hashes
Document the possibility to use a hash of hashes for nested attributes for a one-to-many association (in addition to the documented possibility to use an array of hashes).

Align indentation in comments.
2013-04-13 13:56:09 +02:00
Rafael Mendonça França
68239487bf Merge pull request #10172 from senny/10098_backport
Backport: Correctly parse bigint defaults in PostgreSQL
2013-04-11 06:41:49 -07:00
Erik Peterson
a6d9e16e41 Correctly parse bigint defaults in PostgreSQL, Backpost #10098.
Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
	activerecord/test/cases/schema_dumper_test.rb
2013-04-11 10:11:18 +02:00
Aaron Patterson
536f316cd3 Merge branch '3-2-later' into 3-2-stable
* 3-2-later:
  adding test for CVE
2013-04-09 09:22:42 -07:00
Rafael Mendonça França
c9bd2022d4 Improve the changelog entry [ci skip] 2013-04-05 16:54:01 -03:00
Rafael Mendonça França
dbe25910fa Merge pull request #10105 from rmm5t/fix-explicit-name-on-multiple-fields
Fix explicit names on multiple file fields
2013-04-05 12:53:26 -07:00
Ryan McGeary
44a9aedd7b Fix explicit names on multiple file fields
If a file field tag is passed the multiple option, it is turned into an
array field (appending "[]"), but if the file field is passed an
explicit name as an option, leave the name alone (do not append "[]").

Fixes #9830
2013-04-05 15:35:20 -04:00
Carlos Antonio da Silva
fe58853765 Fix typo in view name
Introduced in 2c22376fe0
2013-04-03 20:59:44 -03:00
Carlos Antonio da Silva
e252e0ffe1 Use 1.8 hash style in test views
Introduced in 2c22376fe0
2013-04-03 20:59:40 -03:00
Carlos Antonio da Silva
e59f3809ef Merge pull request #7792 from seejee/chained_scopes_preload_properly
Fixes Issue #7490: Chained scopes will preload properly
2013-04-03 15:43:59 -07:00
Chris Geihsler
453c7d6c47 Chained scopes will be preloaded properly. Fixes #7490 2013-04-03 18:41:12 -04:00
Dmitry Vorotilin
2c22376fe0 Common behavior with adding formats to lookup_context for TemplateRenderer and PartialRenderer 2013-04-02 10:36:23 -07:00
Carlos Antonio da Silva
060fca7897 Fix formatting and minor review in AP changelog
Sentences starting with # are considered headings.
2013-03-30 16:42:52 -03:00
Steve Klabnik
bac6928eef Add attr_accessible to the Getting Started Guide.
This was brought up in #9995, but is only present in 3-2-stable, since
mass assignment is removed from Rails 4.
2013-03-29 16:28:04 -07:00
Rafael Mendonça França
e06b4fab8e Removing explain support warning from the Railtie
This is causing a regression since the Active Record Railtie is trying to
connect to the development database in the application boot.

See https://github.com/rails/rails/pull/6197#issuecomment-15199273
2013-03-28 13:21:56 -03:00
Carlos Antonio da Silva
75d0a81ffe Merge pull request #9943 from fredwu/test_fix_for_74e59ea
Fixed test failures on 1.8.7 caused by 74e59ea
2013-03-26 19:43:14 -07:00
Fred Wu
dee5915aac Fixed test failures on 1.8.7 caused by 74e59ea 2013-03-27 11:29:37 +11:00
Rafael Mendonça França
df37c91745 Merge pull request #9576 from fredwu/backport_fix_explicitly_inheraitance_column_to_3_2_stable
[Backport to 3-2-stable] Don't reset inheritance_column when setting explicitly.
2013-03-26 15:22:05 -07:00
Fred Wu
8bd56f0f7a Added changelog for 55e2954 2013-03-27 09:20:04 +11:00
Fred Wu
55e2954703 Don't reset inheritance_column when setting explicitly.
This is backported from master (cdfcbc4).
2013-03-27 09:12:31 +11:00
Jeremy Kemper
dbd26e92a7 Merge pull request #9899 from macksmind/backport_5808
Backport #5808
2013-03-24 13:19:20 -07:00
Mack Earnhardt
74e59ea8b6 Backport #5808
df36c5f - Fix assert_template assertion with :layout option
4bd05a7 - Fix assert_template :layout => nil assertion
0d19a08 - Improve assert_template layout checking
2013-03-24 08:16:26 -04:00
Jon Rowe
0c96169f59 test case to assert that associations do not overwrite after create, fixes #9310 2013-03-24 12:32:11 +13:00
Jon Leighton
029dd435e4 Merge pull request #9873 from senny/use_old_hash_syntax
use ruby 1.8 Hash syntax [ci skip]
2013-03-22 07:25:24 -07:00
Yves Senn
845cc5c78d use ruby 1.8 Hash syntax [ci skip] 2013-03-22 15:23:57 +01:00
Jon Leighton
ae2baab1aa Merge pull request #9870 from senny/9806_eager_loading_regression
do not reset associations when preloading twice.
2013-03-22 07:14:17 -07:00
Yves Senn
c8edd4fda4 do not reset associations when preloading twice.
Closes #9806.

As the `through_options` always contained `{:order=>nil}` the second time,
the preloader ran, the association was always reset. This patch only
adds the `:order` to the `through_options` if it is set.
2013-03-22 15:08:09 +01:00
Rafael Mendonça França
69599b63de Fix test to Ruby 1.8
Pathname doesn't respond to to_path
2013-03-21 09:33:22 -03:00
Rafael Mendonça França
afe5880fa6 Improve CHANGELOG entry [ci skip] 2013-03-21 09:16:48 -03:00
Aaron Patterson
d1577cfe3d Merge branch '3-2-stable' into fredwu-slow_view_loading_fix
* 3-2-stable:
  Merge pull request #9802 from newsline/fix-broken-action-missing
  Remove bad changelog entry from AR [ci skip]
  Wrong exception is occured when raising no translatable exception
  Don't crash exception translation w/ nil result attribute.

Conflicts:
	actionpack/CHANGELOG.md
2013-03-20 16:41:01 -07:00
Fred Wu
38d0647861 Added changelog for 687e68d 2013-03-21 09:26:07 +11:00
Rafael Mendonça França
2c8f349953 Merge pull request #9802 from newsline/fix-broken-action-missing
Fix missing action_missing

Conflicts:
	actionpack/CHANGELOG.md

Conflicts:
	actionpack/test/controller/base_test.rb

Fixes #9799
2013-03-20 18:22:31 -03:00
Carlos Antonio da Silva
7e8a74d401 Remove bad changelog entry from AR [ci skip]
Introduced in dc2bc388bc.
2013-03-20 12:09:56 -03:00
kennyj
dc2bc388bc Wrong exception is occured when raising no translatable exception
Conflicts:
	activerecord/CHANGELOG.md
2013-03-20 10:11:07 +00:00
Steve Jorgensen
be913c3964 Don't crash exception translation w/ nil result attribute.
Exception.result is nil when attempting a query after PostgreSQL
disconnect, resulting in new exception:
NoMethodError: undefined method `error_field' for nil:NilClass
2013-03-20 10:09:54 +00:00
Fred Wu
687e68d88f Fixed assets loading performance in 3.2.13
The PR #8756 uses Sprockets for resolving files that already exists on disk, for those files their extensions don't need to be rewritten.

Fixes #9803
2013-03-20 16:13:30 +11:00
Carlos Antonio da Silva
517060ab59 Be consistent with quotes in smtp example guide [ci skip] 2013-03-19 17:57:22 -03:00
Rafael Mendonça França
2011cc64e1 Merge pull request #9796 from dembskoi/clone_structure
Reset postgreSQL search path in db:test:clone_structure.
2013-03-19 09:21:01 -07:00
Alexander
ca6a12d6e5 Reset postgreSQL search path in db:test:clone_structure.
This patch resets the postgres search path in the structure.sql after
the structure is dumped in order to find schema_migrations table when
multiples schemas are used.

Fixes #945
2013-03-19 19:34:56 +04:00
Rafael Mendonça França
493c10ea29 Merge pull request #9804 from samsonasu/backport_number_to_human_fixes
Backport #9347 to rails 3.2
2013-03-19 07:59:15 -07:00
hoffm
1b12d08a0f Backport #9347 to rails 3.2 2013-03-19 09:30:50 -05:00
José Valim
2cf38aebac Merge pull request #9789 from puma/3-2-stable
Change @env_config to @app_env_config
2013-03-18 19:54:12 -07:00
Evan Phoenix
8aadc6f0f4 Change @env_config to @app_env_config
Moral of the story: One must be careful about lazily initializing
instance variables when subclassing.

I would like to draw your attention to https://github.com/rails/rails/issues/4652 where
the reader will see that there appears to be some kind of initialization issue
in rails.

The source of this issue is that:
1) Engine#env_config contains "@env_config ||= ..."
2) Application#env_config contains "@env_config ||= ..."
3) Threads are in the picture
4) Thread A calls Application#env_config, which super's to Engine#env_config
5) After Engine#env_config returns but before Application#env_config sets @env_config again, Thread B begins running
6) Thread B calls Application#env_config
7) Thread B finds @env_config to contain a value (the one set by Engine#env_config) and returns it
8) Thread B blows up because key set by Application#env_config are there.
9) People report bugs with puma, thin, rainbows, webrick, etc
10) Evan becomes tired of seeing these bugs
11) Evan pours himself a stiff drink, puts on Top Gear(tm), and begins debugging
12) Evan finds the source of the bug
13) Evan authors a PR
14) RIGHT NOW.

The bug is fixed by simply using a different ivar name in the methods.
Alternately, Engine#env_config could just return a new Hash each time, not memoizing into @env_config.

I bid you adieu.
2013-03-18 19:33:47 -07:00
Rafael Mendonça França
ef5faeb4a5 Merge pull request #9785 from claudiob/add-3-2-13-release-date-to-changelogs
Add release dates to documentation [ci skip]
2013-03-18 14:57:13 -07:00
claudiob
0e56c1de70 Add release dates to documentation [ci skip]
Set "March 18, 2013" as the release date for 3.2.13
2013-03-18 14:51:46 -07:00
Carlos Antonio da Silva
167b645a2a Bring back test and changelog entry from #pluck method and select clause 2013-03-18 18:28:07 -03:00
Carlos Antonio da Silva
9194221921 Fix method name indent [ci skip] 2013-03-18 18:28:07 -03:00
Carlos Antonio da Silva
a8e7a009d2 Fix changelog conflicts and remove release dates [ci skip] 2013-03-18 18:18:55 -03:00
Aaron Patterson
afcd01bf25 Merge branch '3-2-13' into 3-2-stable
* 3-2-13:
  bumping to 3.2.13
  fix protocol checking in sanitization [CVE-2013-1857]
  JDOM XXE Protection [CVE-2013-1856]
  fix incorrect ^$ usage leading to XSS in sanitize_css [CVE-2013-1855]
  stop calling to_sym when building arel nodes [CVE-2013-1854]
  Merge pull request #9616 from exviva/multiple_select_name_double_square_brackets
  bumping to rc2
  Revert "Merge pull request #8209 from senny/backport_8176"
  Freeze columns only once per Result
  Preparing for 3.2.13.rc1 release
  Update CHANGELOGs for 3.2.13 release.

Conflicts:
	actionmailer/CHANGELOG.md
	actionpack/CHANGELOG.md
	activemodel/CHANGELOG.md
	activeresource/CHANGELOG.md
	activesupport/CHANGELOG.md
	railties/CHANGELOG.md
2013-03-18 10:17:04 -07:00
Aaron Patterson
a4b5582772 bumping to 3.2.13 2013-03-18 09:23:04 -07:00
Carlos Antonio da Silva
491d6916c9 Merge pull request #9768 from senny/do_not_freeze_number_helper_defaults
Do not freeze NumberHelper defaults
2013-03-18 08:53:48 -07:00
Yves Senn
f662a748a5 do not freeze NumberHelper defaults.
Closes #9767.
2013-03-18 16:51:35 +01:00
Aaron Patterson
99123ad12f fix protocol checking in sanitization [CVE-2013-1857]
Conflicts:
	actionpack/lib/action_controller/vendor/html-scanner/html/sanitizer.rb
2013-03-15 17:48:42 -07:00
Ben Murphy
c0d06633f0 JDOM XXE Protection [CVE-2013-1856]
Conflicts:
	activesupport/test/xml_mini/jdom_engine_test.rb
2013-03-15 17:48:27 -07:00
Charlie Somerville
ff3b9ca130 fix incorrect ^$ usage leading to XSS in sanitize_css [CVE-2013-1855] 2013-03-15 17:48:12 -07:00
Aaron Patterson
f980289fd2 stop calling to_sym when building arel nodes [CVE-2013-1854] 2013-03-15 17:47:28 -07:00
Justin
1c2717d3f5 Typo fix [ci ski]
Closes #9730.
2013-03-15 09:48:27 -03:00
Steve Klabnik
9d5699a05c Merge pull request #7368 from jbarreneche/bug/render-locale-fallbacks
i18n locale fallback for localized views
2013-03-14 14:07:19 -07:00
Juan Barreneche
ce755697fc Extract hardcoded lists to Redo::RestaurantsList 2013-03-14 18:02:20 -03:00
Andrew White
3d4d7420ae Fix ar:mysql2 build on Ruby 1.8.7
The `skip` method is a no-op on Ruby 1.8.7 so we still need to
force skip by returning early from each test.
2013-03-13 07:24:21 +00:00
Andrew White
ba910d7650 Fix ActiveSupport::TimeZone.parse when time is a local DST jump
The previous implementation `ActiveSupport::TimeZone.parse` used `Time.parse`
which applies the system time DST rules to the parsed time. Instead we now
use `Time.utc` and manually apply the offset.

Backport tests from:
005d910624bbfa724b638426a000c8074d4201a2
c89b6c4cdce7ee55ed3665c099d914222fe0344a
03becb13099c439f6aea5058546bc8b0b19b8db8

Fixes #9678.
2013-03-13 05:40:25 +00:00
Carlos Antonio da Silva
488699166c Merge pull request #9616 from exviva/multiple_select_name_double_square_brackets
Fix incorrectly appended square brackets to a multiple select box

Before:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][][]" ...>

After:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][]" ...>

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_view/helpers/tags/base.rb
	actionpack/test/template/form_options_helper_test.rb
2013-03-12 19:58:22 -03:00
Carlos Antonio da Silva
a0c3c1e1f7 Merge pull request #9616 from exviva/multiple_select_name_double_square_brackets
Fix incorrectly appended square brackets to a multiple select box

Before:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][][]" ...>

After:

    select(:category, [], {}, {:multiple => true, :name => "post[category][]"})
    # => <select name="post[category][]" ...>

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_view/helpers/tags/base.rb
	actionpack/test/template/form_options_helper_test.rb
2013-03-09 12:05:30 -03:00
Carlos Antonio da Silva
348d693c6a Merge pull request #9613 from arunagw/remove_fixme
Removing FIXME
2013-03-08 07:43:24 -08:00
Arun Agrawal
c8918c6972 Removing FIXME
As we did in master.
2013-03-08 16:08:43 +01:00
Carlos Antonio da Silva
8f5c7509d6 Merge pull request #9609 from arunagw/using-latest-arjdbc
Using latest AR-JDBC for JRuby
2013-03-08 04:41:21 -08:00
Arun Agrawal
3033dbed28 Using latest AR-JDBC for JRuby
1.2.5 and 1.2.6 are bad ones
2013-03-08 11:22:27 +01:00
Rafael Mendonça França
075d0e2c3f Merge pull request #9600 from larrylv/fix-load-target-with-identity-map-on
@target might be nil when Identity Map is enabled.
2013-03-07 11:49:56 -08:00
Larry Lv
f01f03e963 @target might be nil when Identity Map is enabled.
* With Identity Map enabled, NameError might be raised and @target is
  nil. So we should always ensure `@target ||= find_target`.

* Only force reload target when it is stale.
2013-03-08 03:37:01 +08:00
Rafael Mendonça França
9bd5c86c3b Merge pull request #9549 from larrylv/reload-stable-target-before-saving
Fix issue #7526. Reload the association target if it's stale.
2013-03-07 08:23:23 -08:00
Rafael Mendonça França
bb0007f704 Merge pull request #9594 from yahonda/3-2-stable_prefix_suffix
Use shorter prefix and suffix to support Oracle adapter
2013-03-07 06:07:24 -08:00
Yasuo Honda
5d57b821d0 Use shorter prefix and suffix as in Oracle database identifier
cannot be larger than 30 characters
2013-03-07 22:34:54 +09:00
Aaron Patterson
ccf256d8dc bumping to rc2 2013-03-06 15:05:13 -08:00
Aaron Patterson
1b699fc8ad Revert "Merge pull request #8209 from senny/backport_8176"
This reverts commit 7240202784, reversing
changes made to e4e2bcce75.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
2013-03-05 11:33:16 -08:00
Steve Klabnik
51ae6f4bb1 Update CHANGELOGs for 3.2.13.rc1 2013-03-05 11:22:55 -08:00
Santiago Pastorino
b5445247ad Freeze columns only once per Result
Conflicts:
	activerecord/lib/active_record/result.rb
2013-03-05 11:12:32 -08:00
Carlos Antonio da Silva
0df9647597 Merge pull request #9543 from maximerety/backport_fix_7774
Backported #7774 to 3-2-stable
2013-03-05 04:18:02 -08:00
maximerety
d0f22a99f9 Backport fixes about #7774 to 3-2-stable
Fix ActionDispatch::Request#formats when HTTP_ACCEPT header is an empty
string.
2013-03-05 12:53:10 +01:00
larrylv
939b896a06 Fix issue #7526. Reload the target if it's stale.
* This has been fixed at master via `365b8b6`, but not at 3-2-stable branch.

* @stale_state should be nil when a model isn't saved. via `0f3901e`.

* set @stale_state to nil when reset the target.
2013-03-05 12:43:05 +08:00
Guillermo Iguaran
927e649bc9 Merge pull request #9531 from erik-escobedo/patch-1
Fix typo on ActionPack's ChangeLog
2013-03-03 11:35:33 -08:00
Andrew White
0108eaf3c1 Merge pull request #9528 from korny/patch-1
Fix unused variable warning in mapper.rb
2013-03-03 11:34:23 -08:00
Érik Escobedo
1129cb31d7 Fix typo on CHANGELOG.md 2013-03-03 13:33:45 -06:00
Kornelius Kalnbach
98739cf45f remove unused path_without_format variable
Was forgotten in a72dab0.
2013-03-03 19:14:37 +01:00
Santiago Pastorino
d2b9862b24 Freeze columns only once per Result
Conflicts:
	activerecord/lib/active_record/result.rb
2013-03-03 08:07:19 -08:00
Yves Senn
2e2f8c07d0 Update docs, change_table does not use TableDefinition.
[ci skip]

Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/schema_definitions.rb
2013-02-28 10:19:18 -03:00
Carlos Antonio da Silva
9756aa640f Improve AR changelog [ci skip] 2013-02-28 09:03:37 -03:00
Carlos Antonio da Silva
5e1d629ff6 Merge pull request #9485 from authorNari/backport-6755-to-3-2-stable
Backported #6755 to 3-2-stable. Don't read csv file during executing db:fixtures:load.

CSV fixtures have already been removed some time ago in 1716da0720, but the task was still loading them, even though later it tried to find the related yaml file.
2013-02-28 04:00:38 -08:00
Narihiro Nakamura
3170d2b768 Backported #6755 to 3-2-stable. Don't read csv file during executing db:fixtures:load. 2013-02-28 18:02:25 +09:00
Carlos Antonio da Silva
641a27d47b Enforce i18n version >= v0.6.4
v0.6.2 and v0.6.3 both have issues with Ruby 1.8.7, see
https://github.com/svenfuchs/i18n/issues/192 for more info.
2013-02-27 21:04:02 -03:00
Rafael Mendonça França
a1f18d3d72 Merge pull request #9472 from yahonda/revert_7544c7a9
Revert "Skip test_remove_column_with_array_as_an_argument_is_deprecated ...
2013-02-27 13:12:47 -08:00
Yasuo Honda
c27da1fbcc Revert "Skip test_remove_column_with_array_as_an_argument_is_deprecated with Oracle adapter."
This reverts commit 7544c7a9f2.

Oracle enhanced adapter is supporting remove_column with Array.
2013-02-28 05:46:56 +09:00
Rafael Mendonça França
6a65a8caf3 Merge pull request #9471 from yahonda/5837_32-stable
Fix ORA-00972 error at test_rename_table_with_prefix_and_suffix
2013-02-27 12:36:04 -08:00
Yasuo Honda
97df33d818 Fix ORA-00972 error at test_rename_table_with_prefix_and_suffix
backport pull request#5837 to 3-2-stable
2013-02-28 05:22:08 +09:00
Steve Klabnik
5ca59b02d1 Preparing for 3.2.13.rc1 release 2013-02-27 12:19:06 -08:00
Steve Klabnik
23434f6162 Update CHANGELOGs for 3.2.13 release. 2013-02-27 10:06:45 -08:00
Steve Klabnik
197b9f4d61 Tighten up AS.gemspec.
Apparently 0.6.2 has a call to force_encoding, which is not around
in 1.8.7.
2013-02-26 20:28:35 -08:00
Steve Klabnik
1a88523f86 CHANGELOG entry for ee291b9.
Since we released it, it should go in the CHANGELOG.
2013-02-26 17:09:23 -08:00
Steve Klabnik
ee291b9b41 Revert "Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric"
This reverts commit 921a296a33.
2013-02-26 16:57:18 -08:00
Hiroshige Umino
55a1765942 Do not override attributes on dup by default scopes 2013-02-26 11:08:50 -08:00
Carlos Antonio da Silva
c90e24d087 Improve changelog entry [ci skip] 2013-02-26 08:38:12 -03:00
Carlos Antonio da Silva
06eb872035 Merge pull request #9430 from authorNari/backport-7072-to-3-2-stable
Backported #7072 to 3-2-stable. Use database value for uniqueness validation scope
2013-02-26 03:36:06 -08:00
Narihiro Nakamura
905b7df1fa Backported #7072 to 3-2-stable. Use database value for uniqueness validation scope. 2013-02-26 14:39:26 +09:00
Rafael Mendonça França
0761bb0298 Merge pull request #9408 from mikeycgto/origin/3-2-stable
Update RUBY_VERSION check for performance testing to handle 2.0.0
2013-02-24 18:58:25 -08:00
mikeycgto
6df2db3298 Update RUBY_VERSION check for performance testing to handle 2.0.0 2013-02-24 21:43:32 -05:00
Rafael Mendonça França
e9d659224b Merge pull request #9406 from rails/3-2-stable-ruby-2
Rails 3.2.x is now compatible with Ruby 2.0.0
2013-02-24 15:12:13 -08:00
Prem Sichanugrist
2a12a04a54 Rails 3.2.x is now compatible with Ruby 2.0.0 2013-02-24 16:33:35 -05:00
SHIBATA Hiroshi
621b5b7f0e added marshal_load and marshal_dump for ProxyTestResult. Behavior of method_missing with Marshal.dump and Marshal.load is changing in ruby 2.0.0 later. 2013-02-24 16:32:26 -05:00
Prem Sichanugrist
8598633cc1 Do not redirect cache logger to /dev/null in test
For some reason, redirecting cache's logger to '/dev/null' resulting in
a test failures and LoadError. I think it's because of Thread issue.
Instead of trying to make every logger threadsafe for Rails 3.2, I think
it's better to just don't set the logger for now.

(Note: resetting the logger back to original value in the teardown block
didn't fix the problem.)
2013-02-24 16:32:25 -05:00
Jeremy Kemper
5693d44468 Ruby 2 compat. Hash[] now raises on bad elements rather than ignoring them. No sense over-testing this MRI-specific behavior. See ruby/ruby@8d6add973e 2013-02-24 16:32:25 -05:00
Rafael Mendonça França
0190dcae3c Make the tests pass with minitest 4.2 2013-02-24 16:32:25 -05:00
Prem Sichanugrist
979e198c14 Check for method_missing in public and protected
Ruby 2.0 changed the behavior of `respond_to?` without argument to
return only search for public method. We actually want to perform the
action only if `method_missing` is either in public or protected.
2013-02-24 16:32:25 -05:00
thedarkone
abf0c71021 There is already a Set of non-hidden action_names lying around. 2013-02-24 16:32:25 -05:00
Jeremy Kemper
42d7927c22 Ruby 2 compat. CGI.escapeHTML has changed the way it escapes apostrophes a few times, so fix up the test to work with however it chooses to escape. 2013-02-24 16:32:25 -05:00
Aaron Patterson
2a5f6d8fe6 Ruby 2.0.0 defaults source encoding to utf-8 so we need to specifically tag this file with us-ascii 2013-02-24 16:32:25 -05:00
Aaron Patterson
7cc26fd15e search private and protected methods for convert_key 2013-02-24 16:32:25 -05:00
Prem Sichanugrist
45e9cac12c Define #inspect instead of #to_s
Ruby 2.0 Object#inspect does not call #to_s by default anymore.
2013-02-24 16:32:24 -05:00
Prem Sichanugrist
b59b72a5ae Fix failing test case when no database.yml 2013-02-24 16:32:24 -05:00
Aaron Patterson
9a0cdc68b5 name should be public. 2013-02-24 15:29:24 -05:00
Prem Sichanugrist
fe4fce80f3 Add in missing requires 2013-02-24 15:29:24 -05:00
Carlos Antonio da Silva
2647a3cabf Merge pull request #9388 from senny/9367_wrong_schema_after_remove_column
Sqlite preserves primary keys when copying/altering tables.
2013-02-23 06:26:20 -08:00
Yves Senn
8f6fa345e5 Sqlite preserves primary keys when copying/altering tables.
Backport #2312.
Fixes #9367.

I also added a test-case to make sure that renaming or removing
a column preserves the primary key.
2013-02-23 15:23:28 +01:00
Carlos Antonio da Silva
0c1558d32f Use 1.8 hash style 2013-02-22 14:42:35 -03:00
Andrew White
e55b0f6d42 Merge pull request #9374 from senny/improved_match_shorthand_syntax
determine the match shorthand target early.
2013-02-22 00:35:28 -08:00
Yves Senn
a72dab0b6a determine the match shorthand target early.
Backport #9361.
Closes #7554.

This patch determines the `controller#action` directly
in the `match` method when the shorthand syntax is used.
this prevents problems with namespaces and scopes.
2013-02-22 09:04:04 +01:00
Carlos Antonio da Silva
fdcd7c0f2e Change tabs to spaces in form options helper [ci skip] 2013-02-21 12:48:45 -03:00
Rafael Mendonça França
a0d84227c2 Use order to get the first record since postgresql returns in the
desired order
2013-02-20 22:31:02 -03:00
Rafael Mendonça França
31436206d9 Merge pull request #9323 from senny/build_fix_from_9252
keep the build 💚, #first on 1.8.7 and pg is different
2013-02-19 05:58:08 -08:00
Yves Senn
9be7f63db9 keep the build 💚, #first on 1.8.7 and pg is different
The build only failed for ruby-1.8.7 and pg. The problem was that the statement:

```ruby
author = Author.includes(:comments_with_order_and_conditions, :posts).first
```

resulted in Author with ID 2 where on all other rubies / db-engines Author with ID 1
was retunred. Of course this breaks the assertions.
2013-02-19 14:42:45 +01:00
Rafael Mendonça França
b4e053e867 Merge pull request #9322 from senny/backport_9252
don't cache invalid subsets when preloading hmt associations.
2013-02-19 04:33:42 -08:00
Yves Senn
587f563c40 don't cache invalid subsets when preloading hmt associations.
Backport #9252.

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/eager_test.rb

The preloader code on 3-2-stable is not based on relations but on option hashes.
I had to modify the original patch and comparing the option hashes could be more
fuzzy than comparing the relations. All the tests passed though.
2013-02-19 11:11:27 +01:00
Rafael Mendonça França
46b65ba274 Allow failures to 2.0.0 2013-02-18 18:49:13 -03:00
Lilibeth De La Cruz
3c5f631caa Fix handling of dirty time zone aware attributes
Previously, when `time_zone_aware_attributes` were enabled, after
changing a datetime or timestamp attribute and then changing it back
to the original value, `changed_attributes` still tracked the
attribute as changed. This caused `[attribute]_changed?` and
`changed?` methods to return true incorrectly.

Example:

    in_time_zone 'Paris' do
      order = Order.new
      original_time = Time.local(2012, 10, 10)
      order.shipped_at = original_time
      order.save
      order.changed? # => false

      # changing value
      order.shipped_at = Time.local(2013, 1, 1)
      order.changed? # => true

      # reverting to original value
      order.shipped_at = original_time
      order.changed? # => false, used to return true
    end

(cherry picked from commit bc982cbcb34129ea2cfe8aa1f8e0b40e444e68db)

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb

Backport of #9073
Fixes #8898
2013-02-17 16:19:09 +00:00
Xavier Noria
f7c8457453 Merge pull request #9308 from joernchen/patch-1
Update activemodel/CHANGELOG.md
2013-02-16 11:24:20 -08:00
joernchen of Phenoelit
01b63c7bc7 Update activemodel/CHANGELOG.md
Fixed a typo
2013-02-16 20:01:54 +01:00
Rafael Mendonça França
7f4975ffc6 Revert "Merge pull request #9252 from senny/8423_hmt_preloading_bug"
This reverts commit c5451777b0.

Conflicts:
	activerecord/CHANGELOG.md
2013-02-15 13:00:53 -02:00
Rafael Mendonça França
de83b017a9 Do not put the version in unreleased changes [ci skip] 2013-02-14 15:46:28 -02:00
Rafael Mendonça França
b9720355d0 Fix the CHANGELOG headers [ci skip] 2013-02-14 15:36:45 -02:00
Rafael Mendonça França
c5451777b0 Merge pull request #9252 from senny/8423_hmt_preloading_bug
don't cache invalid subsets when preloading hmt associations
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/associations/eager_test.rb
2013-02-14 15:33:30 -02:00
Rafael Mendonça França
ee3e3a90f3 Merge pull request #9289 from rails/3-2-stable-test-with-ruby-2
Add Ruby 2.0 RC to Travis CI build matrix
2013-02-14 09:19:29 -08:00
Prem Sichanugrist
6996a0419c Add Ruby 2.0 RC to Travis CI build matrix 2013-02-14 12:18:33 -05:00
Carlos Antonio da Silva
4bb579a5f0 Fix typo in railties changelog [ci skip]
Other changelogs were fixed in f15581b1ba.
2013-02-14 13:46:10 -02:00
Rafael Mendonça França
b63eb672ec Merge pull request #9288 from jmccartie/jm/typos
Fixed changelog typos [ci skip]
2013-02-14 07:38:56 -08:00
Jon McCartie
f15581b1ba Fixed changelog typos [ci skip] 2013-02-14 09:36:33 -06:00
Carlos Antonio da Silva
d1904aff6f Merge pull request #9278 from matthewrobertson/backport-hmt-counter-cache-bug
Backport of #8400 to fix for issue #7630, a bug in has_many :through counter caches.
2013-02-13 17:32:10 -08:00
Matthew Robertson
18ffe50581 backport of fix for issue #7630 2013-02-13 16:01:58 -08:00
Carlos Antonio da Silva
c0022f8d88 Add note about attr_protected fix in Active Model changelog [ci skip] 2013-02-11 23:41:18 -02:00
Carlos Antonio da Silva
e0da95bd7e Update changelogs with version/release dates [ci skip] 2013-02-11 23:33:01 -02:00
Aaron Patterson
f1efecfc3f Merge branch '3-2-sec' into 3-2-stable
* 3-2-sec:
  bumping version
  remove ruby-prof
  Fix issue with attr_protected where malformed input could circumvent protection
  fixing call to columns hash. run the damn tests when you backport!
  Bump rack dependency to 1.4.5
  Merge pull request #9224 from dylanahsmith/bigdecimal-takes-string
  Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric

Conflicts:
	Gemfile
	activerecord/CHANGELOG.md
2013-02-11 10:19:31 -08:00
Aaron Patterson
1dccd44a5c bumping version 2013-02-10 19:05:41 -08:00
Aaron Patterson
9b9be48994 remove ruby-prof 2013-02-10 19:02:55 -08:00
Guillermo Iguaran
62f01bec76 Merge pull request #9239 from senny/use_ruby_version_on_3_2
ignore .ruby-version instead of tool specifc config on 3-2-stable
2013-02-10 09:07:46 -08:00
Yves Senn
baeafb4914 use .ruby-version instead of tool specifc config 2013-02-10 18:03:13 +01:00
Aaron Patterson
c35d913524 adding test for CVE 2013-02-09 17:00:59 -08:00
joernchen of Phenoelit
060bb7250b Fix issue with attr_protected where malformed input could circumvent
protection

Fixes: CVE-2013-0276
2013-02-09 17:00:25 -08:00
Aaron Patterson
2f0ff7554d fixing call to columns hash. run the damn tests when you backport! 2013-02-09 16:59:06 -08:00
Santiago Pastorino
638e247960 Bump rack dependency to 1.4.5
Conflicts:
	actionpack/actionpack.gemspec
2013-02-09 16:58:59 -08:00
Guillermo Iguaran
b00fe01d6e Merge pull request #9224 from dylanahsmith/bigdecimal-takes-string
[3.2] Fix test failure for ruby 1.8.
2013-02-09 16:58:55 -08:00
Guillermo Iguaran
921a296a33 Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric
[3.2] active_record: Quote numeric values compared to string columns.
Conflicts:
	activerecord/CHANGELOG.md
2013-02-09 16:58:50 -08:00
Aaron Patterson
d29235d2a4 fixing call to columns hash. run the damn tests when you backport! 2013-02-09 16:54:48 -08:00
Santiago Pastorino
697f31cbe7 Bump rack dependency to 1.4.5 2013-02-08 17:54:25 -02:00
Guillermo Iguaran
54af52de3f Merge pull request #9224 from dylanahsmith/bigdecimal-takes-string
[3.2] Fix test failure for ruby 1.8.
2013-02-08 07:11:37 -08:00
Dylan Smith
cbdfaf2e29 Fix test failure for ruby 1.8.
BigDecimal.new needs to take a string rather than an integer in ruby 1.8.
2013-02-08 09:44:15 -05:00
Guillermo Iguaran
00e0b258ee Merge pull request #9208 from dylanahsmith/3-2-mysql-quote-numeric
[3.2] active_record: Quote numeric values compared to string columns.
2013-02-07 18:45:25 -08:00
Dylan Smith
04c2d2e2e4 active_record: Quote numeric values compared to string columns. 2013-02-07 05:02:38 -05:00
Carlos Antonio da Silva
b4f189a162 Merge pull request #9159 from lexmag/col_defaults-dup-fix
Backport: Duplicate column_defaults properly
2013-02-03 04:30:14 -08:00
Yasuo Honda
e8357935ac This pull requests addresses ORA-01400 errors and also supports #6115 issue tested.
Issue #6115 has been fixed and tested with
the attribute `:null => false, :default => ""`
However `:null => false` attribute is not necessary to test this issue,
which causes many ORA-01400 errors with Oracle enhanced adapter.
2013-02-03 15:27:49 +04:00
Piotr Sarnacki
6a0a5f3032 Duplicate column_defaults properly
Backport c517602 to fix #6115

Deleted:
    activerecord/lib/active_record/core.rb

Conflicts:
    activerecord/test/cases/base_test.rb
2013-02-03 15:27:42 +04:00
Rafael Mendonça França
bf794bb36f Merge pull request #9078 from senny/6865_ar_count_with_uniq
`#count` in conjunction with `#uniq` performs distinct count.
Conflicts:
	activerecord/CHANGELOG.md
2013-02-02 10:19:23 -02:00
Steve Klabnik
8f8ae5f03c Fix markdown syntax in actionpack CHANGELOG.
Starting a line with an octothorpe makes an <h1>
2013-02-01 11:34:29 -08:00
Carlos Antonio da Silva
1337e9284c Merge pull request #9043 from senny/backport_7536
Backport: Fix pluck when columns/tables are reserved words.
2013-01-29 15:37:16 -08:00
Rafael Mendonça França
1683afb0ae Merge pull request #9114 from rosenfeld/patch-2
Add another NumberHelper missing dependency
2013-01-29 11:15:09 -08:00
Rodrigo Rosenfeld Rosas
d82b5db059 Add another NumberHelper missing dependency
Another missing dependency, now affecting #number_to_percentage.

It depends on reverse_merge.
2013-01-29 17:13:39 -02:00
Rafael Mendonça França
8593e0f562 Merge pull request #9113 from rosenfeld/patch-1
Add NumberHelper missing dependency
2013-01-29 10:37:38 -08:00
Rodrigo Rosenfeld Rosas
56fd56406c Add NumberHelper missing dependency
symbolize_keys depends on hash/keys AS core extension
2013-01-29 16:34:48 -02:00
José Valim
c7d6cfb1f6 Install latest bundler on Travis.
Attempt to fix travis error on 1.8.7/1.9.2:

    $ bundle install --path vendor/bundle
    ERROR: Gem bundler is not installed, run `gem install bundler` first.

    The command "bundle install --path vendor/bundle" failed and exited
    with 127 during install.
2013-01-26 20:22:12 -02:00
Rafael Mendonça França
ae28f063e3 Fix the CHANGELOG entry order [ci skip] 2013-01-25 10:04:58 -02:00
Carlos Antonio da Silva
8422864394 Merge pull request #9074 from gaynetdinov/replace_undefined_abcs_to_config_variable
Undefined abcs variable inside structure:dump task.
2013-01-25 03:42:36 -08:00
Damir Gaynetdinov
0b9c472905 Replaced abcs to config. 2013-01-25 13:00:09 +04:00
Ian Lesperance
b6d4931292 Fix pluck when columns/tables are reserved words.
Backport #7536 to fix #8968.

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
2013-01-23 15:17:33 +01:00
Carlos Antonio da Silva
2a5d119b44 Add changelog entry for skipping explain from dbs that don't support it
Backport of #6197 in 29d564add9.
2013-01-22 19:58:52 -02:00
Xavier Noria
29d564add9 Merge pull request #6197 from blakesmith/connection_adapters_without_explain_support
Don't run explain on slow queries for database adapters that don't support it
2013-01-22 19:54:01 -02:00
Andrew White
97a4db91d6 Revert "Merge pull request #6986 from kennyj/fix_6975"
This reverts commit 8905c1fb49.

Closes #8460

Conflicts:
	activerecord/test/cases/dirty_test.rb
2013-01-22 14:24:42 +00:00
Andrew White
7ee76714ab Add failing test case for #8460
Add a test case to ensure that fractional second updates are detected.
2013-01-22 14:20:25 +00:00
Andrew White
431759614d Duplicate possible frozen string from route
Ruby 1.9 freezes Hash string keys by default so where a route is
defined like this:

get 'search' => 'search'

then the Mapper will derive the action from the key. This blows up
later when the action is added to the parameters hash and the
encoding is forced.

Closes #3429
2013-01-21 17:20:51 +00:00
Carlos Antonio da Silva
a3aca81b21 Remove warning of not used variable 2013-01-17 10:28:16 -02:00
Carlos Antonio da Silva
626d0b157f Do not run this streaming test in Ruby 1.8, fix syntax error 2013-01-17 10:27:38 -02:00
José Valim
a5013bb5af Merge pull request #5288 from lest/patch-2
force response body to be read in assert_template
Conflicts:
	actionpack/lib/action_controller/test_case.rb
2013-01-17 09:25:12 -02:00
Andrew White
d3dcb4b9b2 Merge pull request #8632 from asanghi/3-2-stable
Fixes #8631 request post? detection should remain unaffected by local inflections such as POS for Point Of Sale
2013-01-16 03:04:14 -08:00
Aditya Sanghi
5f3b40e824 fixes #8631 local inflections from interfereing with HTTP_METHOD_LOOKUP dispatch logic 2013-01-16 15:59:17 +05:30
Rafael Mendonça França
fd990f24df Merge pull request #8933 from freerange/3-2-stable-with-minitest-fix
Make tests for the presence of MiniTest consistent
2013-01-15 17:45:36 -08:00
Rafael Mendonça França
9669aa7cf1 Merge pull request #8914 from nilbus/fix-header-bloat
Remove header bloat introduced by BestStandardsSupport middleware
Conflicts:
	actionpack/CHANGELOG.md
2013-01-15 23:29:45 -02:00
Carlos Antonio da Silva
63970dc7db Merge branch 'revert-binds-3-2' into 3-2-stable
This has been resulting in some hard to track bugs and is introducing
a possible breackage in a stable version. The issue it currently "fixes"
should be handled in some other way.

Closes #8743. Related to #7983.
2013-01-15 13:07:03 -02:00
Carlos Antonio da Silva
cfa4c64040 Revert "Work around undiagnosed bug that's draining a relation's bind_values"
This reverts commit 06cc38a2b0.
2013-01-15 13:02:46 -02:00
Carlos Antonio da Silva
da5e5c5f77 Revert "Merge pull request #7983 from georgebrock/bug7950-squashed"
This reverts commit 88a296dccc, reversing
changes made to 666a7e34f5.

Conflicts:
	activerecord/CHANGELOG.md

Reason: this has been resulting in some hard to track bugs and is
introducing a possible breackage in a stable version.
2013-01-15 13:01:13 -02:00
Rafael Mendonça França
823604ec16 Fix the TestCase class and make tests pass on ruby 2.0 2013-01-14 14:02:44 -02:00
Rafael Mendonça França
fa0d434e1b Add regression test to #8907 2013-01-14 12:03:48 -02:00
James Mead
48f9999fc3 Make tests for the presence of MiniTest consistent.
There is an inconsistency between the conditional logic in
the definition of ActiveSupport::TestCase and the conditional logic in
ActiveSupport::Testing::SetupAndTeardown [1].

In some circumstances, it's possible for MiniTest to be defined, but
for ActiveSupport::TestCase *not* to have MiniTest::Unit::TestCase or
MiniTest::Assertions in its ancestor chain. e.g. in Ruby 1.8 with the
minitest gem included in the bundle. In this case, the
Test::Unit/MiniTest shim/wrapper is not present and so
Test::Unit::TestCase (and therefore ActiveSupport::TestCase) is
completely independent of MiniTest::Unit::TestCase.

The conditional logic in the definition of ActiveSupport::TestCase does
not take this scenario into account, whereas the logic in
ActiveSupport::Testing::SetupAndTeardown does take it into account.

The changes in this commit are an alternative to the change in [2] which
was reverted in [3].

Similar conditional logic exists in ActiveSupport::Testing::Isolation
[4], ActiveSupport::Testing::Pending [5],
ActiveSupport::Testing::Performance [6], and in their respective tests.
I have not addressed these, because I know less about what's going on
there, but it would be worth bringing them all into line too.

[1]
https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/testing/setup_and_teardown.rb#L13
[2]
c3e186ec8d
[3]
267fb61277
[4]
https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/testing/isolation.rb#L41
[5]
https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/testing/pending.rb#L14
[6]
https://github.com/rails/rails/blob/3-2-stable/activesupport/lib/active_support/testing/performance.rb#L17
2013-01-14 13:59:24 +00:00
Rafael Mendonça França
79a98d82da Merge pull request #8927 from dkubb/issue-8178
Fix DateTime comparison with DateTime::Infinity object
2013-01-14 03:32:34 -08:00
gsphanikumar
b1a501e6fb Test to allow Range including DateTime and DateTime::Infinity
Closes #8587
2013-01-13 20:27:42 -08:00
Dan Kubb
688d52933a Fix DateTime comparison with DateTime::Infinity object 2013-01-13 20:27:33 -08:00
Rafael Mendonça França
7c62a752db Merge pull request #8907 from rubys/master
Fix regression introduced in pull 8812
2013-01-12 00:14:01 -02:00
Andrew White
0db9b13b70 Remove unnecessary caching of ParameterFilter 2013-01-12 01:55:14 +00:00
Rafael Mendonça França
2c5e0adefe Merge pull request #8895 from ernie/revert-hmt-on-unsaved-in-3-2
Revert hm:t on unsaved collection for 3.2
2013-01-11 07:34:53 -08:00
Ernie Miller
18b9187b56 Revert "Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt"
This reverts commit ee43989575.

It would appear that #7661 had unintended consequences to the API. Until
we can sort those out, this should not be in 3.2.x, and wait for 4.0.0.
2013-01-11 10:32:36 -05:00
Jeremy Kemper
3211eb17b9 Merge pull request #8888 from dylanahsmith/3-2-parse-non-object-json-params
3-2-stable: Fix JSON params parsing regression for non-object JSON content.
2013-01-10 22:53:44 -08:00
Dylan Smith
7003b36ecf Fix JSON params parsing regression for non-object JSON content.
Backports #8855.
2013-01-11 00:14:49 -05:00
Carlos Antonio da Silva
d564ee06a8 Reorder AP changelog and remove duplicated entry [ci skip]
Duplicated entry added in 002dfba664.
2013-01-10 19:04:57 -02:00
Guillermo Iguaran
686307cd90 Merge pull request #8756 from causes/js_include_tag_fix
Fix javascript_include_tag when no js runtime is available
2013-01-10 12:43:57 -08:00
Guillermo Iguaran
002dfba664 Merge pull request #8735 from jejacks0n/duplicate_asset_fix
Ensure assets aren't duplicated when using sprockets require.
2013-01-10 12:43:31 -08:00
jejacks0n
f55ef82321 Fixes issue where duplicate assets can be required with sprockets.
- addresses the problem by calling flatten on asset array before calling uniq.
- adds note to CHANGELOG.
2013-01-10 13:41:52 -07:00
Carlos Antonio da Silva
11f5debcd5 Update changelogs with release date [ci skip] 2013-01-09 20:06:06 -02:00
Rafael Mendonça França
8313f3c577 Merge pull request #8838 from yahonda/8806_3-2-stable
Ignore binds payload with nil column in AR log subscriber
2013-01-09 09:35:15 -02:00
Carlos Antonio da Silva
45b17cee59 Merge pull request #8834 from sikachu/3-2-stable-fix-ars
Remove test for XML YAML parsing
2013-01-08 16:48:31 -08:00
Prem Sichanugrist
e134e171c2 Remove test for XML YAML parsing
The support for YAML parsing in XML has been removed from Active Support
since it introduced an security risk. See 43109ec for more detail.
2013-01-08 19:39:25 -05:00
Yasuo Honda
3d1a879f4c Ignore binds payload with nil column in AR log subscriber
Some tests were raising the following error:

    Could not log "sql.active_record" event. NoMethodError: undefined method
    `type' for nil:NilClass`

Due to the way binds were being logged, the column info was considered
always present, but that is not true for some of the tests listed in the
issue.

Closes #8806.

Conflicts:

	activerecord/lib/active_record/log_subscriber.rb
	activerecord/test/cases/log_subscriber_test.rb

Conflict resolution:
- Revert ruby 1.9 style hash to support ruby 1.8
- Do not include 8f59ffce into 3-2-stable
2013-01-09 06:18:14 +09:00
Aaron Patterson
48810a52df Merge branch '3-2-sec' into 3-2-secmerge
* 3-2-sec:
  bumping version
  CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml.
  * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] * dealing with empty hashes. Thanks Damien Mathieu
  Avoid Rack security warning no secret provided

Conflicts:
	actionpack/CHANGELOG.md
	activerecord/CHANGELOG.md
	activesupport/CHANGELOG.md
2013-01-08 11:37:48 -08:00
Aaron Patterson
746dbd89fa bumping version 2013-01-08 11:10:00 -08:00
Jeremy Kemper
43109ecb98 CVE-2013-0156: Safe XML params parsing. Doesn't allow symbols or yaml. 2013-01-08 11:09:50 -08:00
Aaron Patterson
d5cd97baa4 * Strip nils from collections on JSON and XML posts. [CVE-2013-0155] * dealing with empty hashes. Thanks Damien Mathieu 2013-01-08 09:08:26 -08:00
Santiago Pastorino
95fe9ef945 Avoid Rack security warning no secret provided
This avoids "SECURITY WARNING: No secret option provided to Rack::Session::Cookie."
2013-01-08 09:08:05 -08:00
Carlos Antonio da Silva
f64be7d0d8 Changelog improvements [ci skip] 2013-01-08 10:59:12 -02:00
Carlos Antonio da Silva
3debd57a95 Bump rack dependency to 1.4.3
It includes security bug fixes and changes the initialization of
Rack::File to accept a hash, otherwise generating warnings.

See 295806e for the warnings fix.

Conflicts:
	actionpack/actionpack.gemspec
2013-01-08 10:55:16 -02:00
Carlos Antonio da Silva
54faddf2a8 Merge pull request #8812 from rubys/master
Eliminate Rack::File headers deprecation warning
2013-01-08 10:51:47 -02:00
Vasiliy Ermolovich
d39d878d2b Wrap time ranges with timezones, closes #8807
(cherry picked from commit e2e513621d732abb8efff9120bd9a444836720d6)
(cherry picked from commit dcdde7da481e11660634278a8004175a1ce20f39)

Backport of #6183, original issue was #6179

Conflicts:
	activesupport/lib/active_support/core_ext/time/calculations.rb
	activesupport/test/core_ext/time_ext_test

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2013-01-08 10:33:45 +00:00
Santiago Pastorino
d9a048001f Avoid Rack security warning no secret provided
This avoids "SECURITY WARNING: No secret option provided to Rack::Session::Cookie."
2013-01-08 00:42:45 -02:00
Carlos Antonio da Silva
c75b5a88a8 Refactor write attribute logic to convert number column value
This is an improvement for issue #8673:
    "Comparing a BigDecimal to true/false on write_attribute is slow"

It seems to be an issue with Ruby itself, related to the "coerce" method
being called in TrueClass/FalseClass due to the == condition, triggering
method_missing, then raising a NameError that's later catched.

This issue was also opened in Ruby tracker:
    https://bugs.ruby-lang.org/issues/7645.

This refactoring avoid the coerce call by using a case statement, which
gives us better readability as well. A simple benchmark:

----------

require 'benchmark/ips'
require 'bigdecimal'

Benchmark.ips do |x|
  x.report("== true")   { BigDecimal('3') == true }
  x.report("TrueClass") { TrueClass === BigDecimal('3') }
  x.report("== 0")      { BigDecimal('3') == 0 }
  x.report("Numeric")   { Numeric === BigDecimal('3') }
end

Calculating -------------------------------------
             == true      6427 i/100ms
           TrueClass     47297 i/100ms
                == 0     35923 i/100ms
             Numeric     55530 i/100ms
-------------------------------------------------
             == true    75878.5 (±21.6%) i/s -     359912 in   5.004392s
           TrueClass  1249547.0 (±13.1%) i/s -    6148610 in   5.035964s
                == 0   666856.3 (±13.3%) i/s -    3268993 in   5.013789s
             Numeric  1269300.9 (±11.3%) i/s -    6274890 in   5.028458s

----------

Master has a very different implementation, and there are apparently no
similar conversions at this point, it's mainly delegated to the column
type cast, but I'll check if something needs to be changed there as well.

Closes #8673.
2013-01-07 21:54:49 -02:00
Noah Silas
9bc5e6517c Fix javascript_include_tag when no js runtime is available
In a production environment where the assets have been precompiled, we
don't want an assets compile step to happen on the application server at
all. To ensure this, a js runtime may not be available on the app
servers. In this environment, pages using javascript_include_tag for
assets with non-standard or chained extensions were throwing 500 errors.
For instance, `javascript_include_tag('jquery.min')` would blow up.

Sprockets was attempting to build the assets being included during the
rewrite_extension step (responsible for appending a '.js' extension to
assets being included by the basename rather than a fully qualified
name). This was happening as a step to resolve #6310, which required
checking for the presence of an asset with a non-standard extension
before appending the extension.

We can check for the presence of an asset without invoking the asset
build step by using Sprockets' resolve method, which will search for the
base file without building it (and is the method that find_asset uses
internally to get the path to the asset before attempting to build it).

When rewriting the extension on an asset, these are the steps:
- If the source does not have an extension, assume that the default
  extension is desired and append it.
- If there is an extension and it doesn't match the default extension,
  check to see if a file with the precise name specified exists amongst
  the assets; if it is present, do not append the default extension.
  (This is the step that resolves #6310).
2013-01-07 15:49:51 -08:00
Carlos Antonio da Silva
3aebe13b1b Remove not used variable in eager test 2013-01-07 21:37:02 -02:00
Carlos Antonio da Silva
040ff5b472 Fix named scope + class method example
Closes #8804 [ci skip]

Conflicts:
	activerecord/lib/active_record/scoping/named.rb
2013-01-07 21:27:41 -02:00
Rafael Mendonça França
831aad2ee9 connection_parameters is an Array and will never have
prepared_statements as value
2013-01-06 22:14:25 -03:00
Rafael Mendonça França
80343f6f90 Test only with Ruby 1.9+ 2013-01-06 20:30:10 -03:00
Rafael Mendonça França
79456619cf Remove warnings 2013-01-06 18:43:48 -03:00
Tristan Harward
c147dd7ddd Fix error when assigning NaN to an integer column
Also covers any non-castable case by returning nil, which
is in-line with the intention of the former implementation,
but covers the odd cases which respond to to_i but raise
an error when it's called, such as NaN, Infinity and -Infinity.

Fixes #8757

Backport of #8781

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/column_test.rb
2013-01-06 18:21:36 -03:00
Carlos Antonio da Silva
756188b512 Do not call fields_for from form_for, to avoid instantiating two builders
Conflicts:
	actionpack/lib/action_view/helpers/form_helper.rb
	actionpack/test/template/form_helper_test.rb
2013-01-06 11:06:26 -02:00
James Coglan
1506d4d9e4 Remove suggestion that Procs can be used as session secrets.
(cherry picked from commit 6500d7994e94af439587ba0b6088b14532940ad2)

[ci skip]

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2013-01-05 18:39:16 +00:00
Carlos Antonio da Silva
665e11e539 Merge pull request #8763 from hsbt/backport-to-hide-warning
Backport 4f0f1b5 into 3-2-stable.

When running the test with warnings enabled, it fails without this change.
2013-01-04 17:20:14 -08:00
SHIBATA Hiroshi
8a1ba017c6 backport #4f0f1b5 into 3-2-stable. because 1.9.3-p362 warned unused variables.
Conflicts:
	actionpack/test/controller/render_test.rb
2013-01-05 09:38:23 +09:00
Rafael Mendonça França
6b9cb71b2f Change the encrypted campfire notification token
Conflicts:
	.travis.yml
2013-01-03 22:09:32 -03:00
Rafael Mendonça França
9a44cd1f44 Merge pull request #8718 from jstirk/column_writer_to_i_errors
Fix undefined method `to_i' introduced since 3.2.8
2013-01-03 15:43:38 -08:00
Jason Stirk
e842dbbdf7 Fix undefined method `to_i' introduced since 3.2.8
This commit fixes a bug introduced in 96a13fc7 which breaks behaviour of
integer fields in 3.2.8.

In 3.2.8, setting the value of an integer field to a non-integer (eg.
Array, Hash, etc.) would default to 1 (true) :

    # 3.2.8
    p = Post.new
    p.category_id = [ 1, 2 ]
    p.category_id # => 1
    p.category_id = { 3 => 4 }
    p.category_id # => 1

In 3.2.9 and above, this will raise a NoMethodError :

    # 3.2.9
    p = Post.new
    p.category_id = [ 1, 2 ]

    NoMethodError: undefined method `to_i' for [1, 2]:Array

Whilst at first blush this appear to be sensible, it combines in bad
ways with scoping.

For example, it is common to use scopes to control access to data :

    @collection = Posts.where(:category_id => [ 1, 2 ])
    @new_post = @collection.new

In 3.2.8, this would work as expected, creating a new Post object
(albeit with @new_post.category_id = 1). However, in 3.2.9 this will
cause the NoMethodError to be raised as above.

It is difficult to avoid triggering this error without descoping before
calling .new, breaking any apps running on 3.2.8 that rely on this
behaviour.

This patch deviates from 3.2.8 in that it does not retain the somewhat
spurious behaviour of setting the attribute to 1. Instead, it explicitly
sets these invalid values to nil :

    p = Post.new
    p.category_id = [ 1, 2 ]
    p.category_id # => nil

This also fixes the situation where a scope using an array will
"pollute" any newly instantiated records.

    @new_post = @collection.new
    @new_post.category_id # => nil

Finally, 3.2.8 exhibited a behaviour where setting an object to an
integer field caused it to be coerced to "1". This has not been
retained, as it is spurious and surprising in the same way that setting
Arrays and Heshes was :

    c = Category.find(6)
    p = Post.new

    # 3.2.8
    p.category_id = c
    p.category_id # => 1

    # This patch
    p.category_id = c
    p.category_id # => nil

This commit includes explicit test cases that expose the original issue
with calling new on a scope that uses an Array. As this is a common
situation, an explicit test case is the best way to prevent regressions
in the future.

It also updates and separates existing tests to be explicit about the
situation that is being tested (eg. AR objects vs. other objects vs.
non-integers)
2013-01-04 10:36:45 +11:00
Rafael Mendonça França
229042fb73 Merge pull request #8733 from amatsuda/rails32_readme_dir_tree
update directory tree in the generated README in Rails 3.2

[ci skip]
2013-01-03 15:00:27 -08:00
Akira Matsuda
3a9db0219f update directory tree in the generated README
[ci skip]
2013-01-04 07:41:14 +09:00
Rafael Mendonça França
ef727a6541 Merge pull request #8716 from miguelff/3-2-stable
Merged latest released tag (v3.2.10) into the stable branch (3-2-stable)
2013-01-03 11:39:29 -08:00
Carlos Antonio da Silva
4179470f01 Merge pull request #8719 from pcasaretto/fix-actionview-doc-typo
Fix typo on form_tag_helper.rb [ci skip]
2013-01-03 11:24:34 -02:00
Miguel
2e4df2a289 Merge tag 'v3.2.10' into 3-2-stable
Latest released tag was not fully merged into the stable branch (missed version bumping)
2013-01-03 11:54:21 +01:00
Rafael Mendonça França
4d4e6e2f2b Use Ruby 1.8 syntax 2013-01-02 22:52:59 -03:00
Rafael Mendonça França
f8452e8de7 Merge pull request #8703 from senny/backport_8700
Backport #8701, do not append a second slash with `trailing_slash: true`

Closes #8700
2013-01-02 13:56:05 -08:00
Yves Senn
33841a9db3 Backport #8701, do not append a second slash with trailing_slash: true 2013-01-02 22:53:39 +01:00
Rafael Mendonça França
f4dc7e3676 Add release date of 3.2.10
Fix format and wrong changelog entry
2013-01-02 18:51:13 -03:00
Rafael Mendonça França
970c10cee5 Improve CHANGELOG message [ci skip] 2013-01-02 18:43:09 -03:00
Aaron Patterson
e5ee5a9d24 Merge branch '3-2-stable' into 3-2-secmerge
* 3-2-stable:
  fix block.arity raise nil error when not given a block to "content_tag_for"
  removes the Ajax on Rails early draft
  Revert "Merge pull request #8665 from senny/8661_should_not_append_charset_if_already_present"
  backport #8662, charset should not be appended for `head` responses
  Revert "Fix `validates_presence_of` with `:allow_nil` or `:allow_blank` options."
  Fix `validates_presence_of` with `:allow_nil` or `:allow_blank` options.
  backport #8616, quote column names in generated fixture files
2013-01-02 13:23:20 -08:00
Rafael Mendonça França
204109eac9 Merge pull request #8640 from jasl/3-2-stable
fix block.arity will raise nil error
2013-01-02 04:05:05 -08:00
jasl
ea881ca85a fix block.arity raise nil error when not given a block to "content_tag_for" 2013-01-02 16:48:09 +08:00
Xavier Noria
b366ec51ef removes the Ajax on Rails early draft
There was a few attempts at writing this guide, but we
never passed from the work in progress stage. In spite
of not being included in the table of contents, this
draft was still indexed by bots and showed up in searches.

Steve Klabnik has written "Working with JavaScript in Rails"
which is going to be released with Rails 4. So better get
rid of this altogether.
2012-12-31 21:35:13 +01:00
Santiago Pastorino
348870d5c5 Revert "Merge pull request #8665 from senny/8661_should_not_append_charset_if_already_present"
This reverts commit e48dc19423, reversing
changes made to d38c8caa48.
2012-12-31 15:08:00 -02:00
Santiago Pastorino
e48dc19423 Merge pull request #8665 from senny/8661_should_not_append_charset_if_already_present
backport #8662, charset should not be appended for `head` responses
2012-12-31 08:08:16 -08:00
Yves Senn
55a886b6e9 backport #8662, charset should not be appended for head responses
1) Failure:
    test_head_created_with_image_png_content_type(RenderTest) [test/controller/render_test.rb:1238]:
    Expected: "image/png"
      Actual: "image/png; charset=utf-8"
2012-12-31 17:04:51 +01:00
Rafael Mendonça França
d38c8caa48 Revert "Fix validates_presence_of with :allow_nil or :allow_blank options."
This reverts commit 93366c7c91.

REASON: This is backward incompatible. Also this behavior is documented
on the guides.
2012-12-26 20:20:02 -03:00
Rafael Mendonça França
93366c7c91 Fix validates_presence_of with :allow_nil or :allow_blank options.
Fix #8621

[Colin Kelley + Rafael Mendonça França]
2012-12-26 19:05:03 -03:00
Rafael Mendonça França
8c938dddd2 Merge pull request #8618 from senny/backport_8612
backport #8616, quote column names in generated fixture files
2012-12-26 07:41:51 -08:00
Yves Senn
5203b6dd50 backport #8616, quote column names in generated fixture files
Conflicts:

	railties/CHANGELOG.md
	railties/lib/rails/generators/test_unit/model/model_generator.rb
	railties/lib/rails/generators/test_unit/model/templates/fixtures.yml
	railties/test/generators/model_generator_test.rb
2012-12-26 16:38:16 +01:00
Aaron Patterson
8ba3df046f bumping version to 3.2.10 2012-12-23 13:36:49 -08:00
Aaron Patterson
2aa70bd61a Merge branch '3-2-sec' into 3-2-secmerge
* 3-2-sec:
  CVE-2012-5664 options hashes should only be extracted if there are extra parameters
  updating changelog
  updating the changelogs
  updating the changelog for the CVE
  Add release date of Rails 3.2.9 to documentation

Conflicts:
	actionmailer/CHANGELOG.md
	actionpack/CHANGELOG.md
	activemodel/CHANGELOG.md
	activerecord/CHANGELOG.md
	activeresource/CHANGELOG.md
	activesupport/CHANGELOG.md
	railties/CHANGELOG.md
2012-12-23 11:52:05 -08:00
Aaron Patterson
325669f079 CVE-2012-5664 options hashes should only be extracted if there are extra parameters 2012-12-23 11:07:07 -08:00
Aaron Patterson
7d592ba397 updating changelog 2012-12-23 11:04:02 -08:00
Aaron Patterson
6727ac6a6b updating the changelogs 2012-12-23 10:59:39 -08:00
Aaron Patterson
784a386984 updating the changelog for the CVE 2012-12-23 10:59:28 -08:00
claudiob
acc2aa4c60 Add release date of Rails 3.2.9 to documentation
Conflicts:
	actionpack/CHANGELOG.md
	activerecord/CHANGELOG.md
	activesupport/CHANGELOG.md
2012-12-23 10:59:19 -08:00
Rafael Mendonça França
885f59f685 Serialized attribute can be serialized in an integer column
Fix #8575

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/attribute_methods/serialization.rb
	activerecord/test/cases/serialized_attribute_test.rb
	activerecord/test/models/person.rb
2012-12-21 16:04:56 -03:00
Carlos Antonio da Silva
bf166996f2 Merge pull request #8558 from senny/backport_3489
Backport #8522, Keep index names when using  with sqlite3
2012-12-19 03:33:51 -08:00
Yves Senn
9f69d42860 Backport #8522, Keep index names when using with sqlite3
Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
	activerecord/test/cases/migration/rename_column_test.rb
2012-12-19 12:24:35 +01:00
kennyj
38af3540ae backport runner fixes to 3-2-stable
Add a runner hook to Rails::Application and Rails::Engine that requires
ActiveRecord::Base to avoid circular constant loading when using observers.

This commit backports cc7dd66, c0ba0f0 and 8d01c61.
2012-12-16 00:06:43 -06:00
Carlos Antonio da Silva
df048b574b Use 1.8 style hash in json encoding test 2012-12-14 23:33:53 -02:00
Brett Carter
815a9431ab Remove unicode character encoding from ActiveSupport::JSON.encode
The encoding scheme (e.g. ☠ -> "\u2620") was broken for characters
not in the Basic Multilingual Plane.  It is possible to escape them
for json using the weird encoding scheme of a twelve-character
sequence representing the UTF-16 surrogate pair (e.g. '𠜎' ->
"\u270e\u263a") but this wasn't properly handled in the escaping code.
Since raw UTF-8 is allowed in json, it was decided to simply pass
through the raw bytes rather than attempt to escape them.

Backport of 9ace3a8820

Conflicts:

	activesupport/CHANGELOG.md
	activesupport/lib/active_support/json/encoding.rb
	activesupport/test/json/encoding_test.rb
2012-12-14 20:09:56 -05:00
Andrew White
9c581d3811 Don't use 1.9 hash syntax on 3-2-stable 2012-12-14 14:52:24 +00:00
Andrew White
6ab1a9540b Clear url helper methods when routes are reloaded
Clear url helper methods when routes are reloaded by removing the
methods explicitly rather than just clearing the module because it
didn't work properly and could be the source of a memory leak.

Closes #8488.
2012-12-14 13:50:14 +00:00
Carlos Antonio da Silva
3bf4ddfefb Merge pull request #8504 from senny/backport_8492
Backport of #8500, recognize migrations, in folders containing numbers and 'rb'.
2012-12-13 02:43:50 -08:00
Yves Senn
d68e299167 recognize migrations, in folders containing numbers and 'rb'.
Backport of #8500
Closes #8492

Conflicts:

	activerecord/test/cases/migrator_test.rb
2012-12-13 11:40:02 +01:00
Rafael Mendonça França
6fbee4fc53 Merge pull request #8490 from mattv/fix_request_raw_post
Fix rewinding in ActionDispatch::Request#raw_post
Conflicts:
	actionpack/CHANGELOG.md
2012-12-11 21:01:49 -03:00
Carlos Antonio da Silva
73f0d537c9 Improve test name related to cache timestamp format [ci skip] 2012-12-11 21:52:22 -02:00
Carlos Antonio da Silva
64281fb6e7 Add :nsec format only for Ruby 1.9
Ruby 1.8 does not support this format in Time, so the format will only
be added to the available date formats on Ruby 1.9. Changelog entry was
changed to explain that as well.
2012-12-11 21:38:49 -02:00
Carlos Antonio da Silva
87a7e8752d Run backported serialized test without Identity Map
It fails with Identity Map because the find call returns the same
object, so the "content" attribute that we expect to raise "missing
attribute" is actually present.
2012-12-11 13:10:10 -02:00
Carlos Antonio da Silva
454f112705 Use 1.8 hash style 💣 2012-12-11 09:13:56 -02:00
Carlos Antonio da Silva
59240363e3 Merge pull request #8441 from itzki/fix_decorate_columns
Backport test to ensure there won't be regressions.
The issue only happens on master at the moment.
2012-12-11 08:31:19 -02:00
Rafael Mendonça França
0ef70b80d7 Add CHANGELOG entry for #6376. 2012-12-10 17:43:31 -03:00
Rafael Mendonça França
b097652ef6 Allow users to choose the timestamp format in the cache key
This can be done using the class attribute cache_timestamp_format

Closes #8195
2012-12-10 17:43:26 -03:00
Rafael Mendonça França
660882bda4 Make sure the tests pass in the case closer to described in #8195 2012-12-10 17:05:00 -03:00
Jeremy Kemper
09a8b146ef Merge pull request #6376 from jgaskins/timestamp-microseconds
Increase numeric-timestamp precision to nanoseconds
Conflicts:
	activesupport/lib/active_support/core_ext/time/conversions.rb
2012-12-10 15:33:01 -03:00
jacobstr
cc99580264 Added regression test for #8195. 2012-12-10 15:33:01 -03:00
Rafael Mendonça França
c720ff75d8 Remove warning of unused variable 2012-12-10 15:29:38 -03:00
Rafael Mendonça França
86e1f45c93 Merge pull request #8477 from senny/backport_8448
Backport #8450, the return value from mailer methods is not relevant.
2012-12-10 08:04:06 -08:00
Yves Senn
9b72c36783 Backport #8450, the return value from mailer methods is not relevant.
Conflicts:

	actionmailer/CHANGELOG.md
	actionmailer/lib/action_mailer/base.rb
2012-12-10 17:00:41 +01:00
Yves Senn
d1b9c5fd11 revised the actionmailer's CHANGELOG structure 2012-12-10 17:00:16 +01:00
Carlos Antonio da Silva
a3c3cfdd0e Unscope update_column(s) query to ignore default scope
When applying default_scope to a class with a where clause, using
update_column(s) could generate a query that would not properly update
the record due to the where clause from the default_scope being applied
to the update query.

    class User < ActiveRecord::Base
      default_scope where(active: true)
    end

    user = User.first
    user.active = false
    user.save!

    user.update_column(:active, true) # => false

In this situation we want to skip the default_scope clause and just
update the record based on the primary key. With this change:

    user.update_column(:active, true) # => true

Backport of #8436 fix.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/persistence.rb
	activerecord/test/cases/persistence_test.rb
2012-12-06 23:49:53 -02:00
Rafael Mendonça França
d70539c1ec Merge pull request #8417 from kennyj/fix_8414
Fix #8414. Performance problem with postgresql adapter primary_key function.
Conflicts:
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2012-12-04 22:23:56 -02:00
Andrew White
fbf23ed933 Make distance_of_time_in_words work with DateTime offsets
Because DateTime#to_time returns self when it has a non-zero offset
and subtracting two DateTime instances returns a Rational then the
distance_of_time_in_words methods outputs an incorrect value.

This is fixed in master because we can rely on Ruby 1.9.3's
implementation of to_time but it can't be fixed on Ruby 1.8.7 as
there is no way to map the DateTime to a Time with a non-zero offset.

We can workaround the problem by casting to Float before doing
the subtraction in the distance_of_time_in_words method.

Closes #8390
2012-12-04 14:21:52 +00:00
Andrew White
18e1227312 Make output of distance_of_time_in_words consistent
This commit fixes the output of distance_of_time_in_words when
using integer or duration arguments. Previously a distance of
more than 30 seconds would be output as 'Less than 1 minute'
when using integer arguments and '1 minute' when using two
Time instances more than 30 seconds apart.

Cherry picked from 5fdd4cd9e47be972f146a8a17a74c8f4700e2ac0
2012-12-04 14:21:52 +00:00
Rafael Mendonça França
549da0dd8f Merge pull request #8413 from senny/8403_backport
backport #8403, no intermediate AR objects when eager loading.
2012-12-04 04:49:07 -08:00
Yves Senn
1b96176587 backport #8403, no intermediate AR objects when eager loading.
Closes #3313

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/test/models/developer.rb
2012-12-04 13:35:49 +01:00
Jeremy Kemper
dac811e854 Bump mailer to quiet the stdout log messages
Conflicts:
	actionmailer/actionmailer.gemspec
2012-12-04 08:37:57 -02:00
José Valim
a878126028 Merge pull request #4942 from bogdan/pluck_joins
AR::Relation#pluck: improve to work with joins

Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
2012-12-03 23:17:16 -02:00
Carlos Antonio da Silva
1a5caf180e Use send in Time marshal extensions since the methods are now private
See 9c1b3161f2

All Active Support tests pass in 2.0.0preview2 after this change.
Closes #8409
2012-12-03 22:13:48 -02:00
Carlos Antonio da Silva
33ab32dce8 Skip ruby-prof in Gemfile for Ruby 2.0 2012-12-03 21:39:57 -02:00
Carlos Antonio da Silva
5f28000731 Use 1.8 hash style 2012-12-03 21:00:14 -02:00
Jeremy Kemper
9d6e502f81 Override <%== to always behave as literal text rather than toggling based on whether escaping is enabled. Fixes that existing plaintext email templates using <%== unexpectedly flipped to *escaping* HTML when #8235 was merged.
Conflicts:
	actionpack/test/template/template_test.rb
2012-12-03 10:32:23 -07:00
Carlos Antonio da Silva
19599c2744 Merge pull request #8405 from hsbt/fix-respond-initialize-dup
Handle respond_to? with private methods
2012-12-03 05:16:38 -08:00
SHIBATA Hiroshi
127411fdf3 handled respond_to? with private methods 2012-12-03 22:07:14 +09:00
Rafael Mendonça França
eaa0d0b774 Merge pull request #8402 from senny/8376_descriptive_error_message_for_partial_layout_true
More descriptive error when rendering a partial with `:layout => true`
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_view/renderer/partial_renderer.rb
2012-12-02 15:16:58 -02:00
Carlos Antonio da Silva
a50ab21cd1 Use 1.8 hash style in xml serialization test 2012-11-30 11:29:41 -02:00
Rafael Mendonça França
25a15a7986 Make the CHANGELOG consistent [ci skip] 2012-11-30 11:08:32 -02:00
Aaron Patterson
564e32b71d Merge pull request #6397 from kennyj/fix_translate_exception
Fix a problem of translate_exception method in a Japanese (non English) environment.
2012-11-30 11:05:03 -02:00
Xavier Noria
d7deec30f5 Merge pull request #8380 from route/fix-concern-description
Fixed description for ActiveSupport::Concern typical case
2012-11-30 00:02:34 -08:00
Dmitry Vorotilin
5b50c7d4d5 Fixed description for ActiveSupport::Concern typical case 2012-11-30 10:35:39 +04:00
Jeremy Kemper
db994b75e6 Backport 78b30fed9336336694fb2cb5d2825f95800b541c to fix non-utf-8 databases mistakenly getting utf8 collation 2012-11-29 09:26:05 -07:00
Rafael Mendonça França
e8c360527d Merge pull request #8352 from steveklabnik/update_7858
Specify type of singular assication during serialization
Conflicts:
	activemodel/CHANGELOG.md
	activemodel/test/cases/serializers/xml_serialization_test.rb
2012-11-29 13:41:38 -02:00
Aaron Patterson
66e87b714b Merge pull request #7689 from cbarton/assume_migration_version_with_prefix_fix
Fixing a schema:load when using a prefix and suffix on the tables [Reopen/backport]
2012-11-28 12:27:47 -08:00
Carlos Antonio da Silva
9d97ef8f21 Merge pull request #8327 from elia/fix-send-data-disposition-with-symbols
Accept symbols as #send_data :disposition value
2012-11-28 10:31:56 -02:00
Jeremy Kemper
06cc38a2b0 Work around undiagnosed bug that's draining a relation's bind_values 2012-11-28 10:27:29 -02:00
Carlos Antonio da Silva
26e8cb8809 Use 1.8 hash style in pg specific schema 2012-11-28 10:27:03 -02:00
Elia Schito
9c33cb26f4 Accept symbols as #send_data :disposition value 2012-11-27 00:25:55 +01:00
Aaron Patterson
941f0196c6 schema cache already has the columns as a hash, so use that
Commits

  978ec98c8e and
  51676652a3

changed database statements to use the schema_cache methods, added on
master in

  c99e34e90d763c52cbe8dc3d950ed1b4db665dc4 and
  dc973e78560a6514ab172f0ee86dc84a9147d39a

But apparently the methods weren't added to schema_cache, resulting in
the failure described in #8322 for 3-2-stable.

Fixes #8322.

Conflicts:
	activerecord/lib/active_record/connection_adapters/schema_cache.rb
2012-11-26 17:47:04 -02:00
Carlos Antonio da Silva
17d64a1c52 Merge pull request #8325 from steveklabnik/backport_7997
@steveklabnik can't spell 'distance.' [ci skip]
2012-11-26 10:59:23 -08:00
Steve Klabnik
767879c5d8 @steveklabnik can't spell 'distance.' 2012-11-26 10:56:24 -08:00
Rafael Mendonça França
924018ff5c Merge pull request #8321 from steveklabnik/backport_7997
Add i18n scope to disance_of_time_in_words.
2012-11-26 10:43:23 -08:00
Steve Klabnik
1a876f6228 Add i18n scope to disance_of_time_in_words.
This is a backport of rails/rails#7997.
2012-11-26 10:41:20 -08:00
Aaron Patterson
51676652a3 schema cache already has the columns as a hash, so use that 2012-11-25 23:13:26 -08:00
Aaron Patterson
978ec98c8e speed up fixture loading by querying the schema cache for column names 2012-11-25 23:12:29 -08:00
Carlos Antonio da Silva
6fe1a4a2da Merge pull request #8311 from alisdair/dirty-nullable-datetime
Don't call will_change! for datetime nil->"".

Setting a nil datetime attribute to a blank string should not cause the
attribute to be dirty.

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
2012-11-25 22:55:20 -02:00
Rafael Mendonça França
83e7105125 Merge pull request #8295 from senny/8265_backport
backport #8291, prevent mass assignment of polymorphic type with `build`
2012-11-22 06:47:44 -08:00
Yves Senn
d397a38c02 backport #8291, prevent mass assignment of polymorphic type with build
Closes #8265

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/associations/association.rb
2012-11-22 15:08:17 +01:00
Rafael Mendonça França
4e00e8e916 Merge pull request #8280 from asanghi/fix_guide_field_with_error_proc
fix guide with field_with_error proc example

[ci skip]
2012-11-20 21:54:06 -02:00
Rafael Mendonça França
50f00463bd Merge pull request #8276 from pwnall/pgsql_text_limits
Postgresql doesn't accepts limits on text columns
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2012-11-20 14:13:45 -02:00
Carlos Antonio da Silva
bd87bd9564 Be a bit less conservative with mysql in adapter
This will allow the new mysql 2.9.0 to be used, fixing our test issues.
2012-11-19 20:54:04 -02:00
Carlos Antonio da Silva
0077b414db Merge pull request #8258 from kommen/eager_loading_with_select_test2
Add test to ensure preloading works as expected with "group", "select" and "includes".
Conflicts:
	activerecord/test/cases/relations_test.rb

Chery-pick a739340d3c9e66814429af6f3f410c01ff86810a:
Ensure ordering to make the test pass with postgresql

Conflicts:
	activerecord/test/cases/relations_test.rb
2012-11-19 20:28:33 -02:00
Rafael Mendonça França
db6765220d Merge pull request #8271 from senny/backport_8262
backport #8262, require bundler groups to include rake-tasks in engines
2012-11-19 08:25:46 -08:00
Yves Senn
da6951af63 backport #8262, require bundler groups to include rake-tasks in engines
If you generate a full engine, this will include rake tasks from
your gem under the `app` namespace. For example if you have a dependency
on `rspec-rails` in your engine's `gemspec`. You will get the task `app:spec`

Closes #8229

Conflicts:

	railties/CHANGELOG.md
2012-11-19 15:23:49 +01:00
Mikel Lindsaar
b18fc59d28 Upgrade mail dependency to 2.5.2 2012-11-18 15:55:33 +11:00
Mikel Lindsaar
a497f84bb2 Upgrade mail dependency to 2.5.0 2012-11-18 10:43:48 +11:00
Carlos Antonio da Silva
603f538feb Remove the git option from ruby-prof gem pointing to wycats repo.
According to him, at one point his fork was the one that had the call
stack printer, and it's in the main repo now.

[ci skip]
2012-11-16 23:45:43 -02:00
Carlos Antonio da Silva
ff5d606368 Add changelog entry for #6003 backport 2012-11-16 21:50:13 -02:00
Andrew White
0c7a236f30 Refactor Generator class to not rely on in-place editing the controller 2012-11-16 21:44:24 -02:00
Nikita Beloglazov
09c4dfa06b Fix bug when url_for changes controller. 2012-11-16 21:44:18 -02:00
Carlos Antonio da Silva
88a296dccc Merge pull request #7983 from georgebrock/bug7950-squashed
Backport 4bc2ae0 to fix #7950

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
2012-11-16 21:15:34 -02:00
José Valim
666a7e34f5 Merge pull request #8235 from tilsammans/dont_escape_actionmailer_when_plaintext
Introduce `ActionView::Template::Handlers::ERB.escape_whitelist`

Conflicts:
	actionpack/CHANGELOG.md
	actionpack/test/template/template_test.rb
2012-11-16 09:59:15 -02:00
Rafael Mendonça França
f2a98a9243 Merge pull request #8227 from senny/backport_8139
backport #8139, `plugin new` adds dummy app tasks when necessary
2012-11-15 09:48:06 -08:00
Yves Senn
e69058c153 backport #8139, plugin new adds dummy app tasks when necessary. …
The `plugin new` generator always adds the dummy app rake tasks,
when a dummy app was created.

Closes #8224

Conflicts:

	railties/CHANGELOG.md
2012-11-15 18:45:37 +01:00
David Padilla
00fbee5bbf Fixes issue #6251
Plugin generator crashes when using the --dummy-path option

Code was assuming the application name in `config/application.rb`
was module Dummy.
2012-11-15 18:28:17 +01:00
Carlos Antonio da Silva
492c8de433 Merge pull request #8218 from DawidJanczak/form-tag-doc
[ci skip] Correct examples for form_tag helper.
2012-11-14 04:06:32 -08:00
DawidJanczak
89a8143d36 [ci skip] Correct examples for form_tag helper. 2012-11-14 11:56:15 +00:00
Jon Leighton
1edd358177 fix test
Conflicts:
	activerecord/test/cases/locking_test.rb
2012-11-13 20:22:35 -02:00
Rafael Mendonça França
7240202784 Merge pull request #8209 from senny/backport_8176
backport #8176, `#pluck` can be used on a relation with `select` clause.

Conflicts:
	activerecord/CHANGELOG.md
2012-11-13 19:58:26 -02:00
Rafael Mendonça França
e4e2bcce75 Merge pull request #8204 from nikitug/fix_dynamic_finder_result_check
Use nil? instead of blank? to check dynamic finder result

Conflicts:
	activerecord/CHANGELOG.md
2012-11-13 19:55:26 -02:00
Carlos Antonio da Silva
aac032073d Merge pull request #8188 from courtland/habtm-fix-stable
Fix deleting from a HABTM join table upon destroying an object of a mode...
2012-11-13 11:06:40 -08:00
Nick Rogers
05e1466e05 Fix deleting from a HABTM join table upon destroying an object of a model with optimistic locking enabled. Fixes #5332. 2012-11-13 10:36:24 -08:00
Nikita Afanasenko
b56376b450 Use nil? instead of blank? to check dynamic finder result
It's safe to use `nil?` instead of `blank?` because it's impossible to get an array on finder with bang;
`all_by` finder matches against regex without bang: `when /^find_(all_|last_)?by_([_a-zA-Z]\w*)$/`.

Fixes #7238
2012-11-13 21:24:58 +04:00
Rafael Mendonça França
5ed0381db5 Merge pull request #8205 from kennyj/fix_6951-32
Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL.
2012-11-13 08:20:38 -08:00
kennyj
fda9075530 Backport #8074 to 3-2-stable. Use query cache/uncache, when using not only database.yml but also DATABASE_URL. 2012-11-14 00:22:33 +09:00
Yves Senn
d3006f3503 backport #8176, #pluck can be used on a relation with select clause.
Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
2012-11-13 15:50:11 +01:00
Carlos Antonio da Silva
267fb61277 Revert "Use MiniTest in Ruby 1.8 if it is available."
This reverts commit c3e186ec8d.

Reason: too many incompatibilities make a lot of Rails tests fail in 1.9.
Might need more work to get this done properly in 3-2 if necessary.
2012-11-13 11:01:35 -02:00
Carlos Antonio da Silva
cd5b2e1e56 Fix warning with assigned but not used variable 2012-11-13 10:17:07 -02:00
Carlos Antonio da Silva
47971c85df Add changelog entry for #8200 [ci skip] 2012-11-13 09:29:41 -02:00
Carlos Antonio da Silva
17ccefc436 Update mocha version to 0.13.0 and change requires 2012-11-13 09:24:43 -02:00
Carlos Antonio da Silva
25b23d7ecc Fix json encoding test with ruby 1.8.7 and random hash order
Introduced in 3e53fe6.
2012-11-13 09:17:48 -02:00
Carlos Antonio da Silva
0ed585adeb Merge pull request #8200 from freerange/3-2-stable-with-mocha-fixes
Fix 3-2-stable to work with Mocha v0.13.0
2012-11-13 02:34:42 -08:00
Carlos Antonio da Silva
3e53fe635c Merge pull request #8199 from senny/backport_8182
backport #8185, `#as_json` isolates options when encoding a hash.
2012-11-13 02:26:01 -08:00
James Mead
3791cac874 Avoid a Mocha deprecation warning. 2012-11-13 08:25:14 +00:00
James Mead
5573c1d295 Fix for Test::Unit Mocha compatibility.
Mocha is now using a single AssertionCounter which needs a reference to
the testcase as opposed to the result.

This change is an unfortunate consequence of the copying of a chunk of
Mocha's internal code in order to monkey-patch Test::Unit.
2012-11-13 08:25:14 +00:00
James Mead
c3e186ec8d Use MiniTest in Ruby 1.8 if it is available.
ActiveSupport::TestCase was always inheriting from Test::Unit::TestCase.
This works fine in Ruby 1.9 where Test::Unit::TestCase is a thin wrapper
around MiniTest::Unit::TestCase, but does not work in Ruby 1.8 if the
MiniTest gem is used. What happens is that ActiveSupport inherits from
the Test::Unit::TestCase provided by the standard library, but then
since Minitest is defined, it then seems to proceed on the assumption
that ActiveSupport::TestCase has MiniTest::Unit::TestCase in its
ancestor chain. However, in this case it does not.

The fix is simply to choose which test library TestCase to inherit from
using the same logic used elsewhere to detect MiniTest.

I noticed this bug causing issues when using MiniTest and Mocha
in Ruby 1.8, but there may well be other issues.
2012-11-13 08:25:14 +00:00
James Mead
716bdfc01d Copy Mocha bug fix.
A bug was fixed [1] in Mocha's integration with Test::Unit, but this
monkey-patching code was copied before the fix. We need to copy the
fixed version.

The bug meant that an unexpected invocation against a mock within the
teardown method caused a test *error* and not a test *failure*.

[1]
f1ff6475ca (diff-5)
2012-11-13 08:25:14 +00:00
Yves Senn
be79632b96 backport #8185, #as_json isolates options when encoding a hash.
Setting options in a custom `#as_json` method had side effects.
Modifications of the `options` hash leaked outside and influenced
the conversion of other objects contained in the hash.

Conflicts:

	activesupport/CHANGELOG.md
2012-11-13 08:44:47 +01:00
Carlos Antonio da Silva
6189232800 Lock mocha in ~> 0.12.x until we fix the Ruby 1.8.7 issues with 0.13.0 2012-11-12 23:48:32 -02:00
Rafael Mendonça França
ac49e02eb6 Merge pull request #8193 from claudiob/add_rails329_release_date
Add release date of Rails 3.2.9 to documentation [ci skip]
2012-11-12 16:45:31 -08:00
claudiob
69455e7f6a Add release date of Rails 3.2.9 to documentation 2012-11-12 16:07:36 -08:00
Carlos Antonio da Silva
505bf59457 Merge pull request #8154 from bogdan/has_one_association_performance
Remove unwanted transaction when has one association is built

Conflicts:
	activerecord/CHANGELOG.md
2012-11-12 14:48:02 -02:00
Santiago Pastorino
0d27da5fbd Merge branch '3-2-9' into 3-2-stable 2012-11-12 13:29:31 -02:00
Santiago Pastorino
b33cf74a49 Bump to 3.2.9 2012-11-12 13:19:09 -02:00
George Brocklehurst
b6a2baee83 Test/changelog for has_many bug on unsaved records
See issue #7950.

The previous commit fixes this bug, and is a backport of
4bc2ae0da1dd812aee759f6d13ad428354cd0e13.
2012-11-10 13:32:55 +01:00
Aaron Patterson
a3cf03ef99 use bind values for join columns
This is a backport of 4bc2ae0da1dd812aee759f6d13ad428354cd0e13.
It fixes bug #7950.

Conflicts:

	activerecord/lib/active_record/relation/calculations.rb
	activerecord/lib/active_record/relation/finder_methods.rb
2012-11-10 13:32:11 +01:00
Santiago Pastorino
9a389cc70e Revert "Add test case to assets eager load"
This reverts commit 552a3e1453.
2012-11-09 16:27:40 -02:00
Santiago Pastorino
5f508471b8 Revert "Add test case to assets eager load"
This reverts commit 552a3e1453.
2012-11-09 16:27:18 -02:00
Santiago Pastorino
c50c8c1dc1 Merge branch '3-2-9' into 3-2-stable 2012-11-09 16:05:18 -02:00
Santiago Pastorino
db1d5f4071 Bump up to 3.2.9.rc3 2012-11-09 15:51:03 -02:00
Rafael Mendonça França
1baae1d185 Merge pull request #8161 from guilleiguaran/downgrade-sprockets
Lock sprockets to 2.2.x

REASON: We had some pending fixes in sprockets and sass-rails to make possible to use sprockets version > 2.2. We will do a more conservative sprockets upgrade for this release.

In a next release we can relax the dependency again.

See #8099 for more information.
2012-11-09 15:45:35 -02:00
Rafael Mendonça França
68e001f6e2 Merge pull request #8161 from guilleiguaran/downgrade-sprockets
Lock sprockets to 2.2.x

REASON: We had some pending fixes in sprockets and sass-rails to make possible to use sprockets version > 2.2. We will do a more conservative sprockets upgrade for this release.

In a next release we can relax the dependency again.

See #8099 for more information.
2012-11-09 09:39:06 -08:00
Carlos Antonio da Silva
a99d5424b0 Fix redirect example block
See #8160. [ci skip]
2012-11-09 15:35:20 -02:00
Guillermo Iguaran
d1d522861e Lock sprockets to 2.2.x 2012-11-09 12:20:34 -05:00
Santiago Pastorino
054578a45b Revert "Respect children paths filter settings"
This reverts commit 53778ec2d7.
Closes #8146
2012-11-09 13:16:50 -02:00
Santiago Pastorino
fc5ccd2c0b Revert "Respect children paths filter settings"
This reverts commit 53778ec2d7.
Closes #8146
2012-11-09 13:15:21 -02:00
Carlos Antonio da Silva
c7ef6b62c0 Merge pull request #8082 from nikitug/backport_serialized_attributes_before_type_cast
Backport #8078: Fix `attributes_before_type_cast` for serialised attributes
2012-11-09 03:01:34 -08:00
Nikita Afanasenko
8dbf5a4ddb Backport #8078: Fix attributes_before_type_cast for serialised attributes.
Public method attributes_before_type_cast used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like read_attribute_before_type_cast and returns unserialised values.
2012-11-09 11:53:55 +04:00
Carlos Antonio da Silva
90a5ec758d Merge pull request #8093 from nikitug/keep_app_x_ua_compatible
Fix #8086 (BestStandardsSupport rewrites app X-UA-Compatible header)

Conflicts:
	actionpack/CHANGELOG.md
2012-11-08 20:50:11 -02:00
Xavier Noria
3d25292ae3 Merge pull request #8027 from daenney/master
Atomic.rb assumes it may chown/chmod a file but doesn't handle the EPERM error.

Conflicts:
	activesupport/CHANGELOG.md
	guides/source/active_support_core_extensions.md
2012-11-08 20:50:05 -02:00
Rafael Mendonça França
5222a33d0d Merge pull request #8149 from senny/backport_7842_to_rails_3_2_stable
backport: handle trailing slash with engines
2012-11-08 12:34:15 -08:00
Yves Senn
d12e753409 backport, handle trailing slash with engines
this is a backport of #8115 to fix #7842
2012-11-08 21:26:26 +01:00
Santiago Pastorino
70f384e019 Merge pull request #7987 from alexisbernard/3-2_find_in_batches_compatible_with_strings
Fix find_in_batches with customized primary_key on 3-2-stable
2012-11-08 10:49:33 -08:00
Rafael Mendonça França
dbd0b12a07 Use a more descriptive test name 2012-11-08 15:07:58 -02:00
Alexis Bernard
16d98b2a41 Fix find_in_batches against string IDs when start option is not specified.
Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/relation/batches.rb
2012-11-08 17:52:54 +01:00
Rafael Mendonça França
cae0879cca Fix the release in the CHANGELOG [ci skip] 2012-11-08 14:35:56 -02:00
Rafael Mendonça França
2a6f208ee1 Merge pull request #8108 from Casecommons/fix-multiple-and-index-in-instance-tag
Support :multiple option on input tags that also have :index
Conflicts:
	actionpack/lib/action_view/helpers/tags/base.rb
	actionpack/lib/action_view/helpers/tags/collection_check_boxes.rb
2012-11-08 14:34:51 -02:00
Santiago Pastorino
7031e365d6 Fix test_find_in_batches_should_use_any_column_as_primary_key 2012-11-08 17:27:26 +01:00
Santiago Pastorino
9673735074 start could be a string
Related to 761bc751d31c22e2c2fdae2b4cdd435b68b6d783 and
eb876c4d07130f15be2cac7be968cc393f959c62

Conflicts:

	activerecord/lib/active_record/relation/batches.rb
	activerecord/test/cases/batches_test.rb
2012-11-08 17:26:47 +01:00
Rafael Mendonça França
b02556708c Merge pull request #8138 from sobrinho/3-2-stable
Fix accepts_nested_attributes for child classes
2012-11-08 08:17:43 -08:00
Gabriel Sobrinho & Ricardo Henrique
58e48d5292 Fix accepts_nested_attributes for child classes
Closes GH-8131
2012-11-07 16:19:43 -02:00
Santiago Pastorino
e41d78ce22 Clear url helpers when reloading routes 2012-11-02 19:11:58 -02:00
Rafael Mendonça França
190dddf231 Add test to avoid regression of 4a86362 2012-11-02 18:10:46 -02:00
Rafael Mendonça França
4a8636264d Revert "Merge pull request #7668 from Draiken/fix_issue_6497"
This reverts commit 61d5d2d8a9.

Conflicts:
	actionpack/CHANGELOG.md

REASON: This added a backward incompatible change.
2012-11-02 14:33:20 -02:00
Santiago Pastorino
de3dff3170 Bump to 3.2.9.rc2 2012-11-01 15:37:58 -02:00
Carlos Antonio da Silva
c368b660be Ensure calling first/last with options correctly set inverse association
Also related to #8087. Thanks @al2o3cr.
2012-11-01 14:27:57 -02:00
Carlos Antonio da Silva
d37d40b2d7 Fix issue with collection associations and first(n)/last(n)
When calling first(n) or last(n) in a collection, Active Record was
improperly trying to set the inverse of instance in case that option
existed. This change was introduced by
fdf4eae506.

In such cases we don't need to do that "manually", since the way
collection will be loaded will already handle that, so we just skip
setting the inverse association when any argument is given to
first(n)/last(n).

The test included ensures that these scenarios will have the inverse of
instance set properly.

Fixes #8087, Closes #8094.
2012-11-01 13:50:56 -02:00
Xavier Noria
f32f150e45 relaxes assertion
This method returns the status of the operation,
but as we generally do in the code base it does
not commit to any particular exact value. Hence,
we do not have to check for a singleton, because
if the implementation changes and returns some
other true value the test should pass.
2012-10-31 15:58:42 +01:00
José Valim
f5f57e2e34 Merge pull request #8083 from saks/fix_update_column_return_value
Fix ActiveRecord#update_column return value
2012-10-31 03:19:43 -07:00
saksmlz
68307a1ae5 Fix ActiveRecord#update_column return value 2012-10-31 12:59:11 +03:00
Rafael Mendonça França
d5b275db5c Revert "Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased"
This reverts commit 7d17cd2cbf.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This added a regression since people were relying on this buggy behavior.
This will introduce back #3849 but we will be backward compatible in
stable release.

Fixes #8068.
2012-10-31 00:31:47 -02:00
Rafael Mendonça França
6b7cd20ab3 Revert "Merge pull request #7797 from senny/7459_prefix_tempalte_assertion_variables"
This reverts commit 2bad605873.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This added a regression related with shoulda-matchers, since it
is expecting the instance variable @layouts

See 9e1188eea6/lib/shoulda/matchers/action_controller/render_with_layout_matcher.rb (L74)

This will introduce back #7459 but this stable release will be backward compatible.
Related with #8068.
2012-10-30 23:52:51 -02:00
Rafael Mendonça França
37c60c91f3 Add CHANGELOG entry to #8032 fix
e6b41845ef fixes that issue too.

[ci skip]
2012-10-29 23:01:04 -02:00
Rafael Mendonça França
fad74d6501 Fix typo 💣 [ci skip] 2012-10-29 22:59:36 -02:00
Rafael Mendonça França
96a13fc7de Fix bug when Column is trying to type cast boolean values to integer.
This can occur if the user is using :integer columns to store boolean
values. Now we are handling the boolean values but it still raises if
the value can't type cast to integer and is not a boolean. See #7509.

Fixes #8067.
2012-10-29 22:47:58 -02:00
Rafael Mendonça França
e6b41845ef Merge pull request #8009 from graceliu/3-2-fix_database_url_support
fixed support for DATABASE_URL for rake db tasks
2012-10-29 15:10:24 -02:00
Grace Liu
e7a6b92959 fixed support for DATABASE_URL for rake db tasks
Backport for #7521

- added tests to confirm establish_connection uses DATABASE_URL and
  Rails.env correctly even when no arguments are passed in.
- updated rake db tasks to support DATABASE_URL, and added tests to
  confirm correct behavior for these rake tasks.  (Removed
  establish_connection call from some tasks since in those cases
  the :environment task already made sure the function would be called)
- updated Resolver so that when it resolves the database url, it
  removes hash values with empty strings from the config spec (e.g.
  to support connection to postgresql when no username is specified).
- updated ResolverTest to use current_adapter? to check the type of
  the current adapter.
2012-10-29 15:08:29 -02:00
Santiago Pastorino
fdfb3990cd Bump to 3.2.9.rc1 2012-10-29 14:38:23 -02:00
Santiago Pastorino
6ed23ea5d4 Add 3.2.9 section in ARes CHANGELOG
[ci skip]
2012-10-29 13:50:26 -02:00
Rafael Mendonça França
633f2cd1b8 Revert "Deprecate Paths::Path#children which is unused now"
This reverts commit f7de647f2c.

We can't deprecate things in stable branches. I didn't not realized that
the pull request was for 3-2-stable
2012-10-29 11:03:29 -02:00
Rafael Mendonça França
a53e46406e Merge pull request #7587 from elia/fix-too-eager-loading
Should not eager_load app/assets
2012-10-29 06:02:16 -07:00
Elia Schito
f7de647f2c Deprecate Paths::Path#children which is unused now 2012-10-29 10:23:11 +01:00
Rafael Mendonça França
d40309a0b8 Merge pull request #8057 from frodsan/fix_sqlite_mutate_arg
SQLite3Adapter#type_cast should not mutate arguments
Conflicts:
	activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb
2012-10-29 02:04:24 -02:00
Carlos Antonio da Silva
cdfa4a5f86 Merge pull request #8053 from henrik/update_columns_with_primary_key
Unbreak update_column/update_columns for the primary key attribute.
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/persistence.rb
	activerecord/test/cases/persistence_test.rb
2012-10-29 01:59:04 -02:00
Rafael Mendonça França
5d82c1fc56 Make Active Record tests pass in isolation
Also remove the feature detecting for Ruby 1.9
2012-10-29 01:45:42 -02:00
Rafael Mendonça França
721cf54ee7 Fix the skip code.
Checking for the constant doesn't work
2012-10-28 23:47:20 -02:00
Rafael Mendonça França
a119dd3775 Merge pull request #7593 from veader/patch-1
Decode attributes pulled from URI.parse
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/connection_specification.rb
2012-10-28 23:47:16 -02:00
Rafael Mendonça França
37586ddf27 Merge pull request #8048 from senny/7761_dont_render_view_without_mail_call
Do not render views when mail() isn't called. (NullMail refactoring)
Conflicts:
	actionmailer/CHANGELOG.md
2012-10-28 17:58:48 -02:00
Carlos Antonio da Silva
2b5d3aa442 Merge pull request #8047 from arunagw/json_only_in_18
Removing JSON for other ruby
2012-10-28 12:51:42 -07:00
Arun Agrawal
1adb78424f Removing JSON for other ruby
It's only required for 1.8 and for JRuby!
I was fixing a bug with JSON pure on 1.8.7
and I found that we have included json for other
1.8 > rubies also.
2012-10-28 15:53:48 +05:30
Elia Schito
53778ec2d7 Respect children paths filter settings
E.g. don't eager-load app/assets even if app/* has the eager_load flag set.
2012-10-28 00:27:11 +02:00
Jeremy Kemper
4b1a7bcc4c Merge pull request #8038 from frodsan/fix_am_serializers_xml_dependency
Fix AM::Serializers::Xml dependency
2012-10-27 12:56:28 -02:00
Rafael Mendonça França
552a3e1453 Add test case to assets eager load 2012-10-27 14:12:41 +02:00
Rafael Mendonça França
7f09bcd181 Merge pull request #8022 from GRoguelon/3-2-stable
Adding a missing parenthesis in the doc of String#parameterize.
2012-10-24 06:38:31 -07:00
Geoffrey Roguelon
9f1a47de53 Adding a missing parenthesis in the doc of String#parameterize. 2012-10-24 15:25:35 +02:00
Aaron Patterson
f7c2a81141 frozen state should be restored after txn is aborted 2012-10-22 16:55:57 -07:00
Carlos Antonio da Silva
2471271937 Merge pull request #7986 from Grandrath/patch-2
Fix behavior of `rake db:structure:load` for 3.2.8
2012-10-20 07:18:40 -07:00
Rafael Mendonça França
b04ec2764f Require ActionController::Railtie in the default middleware stack.
This will make possible to do a frameworkless initialization since the
the default middleware stack is self contained.
2012-10-18 14:38:41 -03:00
Rafael Mendonça França
6dfa70152b Merge pull request #7989 from senny/backport_7969
backport: active_model/validations requires necessary files to run
2012-10-18 06:09:47 -07:00
Yves Senn
1f73a53071 active_model/validations requires necessary files to run 2012-10-18 14:51:16 +02:00
Martin Grandrath
f4ddc496da Use Rails.env instead of ENV['RAILS_ENV']; #7951
`ENV['RAILS_ENV']` is not defined unless explicitly specified on the
command line when running `rake db:structure:load`. This patch lets
the rake task retrieve the environment from `Rails.env` which defaults
to "development".
2012-10-18 10:57:30 +02:00
Santiago Pastorino
9a38e73c63 Merge pull request #7371 from csmuc/fix_dup_validation_errors
Dup'ed ActiveRecord objects may not share the errors object
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/test/cases/dup_test.rb
2012-10-17 22:39:48 -03:00
Aaron Patterson
d92e66f14c Synchronize around deleting from the reserved connections hash.
Fixes #7955
2012-10-15 14:12:48 -07:00
Rafael Mendonça França
b3485b7c9a Merge pull request #7940 from arturopie/7914-backport-to-3-2-stable
Backport fix of issue #7914 to 3-2-stable
2012-10-14 10:40:33 -07:00
Arturo Pie
3006c59bc7 7914 Using a better way to get the defaults from db.
Changes:

* According to postgreSQL documentation:
(http://www.postgresql.org/docs/8.2/static/catalog-pg-attrdef.html)
we should not be using 'adsrc' field because this field is unaware of
outside changes that could affect the way that default values are
represented. Thus, I changed the queries to use
"pg_get_expr(adbin, adrelid)" instead of the historical "adsrc" field.

* Remove parsing of character type default values for 8.1 formatting since
Rails doesn't support postgreSQL 8.1 anymore.

* Remove misleading comment unrelated to code.
2012-10-14 01:07:30 -04:00
Arturo Pie
3980465f26 #7914 get default value when type uses schema name
PostgreSQL adapter properly parses default values when using multiple
schemas and domains.

When using domains across schemas, PostgresSQL prefixes the type of the
default value with the name of the schema where that type (or domain) is.

For example, this query:
```
SELECT a.attname, d.adsrc
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = "defaults"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum;
```

could return something like "'<default_value>'::pg_catalog.text" or
"(''<default_value>'::pg_catalog.text)::text" for the text columns with
defaults.

I modified the regexp used to parse this value so that it ignores
anything between ':: and \b(?:character varying|bpchar|text), and it
allows to have optional parens like in the above second example.
2012-10-14 01:07:29 -04:00
Rafael Mendonça França
84c37741e0 Merge pull request #7925 from ernie/3-2-fix-collection-associations-with-select
Fix has_many assocation w/select load after create
2012-10-12 13:25:21 -07:00
Ernie Miller
990a938cf7 Fix has_many assocation w/select load after create
If you create a new record via a collection association proxy that has
not loaded its target, and which selects additional attributes through
the association, then when the proxy loads its target, it will
inadvertently trigger a deprecation notice during attribute writing when
CollectionAssociation#merge_target_lists attempts to do its thing, since
the newly loaded records will possess attributes the created record does
not.
2012-10-12 16:21:56 -04:00
Rafael Mendonça França
eefb344385 Merge pull request #7905 from jfirebaugh/eager_autoload_3-2
Backport eager autoloading fixes
2012-10-10 20:54:33 -07:00
John Firebaugh
2bed954c2d Eager autoload Preloader classes
Without eager autoloading, these would be autoloaded
only when #preloader_for is called, which is too late
in threaded applications.
2012-10-10 15:52:09 -07:00
Michael Fairley
de1b687239 Eager autoload ActiveRecord association helpers 2012-10-10 15:39:49 -07:00
Jeremy Kemper
fb9c00116b Backport 1a7049906ee6735bae058e9985a3806d08d9746b
Tag the blank log line between dev requests so it's easier to filter out entire requests with grep -v without leaving a stray newline behind. Example:

  # Tag asset requests so it's easy to filter them from dev logs
  config.log_tags = [
    -> request { :assets if request.path.starts_with?(config.assets.prefix) },
    -> request { request.uuid }
  ]

  # Watch the logs, ignoring asset requests
  $ tail -100f log/development.log | grep -v assets
2012-10-06 22:35:08 -07:00
Rafael Mendonça França
bf07c79a02 Merge pull request #7865 from teleological/link_to_remote_3_2
Accept :remote as symbol in link_to options (backport)
2012-10-06 17:13:17 -07:00
Rafael Mendonça França
f668ab9adf Use the Ruby 1.8 hash syntax 2012-10-06 19:16:26 -03:00
Riley
380800e4a2 Accept :remote as symbol in link_to options
Accept either :remote or 'remote' in both the html_options and
(url_)options hash arguments to link_to.
2012-10-06 17:23:04 -04:00
Rafael Mendonça França
92d761237e Merge pull request #7848 from senny/3415_assert_template_has_nil_variable
can't pass :locals to #assert_template without a view test case (#3415)
Conflicts:
	actionpack/CHANGELOG.md
2012-10-06 16:48:29 -03:00
Rafael Mendonça França
de360ac565 Merge pull request #7850 from senny/5920_postgres_adapter_table_with_capital_letters
postgres, quote table names when fetching the primary key (#5920)
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/connection_adapters/postgresql/schema_statements.rb
2012-10-06 16:39:29 -03:00
Rafael Mendonça França
98967293cf Merge pull request #6978 from frodsan/count_nosql_unsaved_parent
Count returns 0 without querying if parent is not saved
2012-10-04 13:34:38 -03:00
Rafael Mendonça França
95369a5921 Merge pull request #7836 from lihanli/error-msg-update
Update supported ruby versions error message in ruby_version_check.rb
2012-10-03 14:33:55 -07:00
lihan
36261c8165 Update supported ruby versions error message in ruby_version_check.rb 2012-10-03 17:29:29 -04:00
Santiago Pastorino
288885f9eb Refactor
Conflicts:
	activerecord/lib/active_record/counter_cache.rb
2012-10-03 00:53:11 -03:00
Rafael Mendonça França
3f0bc97912 Merge pull request #7822 from lulalala/reset-counter-cache-for-has-many-through
Fix reset_counters crashing on has_many :through associations.
Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
2012-10-02 15:58:49 -03:00
Rafael Mendonça França
2bad605873 Merge pull request #7797 from senny/7459_prefix_tempalte_assertion_variables
prefix TemplateAssertions ivars.

Closes #7459
Conflicts:
	actionpack/lib/action_controller/test_case.rb
	actionpack/lib/action_view/test_case.rb
2012-10-01 23:58:05 -03:00
Rafael Mendonça França
3b5bc8d71b Merge pull request #7789 from senny/7777_resource_functions_modify_options
resource and resources do no longer modify passed options
2012-10-01 12:53:53 -03:00
Rafael Mendonça França
a02f67b39b Merge pull request #6450 from iHiD/resource_generator_routes_master
Master branch: Fixed generated whitespace in routes when using namespaced resource.

Merge pull request #7811 from iHiD/resource_generator_routes_master

Fix the build (Broken scaffold routes test)
2012-10-01 10:11:47 -03:00
Rafael Mendonça França
628e38d789 Since File instance doesn't respond to #open use a double to test the
behavior added at c53e5def08
2012-09-30 22:59:23 -03:00
Jeremy Kemper
19987b64af Asset manifest includes aliases for foo.js -> foo/index.js and vice versa. Bump Sprockets requirements from 2.1+ to 2.2+ and let it answer "should we compile this asset?" for us. 2012-09-30 14:55:23 -07:00
Xavier Noria
5cb5092a70 Merge pull request #7802 from steveklabnik/issue_7799
Fix reference to code sample in Getting Started.
2012-09-30 10:01:09 -07:00
Steve Klabnik
24758822cb Fix reference to code sample in Getting Started.
Fixes #7799.
2012-09-30 09:38:01 -07:00
Rafael Mendonça França
d77d4a8949 New CHANGELOG entries always in the top [ci skip] 2012-09-30 00:23:16 -03:00
Rafael Mendonça França
7d17cd2cbf Merge pull request #7659 from HugoLnx/template_error_no_matches_rebased
REBASED: fixing assert_template bug when template matches expected, but not ends with
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/test_case.rb
2012-09-30 00:18:57 -03:00
Rafael Mendonça França
c2a7084a2d Merge pull request #7786 from yabawock/3-2-stable
Backport "Don't paramify ActionDispatch::Http::UploadedFile in tests"
2012-09-29 07:44:11 -07:00
Tim Vandecasteele
c53e5def08 Don't paramify ActionDispatch::Http::UploadedFile in tests
To test uploading a file without using fixture_file_upload, a posted
ActionDispatch::Http::UploadedFile should not be paramified (just like
Rack::Test::UploadedFile).
(Rack::Test::UploadedFile and ActionDispatch::Http::UploadedFile don't
share the same API, tempfile is not accessible on
Rack::Test::UploadedFile as discussed in
https://github.com/brynary/rack-test/issues/30)
2012-09-29 16:31:10 +02:00
Aaron Patterson
e1a10b15c2 Merge pull request #7785 from okcwest/3-2-stable
backport 68677ffb8298105eb9d3efa26d928dd88cc5e006
2012-09-28 16:57:24 -07:00
Evan Petrie
8dbf337e0a backport 68677ffb8298105eb9d3efa26d928dd88cc5e006 2012-09-28 14:19:31 -07:00
Jeremy Kemper
8ca05c2ea2 Hashrocket for 1.8 support 2012-09-28 11:15:06 -07:00
Jeremy Kemper
c203557421 Shush uninitialized @_layout warning 2012-09-28 10:53:17 -07:00
Jeremy Kemper
ddba97fa4f Shush syntax warnings 2012-09-28 09:56:49 -07:00
Jeremy Kemper
35a17502b6 Tune up Rails::Rack::Logger. Only put space between requests in development logs.
Conflicts:
	railties/test/application/rack/logger_test.rb
2012-09-27 10:46:50 -07:00
Jeremy Kemper
20f5f08d3b Add logger.push_tags and .pop_tags to complement logger.tagged
Avoid memory leak from unflushed logs on other threads leaving tags behind.

Conflicts:
	activesupport/CHANGELOG.md
	activesupport/lib/active_support/tagged_logging.rb
	activesupport/test/tagged_logging_test.rb
2012-09-27 10:46:50 -07:00
Jeremy Kemper
032c2b6b54 Log newlines separately to ensure the 'Started GET ...' line has a tag on the same line 2012-09-27 10:46:50 -07:00
Jeremy Kemper
08ca48379e Only apply log tags if the logger supports it 2012-09-27 10:46:50 -07:00
Rafael Mendonça França
8800aae312 Merge pull request #7684 from jrochkind/connection_pool_timeout_key_backport
ConnectionPool accepts spec key 'checkout_timeout' (Backport)
2012-09-25 06:36:43 -07:00
Jonathan Rochkind
39087068c2 ConnectionPool accepts spec key 'checkout_timeout'
Backport of #6441 cb6f83935 . Old 'wait_timeout' is still supported,
but conflicts with mysql2 using that spec key for different thing.
'checkout_timeout' can now be used taking precedence for ConnectionPool
over 'wait_timeout'.
2012-09-24 16:20:22 -04:00
Rafael Mendonça França
114e180213 Fix invalid ruby 1.8 syntax 2012-09-21 13:26:15 -03:00
Rafael Mendonça França
7b545ff911 Merge pull request #7723 from steveklabnik/backport_3554
Backport #3544 to 3-2-stable
2012-09-21 06:14:37 -07:00
Aaron Patterson
b8fba557e1 Merge pull request #3544 from amatsuda/_field_changed
Rename field_changed? to _field_changed? so that users can create a field named field
Conflicts:

	activerecord/lib/active_record/core.rb
	activerecord/test/cases/dirty_test.rb
2012-09-21 15:36:23 +03:00
Rafael Mendonça França
98f80218d4 Revert "Revert "Respect config.digest = false for asset_path""
This reverts commit 54f55746a7.

Reason: the last commit fixed the failing case
2012-09-20 19:54:14 -03:00
Rafael Mendonça França
9d07aceb50 Explictly set the assets digest option to false 2012-09-20 19:47:14 -03:00
Rafael Mendonça França
54f55746a7 Revert "Respect config.digest = false for asset_path"
This reverts commit 1ac19c1179.

Conflicts:
	actionpack/CHANGELOG.md

Reason: This is causing failures in the railties build.
See http://travis-ci.org/#!/rails/rails/jobs/2491787

Related with #7672
2012-09-20 19:07:49 -03:00
Rafael Mendonça França
e4018a00fd Revert "backport fair connection pool 02b2335563 to 3-2-stable"
This reverts commit 0693e07970.

Revert "Cache columns metadata to avoid extra while testing"

This reverts commit a82f1e3f5d.

Reason: This is causing failures in the postgresql build.
See http://travis-ci.org/#!/rails/rails/builds/2485584

Related with #7675
2012-09-20 19:06:20 -03:00
Rafael Mendonça França
50a76c14f9 Merge pull request #7718 from kennyj/fix_6962-32
[3-2-stable] Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings.
2012-09-20 06:34:11 -07:00
kennyj
4e715e33af Fix #6962. AS::TimeWithZone#strftime responds incorrectly to %:z and %::z format strings. 2012-09-20 22:04:52 +09:00
Jeremy Kemper
c41f9c1bd5 Load the environment after creating the database
Conflicts:
	activerecord/lib/active_record/railties/databases.rake
2012-09-19 21:54:04 -03:00
Rafael Mendonça França
61d5d2d8a9 Merge pull request #7668 from Draiken/fix_issue_6497
Removing to_shorthand to fix #6497
Conflicts:
	actionpack/CHANGELOG.md
2012-09-19 10:10:00 -03:00
Rafael Mendonça França
a82f1e3f5d Cache columns metadata to avoid extra while testing 2012-09-18 22:24:45 -03:00
Chris Barton
4325bec1d4 Making test accurately reflect what is going on in the schema migrations test 2012-09-18 13:15:02 -07:00
Rafael Mendonça França
29ebec702d Merge pull request #7686 from steveklabnik/add_upgrade_note
Add upgrading note to 3.1 release notes.
2012-09-18 11:12:08 -07:00
Steve Klabnik
1929d9f9e1 Add upgrading note to 3.1 release notes.
See #7685.
2012-09-18 21:07:59 +03:00
Rafael Mendonça França
7c5454e555 Merge pull request #7672 from wagenet/asset_path_digest_fix
Respect `config.digest = false` for `asset_path`
2012-09-18 06:25:36 -07:00
Peter Wagenet
1ac19c1179 Respect config.digest = false for asset_path
Previously, the `asset_path` internals only respected the `:digest`
option, but ignored the global config setting. This meant that
`config.digest = false` could not be used in conjunction with
`config.compile = false` this corrects the behavior.
2012-09-17 15:32:31 -07:00
Rafael Mendonça França
24a77743b6 Merge pull request #7675 from jrochkind/fair_conn_pool_backport
backport fair connection pool 02b2335563 to 3-2-stable
2012-09-17 15:07:28 -07:00
Jonathan Rochkind
0693e07970 backport fair connection pool 02b2335563 to 3-2-stable 2012-09-17 18:04:04 -04:00
Yves Senn
dd76b3bbc8 log 404 status when ActiveRecord::RecordNotFound was raised (#7646)
Conflicts:
	actionpack/CHANGELOG.md
	actionpack/lib/action_controller/log_subscriber.rb
2012-09-17 13:39:01 -03:00
Rafael Mendonça França
ee43989575 Merge pull request #7661 from ernie/build-join-records-on-unsaved-hmt
Fix collection= on hm:t join models when unsaved
2012-09-17 10:46:19 -03:00
Rafael Mendonça França
07c8055dc0 Merge pull request #7666 from kennyj/fix_9fa3f102813eeeec440abd75870dfa7b23835665
Fix warning: method redefine. Testcase name are duplicated.
2012-09-17 10:05:55 -03:00
Rafael Mendonça França
8432d03460 Merge pull request #7651 from steveklabnik/issue_3956
Don't preserve SELECT columns on COUNT

Closes #7651

Conflicts:
	activerecord/test/cases/associations/has_many_associations_test.rb
2012-09-16 23:31:35 -03:00
Rafael Mendonça França
6abe0e7b4e Backport explain fixes.
* Mark as SCHEMA some schema database queries. #7648
* Don't explain queries except normal CRUD sql. #7657

Closes #6458
Closes #7544
2012-09-16 22:18:11 -03:00
Rafael Mendonça França
dbfdd00e38 skip in Ruby 1.8 doesn't skip the test case without return 2012-09-13 22:26:08 -03:00
Carlos Antonio da Silva
5aaf79a15e Merge pull request #7633 from frodsan/patch-5
Fix markdown markup in AR/CHANGELOG [ci skip]
2012-09-13 15:40:57 -07:00
Francesco Rodríguez
2326d46e8c fix markdown markup in AR/CHANGELOG 2012-09-13 17:38:10 -05:00
Rafael Mendonça França
84c7896c84 Merge pull request #7632 from stevecj/3-2-stable
3 2 stable
2012-09-13 15:22:03 -07:00
Steve Jorgensen
f48bb016a7 Backport PostgreSQL auto-reconnect test coverage
6d5f4de4c420ebb906109668f5702a537ac77692
Simulated & actual (manual/skipped) PostgreSQL auto-reconnection tests.

4b1bca04025a66c54e6e9d5eb6e4d4056bfa92f0
Stop being silly with formatting of method aliasing.

c381d5cbf959208adeb38e7859ee815dfbd2cf54
Fix just-plain-wrongness of psql auto-reconnect test.

1e17a9d367c54c680368be72f44247ae28b98904
Fix only-once stub logic.

f16c2043826ec1991cf94fe17cb671507b7a7f51
Changelog for PostgreSQL auto-reconnect test coverage backport.
2012-09-13 14:57:59 -07:00
Rafael Mendonça França
f568280ba4 Merge pull request #7603 from kennyj/fix_charset_vs_encoding_32
Backported #7572 to 3-2-stable. Use config['encoding'], because database configuration use not charset but encoding.
2012-09-12 09:34:55 -07:00
kennyj
96304855e6 Backported #7572 to 3-2-stable. Use config['encoding'], because database configuration use not charset but encoding. 2012-09-12 01:37:18 +09:00
Rafael Mendonça França
924ad60151 Merge pull request #7582 from tchandy/fix_type_cast_code
type_cast_code should always convert values to integer calling #to_i
2012-09-09 13:19:39 -07:00
Thiago Pradi
652107e2e1 ConnectionAdapters::Column.type_cast_code should always convert values to integer calling #to_i 2012-09-09 16:23:52 -03:00
Carlos Antonio da Silva
146eaf3818 Fix AS tests due to builder change with nil values / empty strings
Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about
that.
2012-09-07 13:43:57 -03:00
Carlos Antonio da Silva
77dd3be503 Fix AR tests due to builder change with nil values / empty strings
Check 0180e090ab6cbe66f7b521a0c03e278a0463accd for more reasoning about
that.
2012-09-07 13:43:55 -03:00
Carlos Antonio da Silva
d65adc7425 Update Active Model xml serialization test to reflect a change in builder
Due to a change in builder, nil values and empty strings now generates
closed tags, so instead of this:

    <pseudonyms nil=\"true\"></pseudonyms>

It generates this:

    <pseudonyms nil=\"true\"/>

Document this change in Rails so that people can track it down easily if
necessary.

Conflicts:
	activemodel/CHANGELOG.md
2012-09-07 13:18:23 -03:00
Rafael Mendonça França
5054e266ac Merge pull request #7337 from adzap/string_to_dummy_time
Fix for time type columns with invalid time value
Conflicts:
	activerecord/CHANGELOG.md
2012-09-05 10:47:52 -03:00
Rafael Mendonça França
87ac5b42b1 Merge pull request #7514 from senny/issue_7503_3_2_stable
set the configured #inheritance_column on #become (#7503)
2012-09-03 07:38:48 -07:00
Yves Senn
01d09a6079 set the configured #inheritance_column on #become (#7503)
I had to create a new table because I needed an STI table,
which does not have both a "type" and a "custom_type"

the test fails with:
  1) Error:
test_alt_becomes_works_with_sti(InheritanceTest):
NoMethodError: undefined method `type=' for #<Cabbage id: 1, name: "my cucumber", custom_type: "Cucumber">
    /Users/username/Projects/rails/activemodel/lib/active_model/attribute_methods.rb:432:in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/attribute_methods.rb:100:in `method_missing'
    /Users/username/Projects/rails/activerecord/lib/active_record/persistence.rb:165:in `becomes'
    test/cases/inheritance_test.rb:134:in `test_becomes_works_with_sti'
    test/cases/inheritance_test.rb:140:in `test_alt_becomes_works_with_sti'

Conflicts:

	activerecord/test/cases/inheritance_test.rb
2012-09-03 16:35:38 +02:00
Xavier Noria
cabab374bf documents after_(commit|rollback) 2012-08-30 06:58:07 +02:00
Piotr Sarnacki
f84fc39e2a Merge pull request #7474 from steveklabnik/backport_89ebd28
Backport 89ebd28 to 3-2-stable
2012-08-29 00:24:52 -07:00
Marc-Andre Lafortune
728e925735 Fix bug when Rails.application is defined but is nil. See #881 2012-08-28 21:06:58 -07:00
Pratik Naik
58d35f6211 Ensure association preloading properly merges default scope and association conditions
Conflicts:

	activerecord/test/models/reader.rb
2012-08-28 12:57:41 -07:00
Xavier Noria
8efced68be CHANGELOGs are now per branch
Check 810a50d for the rationale.
2012-08-28 21:39:32 +02:00
Xavier Noria
8333b93e31 fixes a bug in dependencies.rb
loaded stores file names without the .rb extension, but search_for_file
returns file names with the extension.

The solution is hackish, but this file needs a revamp.
2012-08-28 17:22:56 +02:00
Rafael Mendonça França
dcb2bee35e Merge pull request #7446 from nashby/backport-fix-issue-7431
backport #7435
2012-08-25 08:53:24 -07:00
Vasiliy Ermolovich
4b1985578a correct handling of date selects when using both disabled and discard options
we should take disabled option not only from `html_options` hash but from
`options` hash too like `build_select` method does it. So

datetime_select("post", "updated_at", { :discard_minute => true }, { :disabled => true })
datetime_select("post", "updated_at", :discard_minute => true , :disabled => true)

both these variants work now

closes #7431
2012-08-25 18:48:14 +03:00
Santiago Pastorino
b76a96320e Merge pull request #7438 from arunagw/3-2-stable-edge-rails-fix
We need to have 1-0-stable for joureny gem in edge
2012-08-24 07:14:26 -07:00
Arun Agrawal
0ec7b35e34 We need to have 1-0-stable for joureny gem in edge
Problem : Edge rails can't bundle
Fixes #7437
2012-08-24 12:55:55 +05:30
Carlos Antonio da Silva
d5fe242d2a Use Ruby 1.8 hash syntax
Introduced in backport 648c5a1369.
2012-08-21 17:23:08 -03:00
Rafael Mendonça França
015cac7553 Use a model without counter cache to test read-only attributes 2012-08-21 15:57:24 -03:00
Rafael Mendonça França
648c5a1369 Merge pull request #5210 from Pliny/masteri
Fix for #5200

Conflicts:
	activerecord/CHANGELOG.md
	activerecord/lib/active_record/counter_cache.rb
2012-08-21 14:36:04 -03:00
Rafael Mendonça França
c091fae21f Merge pull request #7410 from sandeepravi/default_options_helper_value
option_tags coerced to "" instead of nil

Closes #7404
2012-08-21 13:44:54 -03:00
Rafael Mendonça França
8905c1fb49 Merge pull request #6986 from kennyj/fix_6975
Fix #6975. Round usec when writing timestamp attribute.

Conflicts:
	activerecord/lib/active_record/attribute_methods/time_zone_conversion.rb
2012-08-21 10:36:01 -03:00
Carlos Antonio da Silva
fdf4eae506 Merge pull request #7377 from brainopia/use_inversed_parent_for_first_and_last_child
Use inversed parent for first and last child of has_many association

[Backport] Closes #3223.

Conflicts:
	activerecord/lib/active_record/associations/collection_association.rb
2012-08-21 01:00:14 -03:00
Rafael Mendonça França
b3bea49938 Merge pull request #7388 from ManageIQ/fix_table_remove_passing_array_deprecation
Table#remove passed an array to remove_column, which is deprecated.
2012-08-18 08:32:26 -07:00
Joe Rafaniello
066ecf0037 Table#remove passed an array to remove_column, which is deprecated.
See 02ca9151a0
2012-08-18 11:21:10 -04:00
Rafael Mendonça França
3c61642b35 Ruby 1.8 doesn't have to_r defined to NilClass and Float.
Use round to get the right conversion
2012-08-18 12:06:25 -03:00
Rafael Mendonça França
d6dbd7fbbc Merge pull request #7352 from aripollak/microsecond-timestamp
Fix occasional microsecond conversion inaccuracy
Conflicts:
	activerecord/CHANGELOG.md
2012-08-17 14:47:40 -03:00
Jon Leighton
25f65498c1 Increase benchmark time to 20 seconds.
I think that 5 seconds was a bit low for our purposes.

Also enable it to be configured via env vars.

We also need to scale the number of records up/down depending on how
long we're running the benchmark for.
2012-08-17 15:09:34 +01:00
Jon Leighton
bfff0ed333 Use benchmark/ips to measure AR performance
This means we can more easily compare numbers, and we don't have to
specify a single N for all reports, which previously meant that some
tests were running many more/fewer iterations than necessary.
2012-08-17 11:43:48 +01:00
Carlos Antonio da Silva
4e31f826dc Remove duplicated changelog entry [ci skip] 2012-08-15 12:49:09 -03:00
Carlos Antonio da Silva
b4dce47694 Merge pull request #7027 from erichmenge/patch/jruby_send_file
Backport 5c51cd0 to fix an issue with jRuby encodings. Fixes #6844
2012-08-15 08:39:37 -07:00
Rafael Mendonça França
8055cd6568 Do not use update_column where update_attribute is not interchangeable
Revert "Deprecate update_attribute."

This reverts commit b081f6b59f.

Reason: Since the new deprecation policy we removed the deprecation of
update_attribute but we didn't reverted the changes to use
update_column.

Fixes #7306
2012-08-15 11:58:41 -03:00
Jeremy Kemper
bccc35b13e Backport 5c51cd0: #send_file leans on Rack::Sendfile to X-Accel-Redirect the file's path, so opening the file to set the response body is wasteful. Set a FileBody wrapper instead that responds to to_path and streams the file if needed. 2012-08-15 08:43:49 -05:00
Rafael Mendonça França
786713a3ab Merge pull request #6073 from daveyeu/restore-state-on-record-invalid
Restore state on create when ActiveRecord::RecordInvalid is raised
Conflicts:
	activerecord/CHANGELOG.md
2012-08-11 23:24:47 -03:00
Rafael Mendonça França
20f18cbc14 Merge pull request #7316 from brainopia/backport_fix_session_store_options
Backport of "Support cookie jar options for all cookie stores" for 3.2-stable
2012-08-11 12:57:43 -07:00
brainopia
2e04a343eb Update changelog to reflect support of cookie jar options for all
session stores
2012-08-11 23:19:12 +04:00
Piotr Sarnacki
dad717a5ea [guides] Add info about CHANGELOGs to contributing guide 2012-08-11 12:49:09 +02:00
Rafael Mendonça França
3307a2ec01 Add CHANGELOG entry for #7286 2012-08-10 15:06:58 -03:00
Rafael Mendonça França
2e00074380 Merge pull request #7286 from kennyj/fix_7191
Fix #7191. Remove unnecessary transaction when assigning has_one associations.
Conflicts:
	activerecord/test/cases/associations/has_one_associations_test.rb
2012-08-10 15:05:02 -03:00
brainopia
ca07bc0de7 Test actual content of permanent cookie 2012-08-10 10:00:27 +04:00
brainopia
bbe634e72c Dont stream back cookie value if it was set to the same value 2012-08-10 10:00:04 +04:00
brainopia
058dc9a096 Revert "Revert "Merge pull request #6084 from brainopia/support_for_magic_domain_on_all_stores""
This reverts commit a48ea6800e.
2012-08-10 09:59:37 +04:00
Santiago Pastorino
ae2383d90a Merge pull request #7309 from amerine/3-2-stable
Add html_escape note to CHANGELOG
2012-08-09 16:57:38 -07:00
Mark Turner
e8c0d737ef Add html_escape note to CHANGELOG 2012-08-09 16:48:57 -07:00
Santiago Pastorino
7987e7419a Merge branch '3-2-8' into 3-2-stable 2012-08-09 18:15:59 -03:00
Santiago Pastorino
64146cf7ba Bump to 3.2.8 2012-08-09 16:26:36 -03:00
Santiago Pastorino
ddedf5d88e Add release date to CHANGELOGs 2012-08-09 16:25:43 -03:00
Santiago Pastorino
e91e4e8bbe Do not mark strip_tags result as html_safe
Thanks to Marek Labos & Nethemba

CVE-2012-3465
2012-08-09 16:06:17 -03:00
Santiago Pastorino
6d0526db91 escape select_tag :prompt values
CVE-2012-3463
2012-08-09 15:48:17 -03:00
Rafael Mendonça França
0f9a6a7c80 Merge pull request #7299 from iHiD/3-2-stable-store
Ported PR #4856 to 3-2-stable.
2012-08-09 13:59:52 -03:00
Rafael Mendonça França
5c2fc69461 Add CHANGELOG entry 2012-08-09 13:58:57 -03:00
Jeremy Walker
af6dfdb1f3 Backport #7173. 2012-08-09 13:57:44 -03:00
Jeremy Walker
2a6039a810 Ported PR #4856 to 3-2-stable. 2012-08-09 12:44:59 +01:00
Rafael Mendonça França
2e98e0f386 Fix CHANGELOG [ci skip] 2012-08-08 11:51:55 -03:00
Rafael Mendonça França
4147e0fead Remove references to old behavior with headers at
ActionDispatch::Integration::ResquestHelpers.

The behavior has removed at 4a6f4b92ad to
increase the compatibility with Rack::Test

Closes #7136

[ci skip]
2012-08-07 18:16:59 -03:00
Rafael Mendonça França
c35853f044 Merge pull request #7284 from josh/fix-asset-tests
Fix asset integration test (3-2-stable)
2012-08-07 12:30:14 -07:00
Joshua Peek
635817ec8e Fix invalid asset compile assertions
Logical paths to compile should require an extension
2012-08-07 14:25:33 -05:00
Aaron Patterson
d498b5e6ba make assertions easier to track down 2012-08-07 10:54:08 -07:00
David Heinemeier Hansson
185d74cf38 Merge pull request #7283 from josh/bump-sprockets
Allow newer versions of Sprockets
2012-08-07 09:11:05 -07:00
Joshua Peek
83e0c952d6 Loosen sprockets version restriction 2012-08-07 11:01:33 -05:00
Rafael Mendonça França
ea48732fe1 Add CHANGELOG entry for a935c7a 2012-08-06 18:16:56 -03:00
Aaron Patterson
a935c7a259 Merge pull request #5872 from evtuhovich/prepared_statement_fix
Remove prepared statement from system query in postgresql adapter
Conflicts:
	activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
2012-08-06 18:16:09 -03:00
José Valim
29fb31f561 Merge pull request #7167 from route/missed_extend
Missed extend for eager_autoload

This backport is trying to fix a bug with eager load
ActiveRecord::Associations modules
2012-08-06 17:44:55 -03:00
Rafael Mendonça França
3cc872d483 Merge pull request #7276 from sikachu/3-2-stable-js-include-tag-fix
Do not include application.js if it doesn't exists
2012-08-06 13:41:31 -07:00
Prem Sichanugrist
6c4673030e Rearrange example output of javascript_include_tag 2012-08-06 16:38:52 -04:00
Prem Sichanugrist
8e2a05b33d Do not include application.js if it doesn't exists
Rails were including 'application.js' to the pack when using
`javascript_include_tag :all` even there's no application.js in the
public directory.
2012-08-06 16:38:52 -04:00
Rafael Mendonça França
0fb6bbdf7e Merge pull request #7140 from seamusabshere/patch-1
Make sure :environment task is executed before db:schema:load or
db:structure:load

Conflicts:
	activerecord/CHANGELOG.md
2012-08-05 20:46:27 -03:00
Rafael Mendonça França
a48ea6800e Revert "Merge pull request #6084 from brainopia/support_for_magic_domain_on_all_stores"
This reverts commit 393c652cf6.

This commit was supposed to fix a bug but it add more failures.
2012-08-05 20:44:27 -03:00
Santiago Pastorino
65b5e35e89 Bump to 3.2.8.rc2 2012-08-03 11:01:50 -03:00
Santiago Pastorino
5f9ae95e9b Add CHANGELOG entry 2012-08-03 11:00:20 -03:00
José Valim
393c652cf6 Merge pull request #6084 from brainopia/support_for_magic_domain_on_all_stores
Support cookie jar options for all cookie stores
2012-08-02 21:54:41 -03:00
Rafael Mendonça França
469d885798 More :rails_env cleanup.
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
2012-08-02 19:13:07 -03:00
Rafael Mendonça França
e23b26cfda More :rails_env cleanup.
`Rails.env` already use development if ENV["RAILS_ENV"] is not present.
2012-08-02 17:58:47 -03:00
Rafael Mendonça França
ebddf75097 Fix html_escape with Ruby 1.8 2012-08-02 17:32:44 -03:00
Rafael Mendonça França
2f4b82f1d8 Fix html_escape with Ruby 1.8 2012-08-02 17:28:19 -03:00
Santiago Pastorino
28f2c6f403 html_escape should escape single quotes
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215

Conflicts:
	actionpack/test/template/erb_util_test.rb
	actionpack/test/template/form_tag_helper_test.rb
	actionpack/test/template/text_helper_test.rb
	actionpack/test/template/url_helper_test.rb
	activesupport/lib/active_support/core_ext/string/output_safety.rb
2012-08-02 17:14:30 -03:00
Santiago Pastorino
2bdb4ec6ad html_escape should escape single quotes
https://www.owasp.org/index.php/XSS_%28Cross_Site_Scripting%29_Prevention_Cheat_Sheet#RULE_.231_-_HTML_Escape_Before_Inserting_Untrusted_Data_into_HTML_Element_Content
Closes #7215

Conflicts:
	actionpack/test/template/erb_util_test.rb
	actionpack/test/template/form_tag_helper_test.rb
	actionpack/test/template/text_helper_test.rb
	actionpack/test/template/url_helper_test.rb
	activesupport/lib/active_support/core_ext/string/output_safety.rb
2012-08-02 17:09:37 -03:00
Rafael Mendonça França
9c1b1bd42c Use :data => { :confirm => "Text" } syntax instead of :confirm at
the ERB scaffold generator.

We are trying to teach the data attributes as best practices and
`:confirm` will be deprecated in 4.0.
2012-08-02 15:39:18 -03:00
Rafael Mendonça França
55e05d465d Do not consider the numeric attribute as changed if the old value is
zero and the new value is not a string.

Before this commit this was the behavior

r = Review.find_by_issue(0)
r.issue
=> 0
r.changes
=> {}
r.issue = 0
=> 0
r.changed?
=> true
r.changes
=> {"issue"=>[0,0]}

Fixes #7237
2012-08-02 15:39:06 -03:00
Mike Gunderloy
5c42889e3b Fix ActiveSupport integration with Mocha > 0.12.1
Mocha 0.12.2 renames the Integration module to
MonkeyPatching. This breaks the code Rails uses
to retrieve the assertion counter from Mocha.
2012-08-02 15:38:08 -03:00
Rafael Mendonça França
96e92b6162 Use :data => { :confirm => "Text" } syntax instead of :confirm at
the ERB scaffold generator.

We are trying to teach the data attributes as best practices and
`:confirm` will be deprecated in 4.0.
2012-08-02 15:30:38 -03:00
Rafael Mendonça França
99f622de23 Do not consider the numeric attribute as changed if the old value is
zero and the new value is not a string.

Before this commit this was the behavior

r = Review.find_by_issue(0)
r.issue
=> 0
r.changes
=> {}
r.issue = 0
=> 0
r.changed?
=> true
r.changes
=> {"issue"=>[0,0]}

Fixes #7237
2012-08-02 14:11:51 -03:00
Carlos Antonio da Silva
59c4b22c45 Merge pull request #7232 from kennyj/fix_7200
Fix #7200. Backport #5168 to 3-2-stable
2012-08-02 07:53:47 -07:00
kennyj
f137c2b838 Backport #5168 to 3-2-stable. Fix a problem that NULLS is ignored by postgresql_adapter.rb while creating distincts. 2012-08-02 23:31:46 +09:00
Carlos Antonio da Silva
5365c10a1f Merge pull request #7235 from ffmike/mocha_12_2_compat
Fix ActiveSupport integration with Mocha > 0.12.1
2012-08-02 05:08:50 -07:00
Mike Gunderloy
a252436d64 Fix ActiveSupport integration with Mocha > 0.12.1
Mocha 0.12.2 renames the Integration module to
MonkeyPatching. This breaks the code Rails uses
to retrieve the assertion counter from Mocha.
2012-08-02 06:43:47 -05:00
Santiago Pastorino
74cf196f63 This entry is wrong 2012-08-01 18:08:48 -03:00
Santiago Pastorino
fcccbacec1 Bump to 3.2.8.rc1 2012-08-01 17:50:48 -03:00
Rafael Mendonça França
f50a5d2eee Revert "Deprecate link_to_function and button_to_function helpers"
This reverts commit 9dc57fe9c4.
2012-08-01 16:00:47 -03:00
Rafael Mendonça França
e826a5c749 Revert "Deprecate :mouseover options for image_tag helper."
This reverts commit 1aff7725c7.

Conflicts:
	actionpack/CHANGELOG.md
2012-08-01 15:58:56 -03:00
Rafael Mendonça França
af65b8c9e7 Revert "Deprecate ActiveSupport::JSON::Variable"
This reverts commit bcfa013399.
2012-08-01 15:56:38 -03:00
Rafael Mendonça França
857697bb87 Fix CHANGELOGS 2012-08-01 15:52:00 -03:00
Xavier Noria
81542f95d2 removes the deprecation of update_attribute
Applying the new policy here to not deprecate stuff in point releases.
2012-08-01 20:40:07 +02:00
Xavier Noria
f203be9864 revises the deprecation warning of update_attribute
We have decided not to drop this important method in 4.0 and give
it a longer deprecation cycle. On the other hand we do not expect
to have update_column around for a long time, it is going to be
replaced in favor of update_columns.
2012-08-01 20:24:24 +02:00
Rafael Mendonça França
89177ba200 Revert "Deprecate :confirm in favor of :data => { :confirm => 'Text' } option"
Revert "Deprecate `:disable_with` in favor of `'data-disable-with'` option for `button_to` and `submit_tag` helpers."

This reverts commit fc092a9cba.
This reverts commit e9051e20ae.
This reverts commit d47d6e7eda.
This reverts commit 21141e777b.
2012-08-01 15:15:06 -03:00
Rafael Mendonça França
736bf14d7c Revert "Deprecating composed_of in ActiveRecord"
This reverts commit 44b313bc4e.
2012-08-01 15:09:56 -03:00
Jon Leighton
0c52702630 Revert "Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql."
This reverts commit a79bfa92e7.

Conflicts:
	activerecord/CHANGELOG.md

We shouldn't introducing deprecations in point releases.
It will be deprecated in 4.0 instead.
2012-08-01 19:13:55 +01:00
Santiago Pastorino
6764b7ba23 Add missing CHANGELOG entries
[ci skip]
2012-08-01 14:38:09 -03:00
Rafael Mendonça França
3e01a2a855 Merge pull request #7070 from jmazzi/3-2-stable
Update documentation for Rails::Application#env_config
2012-08-01 06:06:18 -07:00
Rafael Mendonça França
69fd0e8d6c Merge pull request #7147 from pferdefleisch/scaffold_controller_docs
Updated scaffold_controller generator docs #7146
2012-07-31 23:15:56 -03:00
Rafael Mendonça França
a893672f3f Add CHANGELOG entry [ci skip] 2012-07-31 14:45:23 -03:00
Rafael Mendonça França
2f930df518 Revert "Add update_columns and the suggestion of using update_columns
instead of update_column"

This reverts commit 9fa06c3d98.

This reverts commit 17a64de498.

This reverts commit def9c85ffb, reversing
changes made to 6b7d26cf3c.

Reason: This was supposed to be released with 3.2.7 before the
suggestion to use update_column. Since it was not release now is not
good to suggest to use another method because it will confusing the
people.
2012-07-30 10:16:28 -03:00
Xavier Noria
cc712f2072 removes the AR session store from eager loaded code [fixes #7160]
See the comment in the file activerecord/lib/active_record.rb
added by this patch for the rationale.
2012-07-29 00:25:00 +02:00
Rafael Mendonça França
be408d66b7 Merge pull request #7187 from frodsan/fix_test_help
Backport #6995 to 3-2 stable
2012-07-28 12:03:44 -07:00
Francesco Rodriguez
3326b8b139 Backport #6995 to 3-2 stable
Update `test_help` to config properly turn natural language option.
Last versions of Turn don't monkey patch MiniTest to setup
the natural language option. Here is an [example](https://github.com/TwP/turn/blob/master/try/test_autorun_minitest.rb#L3).

This patches the following behaviour:

    $ rake test:units
    `<top (required)>': undefined method `use_natural_language_case_names='
    for MiniTest::Unit:Class (NoMethodError)
2012-07-28 13:59:08 -05:00
Xavier Noria
bf1645613e missing require: the AR session store depends on the AP abstract store
This require makes the dependency even more clear.
In particular we are eager loading the session
store but that does not work if AR is used
outside Rails, this patch is preliminary work
in fixing #7160.
2012-07-28 17:52:27 +02:00
Xavier Noria
db340da219 adds a missing require from Active Support
This file uses mattr_accessor.
2012-07-28 01:01:01 +02:00
Rafael Mendonça França
4b8b8c1b4d Only require the :rails_env task where is needed.
`:rails_env` tasks is not needed in all the tasks that depends of
`load_config`, only in the tasks that uses `Rails.env`.

Since `:rails_env` task set the `Rails.env` to be "development" if it is
not set we don't need the `||` statements too

Fix #7175.
2012-07-27 01:20:17 -03:00
Aaron Patterson
133754ef17 Merge branch '3-2-rel' into 3-2-stable
* 3-2-rel:
  updating release date
  bumping to 3.2.7
  updating the changelog
  * Do not convert digest auth strings to symbols. CVE-2012-3424
  updating the version
  updating changelogs
2012-07-26 15:07:19 -07:00
Aaron Patterson
d1b9cf2d48 updating release date 2012-07-26 14:34:31 -07:00
Aaron Patterson
21bcac1998 bumping to 3.2.7 2012-07-26 14:26:23 -07:00
Aaron Patterson
fb89f6f076 updating the changelog 2012-07-26 13:30:25 -07:00
Aaron Patterson
27311fef5e * Do not convert digest auth strings to symbols. CVE-2012-3424 2012-07-26 13:30:15 -07:00
Rafael Mendonça França
3dae440098 Merge pull request #7164 from parndt/patch-4
Switched update_column recommendation in changelog to update_columns
2012-07-25 20:57:09 -07:00
Philip Arndt
9fa06c3d98 Switched update_column recommendation in changelog to update_columns
This is related to #7159
2012-07-26 15:43:16 +12:00
Carlos Antonio da Silva
17a64de498 Fix AR#update_columns tests on Ruby 1.8.7 2012-07-25 22:43:21 -03:00
Aaron Patterson
def9c85ffb Merge pull request #7159 from parndt/update_columns
Backport update_columns to Rails 3.2
2012-07-25 16:50:07 -07:00
Philip Arndt
a0b85b9ada Suggest using update_columns instead of update_column.
update_column is deprecated in Rails 4.0 so it makes no sense to
recommend adopting it only to require changing to update_columns
in the very next release.
2012-07-26 11:44:38 +12:00
Sebastian Martinez
f27a8eb71a New #update_columns method. 2012-07-26 11:42:31 +12:00
Aaron Patterson
753c546df4 updating the version 2012-07-23 14:41:02 -07:00
Aaron Patterson
125dfdfcf7 updating changelogs 2012-07-23 14:26:16 -07:00
Andrew White
6b7d26cf3c Bump Journey requirements to 1.0.4
There are some Action Pack tests for regressions from 3.1 that require
a later version of Journey to pass so bump to the current version.
2012-07-23 07:04:30 +01:00
Xavier Noria
a37b90caf4 Hash#fetch(fetch) is not the same as doing hash[key] 2012-07-21 08:05:53 +02:00
Rafael Mendonça França
089371ac23 validates_inclusion_of and validates_exclusion_of now accept
`:within` option as alias of `:in` as documented.

Fix #7118
2012-07-20 14:19:26 -03:00
Jon Leighton
a79bfa92e7 Deprecate :finder_sql, :counter_sql, :insert_sql, :delete_sql. 2012-07-20 17:59:27 +01:00
Carlos Antonio da Silva
b16e7ed58e Merge pull request #6616 from dpassage/fix_resolver_test_sqlite3
Resolver tests fail if mysql adapter not installed
2012-07-19 21:15:55 -03:00
Rafael Mendonça França
22880def35 Merge pull request #7108 from arunagw/mocha_bump
Bumping mocha!
2012-07-19 06:39:05 -07:00
Arun Agrawal
89dee0e007 Bumping mocha!
Reason:- 0.12.0 introduced a bug where you got a exception
which is now in 0.12.1 is a warning only!
2012-07-19 19:06:37 +05:30
Jon Leighton
827f369fff Merge pull request #7080 from jfirebaugh/to_param_regression
AR::Integration must be included after AM::Conversion
2012-07-17 15:20:58 -07:00
John Firebaugh
9b5309fb68 AR::Integration must be included after AM::Conversion
Integration's definition of #to_param must override
Conversion's. Otherwise, there is a regression from
3.1 in the behavior of a non-persisted AR::Base instance
which nevertheless has an id.
2012-07-17 13:57:30 -07:00
Andrew White
71d274dbbb Add support for optional root segments containing slashes
Optional segments with a root scope need to have the leading slash
outside of the parentheses, otherwise the generated url will be empty.
However if the route has non-optional elements then the leading slash
needs to remain inside the parentheses otherwise the generated url
will have two leading slashes, e.g:

Blog::Application.routes.draw do
  get '/(:category)', :to => 'posts#index', :as => :root
  get '/(:category)/author/:name', :to => 'posts#author', :as => :author
end

$ rake routes
  root GET /(:category)(.:format)              posts#index
author GET (/:category)/author/:name(.:format) posts#author

This change adds support for optional segments that contain a slash,
allowing support for urls like /page/2 for the root path, e.g:

Blog::Application.routes.draw do
  get '/(page/:page)', :to => 'posts#index', :as => :root
end

$ rake routes
root GET /(page/:page)(.:format) posts#index

Fixes #7073
(cherry picked from commit d8745decaf59aad32aa2f09abdba99b8d0e48b31)
2012-07-17 20:09:28 +01:00
Rafael Mendonça França
e23ec4c79c Merge pull request #4396 from kennyj/fix_4259
Fix GH #4259. When we execute schema dumper, we must remove table_name_prefix and table_name_suffix.
2012-07-17 10:42:01 -03:00
Justin Mazzi
c6ad1677b3 Update documentation for Rails::Application#env_config 2012-07-16 14:06:53 -04:00
Xavier Noria
b3693bf2f8 adds a missing require [fixes #6896]
This file uses Time.zone, which is defined in
active_support/core_ext/time/zones.rb.
2012-07-15 00:44:10 +02:00
Aaron Patterson
f7ef7caac6 fixing tests to deal with data differences between prepared statements and non-prepared statements 2012-07-13 15:30:52 -07:00
Jeremy Cole
8f432300b8 Fixing texts; down to three failing tests. 2012-07-13 15:02:18 -07:00
Jeremy Cole
e4ef90a981 Only use prepared statements when bind variables are present
Prepared statements (prepare/execute/close) were being used unnecessarily
when no bind variables were present, and disabling prepared statement using
prepared_statements:false was principally broken. While bind variables were
correctly substituted with prepared_statements:false, the prepared statement
interface was still used, costing an extra two round trips per query.

In addition to making this behavioral change, I also cleaned up the internals
of exec_stmt and exec_without_stmt so that they behave the same (calling log
and constructing the ActiveRecord::Result in the same way).

Moving the check for binds.empty? to exec_query also will mean that several
code paths explicitly calling exec_without_stmt could be cleaned up to once
again call exec_query instead. I have also left the check for binds.empty? in
exec_stmt, since it is not a private method and could be called directly with
an empty binds array. For the sake of clarity in this patch, I have not made
those changes.

= The previous behavior =

When issuing a Foo.find(1) with prepared_statements:true, the bind variable
is present in the prepared query, and execute shows a value passed:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

When issuing a Foo.find(1) with prepared_statements:false, the bind variable
has already been removed and substituted with the value, but the prepared
statement interface is used anyway:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

= With this patch applied =

When issuing a Foo.find(1) with prepared_statements:true, the bind variable
is present in the prepared query, and execute shows a value passed:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Prepare	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = ? LIMIT 1
    Execute	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Close stmt
    Quit

When issuing a Foo.find(1) with prepared_statements:false, the bind variable
has been removed and substituted with the value, and the query interface is
used instead of the prepared statement interface:

    Connect	root@localhost on rails_test
    Query	SET SQL_AUTO_IS_NULL=0
    Statistics
    Query	SHOW FULL FIELDS FROM `foos`
    Query	SHOW TABLES LIKE 'foos'
    Query	SHOW CREATE TABLE `foos`
    Query	SELECT  `foos`.* FROM `foos`  WHERE `foos`.`id` = 1 LIMIT 1
    Quit
2012-07-13 09:42:48 -07:00
Piotr Sarnacki
e72d876887 Merge pull request #7031 from robbkidd/rename_sequences_too_backport_to_3-2
Back-port #6874 to 3.2: psql adapter should rename a default pk sequence during rename_table
2012-07-11 02:40:22 -07:00
Robb Kidd
8d3eafe790 Update psql adapter to rename a default pkey sequence during rename_table. 2012-07-10 21:37:38 -04:00
Rafael Mendonça França
3b1de4a29c Merge pull request #7025 from rustygeldmacher/select_options_valid_html
Select options valid html
2012-07-10 13:17:28 -07:00
Rusty Geldmacher
27c8debdc6 Fixed bug creating invalid HTML in select options
When a select tag is created for a field with errors, and that select
tag has :prompt or :include_blank options, then the inserted first
option will errantly have a <div class="field_with_errors"> wrapping
it.

See https://github.com/rails/rails/issues/7017
2012-07-10 12:14:06 -04:00
Xavier Noria
45d78a3dd1 Merge pull request #7015 from sikachu/3-2-stable-code-style
Update coding convention from master
2012-07-09 09:38:03 -07:00
Prem Sichanugrist
904eacea31 Update coding convention from master 2012-07-09 12:33:33 -04:00
Rafael Mendonça França
7adc4f20cc Merge pull request #6985 from sidonath/disable-query-cache-for-locks
Disable query cache for lock queries
Conflicts:
	activerecord/lib/active_record/connection_adapters/abstract/query_cache.rb
2012-07-06 18:15:31 -03:00
José Valim
03dcdc317d Since Rails 3.2, use layout false to render no layout 2012-07-06 13:59:52 +03:00
Rafael Mendonça França
c7afc42b2f Merge pull request #6973 from route/wrapped_keys_in_log_for_3_2
MIssed backport for 3.2
2012-07-05 04:58:13 -07:00
Dmitry Vorotilin
ffdca21e44 Show in log correct wrapped keys 2012-07-05 15:47:04 +04:00
Mark J. Titorenko
7faa620fd6 Fix NumberHelper options wrapping to prevent verbatim blocks being rendered instead of line continuations. While I'm at it, wrap long comment lines consistently.
Conflicts:
	actionpack/lib/action_view/helpers/number_helper.rb

There was just one conflict related to the addition of the :format
option to number_to_percentage.
2012-07-02 23:22:52 -03:00
Rafael Mendonça França
dacc947296 Merge pull request #6935 from frodsan/b1e509ad7a8c8264544f10f4666705cd806b5408
Backport #3329 to 3-2-stable
2012-07-02 10:15:07 -07:00
Francesco Rodriguez
b1e509ad7a Backport #3329 to 3-2-stable
Fix bug with autosave collection association on new record with a marked
for destroy record in autosave collection.

Fixes #6918.
2012-07-02 11:57:10 -05:00
Xavier Noria
9e0b3fc7cf make sure the inflection rules are loaded when cherry-picking active_support/core_ext/string/inflections.rb [fixes #6884] 2012-06-29 21:31:09 +02:00
Rafael Mendonça França
48601c27b7 Merge pull request #6878 from masarakki/master
fix bug in limit of enum columns of mysql

Closes #6432
2012-06-28 17:24:09 -03:00
Carlos Antonio da Silva
10e5685775 Merge pull request #6900 from cbandy/issue-6898
Require URI in ConnectionSpecification
Conflicts:
	activerecord/lib/active_record/connection_adapters/connection_specification.rb
2012-06-28 15:59:45 -03:00
Carlos Antonio da Silva
3fccf6af7d Merge pull request #6857 from rsutphin/as_core_ext_time_missing_require
Missing require breaks Time.=== when selectively loading ActiveSupport core_exts in 3.2.4+
2012-06-25 19:24:26 -03:00
Carlos Antonio da Silva
f8f4ac9120 Ensure Arel columns are typecasted properly when grouping with calculation
Fix build issue with postgresql.

Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
	activerecord/test/cases/calculations_test.rb
2012-06-25 18:35:53 -03:00
Rafael Mendonça França
12ac977079 Merge pull request #6842 from ernie/handle-non-strings-in-grouped-calculations
Stop assuming strings for grouped calculations
Conflicts:
	activerecord/lib/active_record/relation/calculations.rb
2012-06-24 10:47:17 -03:00
Rafael Mendonça França
200e6a6332 Remove waning of unused variable 2012-06-21 11:24:00 -03:00
Rafael Mendonça França
40617c7e53 Merge branch 'acapilleri-update_nested_attributes'
Closes #6675

Conflicts:
	activerecord/lib/active_record/attribute_methods/dirty.rb
2012-06-21 11:03:06 -03:00
José Valim
94489a2570 Merge pull request #6758 from caironoleto/master
Fixing load config in some tasks
Conflicts:
	activerecord/lib/active_record/railties/databases.rake
2012-06-18 23:09:20 -03:00
Carlos Antonio da Silva
2363aafca4 Merge pull request #6649 from route/logger_in_metal_3_2
Logger in metal backport for 3.2
2012-06-18 17:03:08 -07:00
Rafael Mendonça França
ffcecf2fb2 Merge pull request #6742 from steveklabnik/deprecate_composed_of
Deprecate composed of
2012-06-18 12:39:42 -07:00
Steve Klabnik
44b313bc4e Deprecating composed_of in ActiveRecord
This feature adds a lot of complication to ActiveRecord for dubious
value. Let's talk about what it does currently:

class Customer < ActiveRecord::Base
  composed_of :balance, :class_name => "Money", :mapping => %w(balance
amount)
end

Instead, you can do something like this:

    def balance
      @balance ||= Money.new(value, currency)
    end

    def balance=(balance)
      self[:value] = balance.value
      self[:currency] = balance.currency
      @balance = balance
    end

Since that's fairly easy code to write, and doesn't need anything
extra from the framework, if you use composed_of today, you'll
have to add accessors/mutators like that.

This feature will be removed in Rails 4.
2012-06-18 15:38:51 -04:00
José Valim
83451beb1a Use strict_args_position! if available from Thor 2012-06-18 16:32:18 +03:00
Rafael Mendonça França
284ebf2a1c Merge pull request #6764 from frodsan/patch-4
bump AS deprecation_horizon to 4.0
2012-06-17 21:40:34 -07:00
Francesco Rodríguez
a556c7e25b bump AS deprecation_horizon to 4.0 2012-06-17 23:19:18 -05:00
Rafael Mendonça França
ed93c86c5d Merge pull request #6756 from arunagw/build_fix_ap
Build fix actionpack
2012-06-16 12:08:01 -07:00
Arun Agrawal
909a4a563e It should also include text/css => Build Fix 2012-06-16 15:05:49 -04:00
Rafael Mendonça França
52d09638df Merge pull request #6752 from steveklabnik/fix_5680
Respect absolute paths in compute_source_path.
2012-06-16 13:10:45 -03:00
Dmitry Vorotilin
4717c2ffc6 Added test for case when view doesn't have logger method when using ActionController::Metal controller. 2012-06-16 00:56:03 +04:00
Dmitry Vorotilin
3b1ea3d896 ActionController::Metal doesn't have logger method, check it and then delegate 2012-06-16 00:55:46 +04:00
Rafael Mendonça França
a8e22aeadc Remove unneded tests.
Before b081f6b59f, this test are
asserting that update_attribute does the dirty tracking. Since we
deprecated this method and update_column write in the database directly
this tests will always fail.
2012-06-14 20:26:45 -03:00
Xavier Noria
2109fd5804 registers the deprecation of update_attribute in the CHANGELOG 2012-06-14 23:26:06 +02:00
Xavier Noria
63bcfbb238 Merge pull request #6739 from steveklabnik/3-2-stable
Deprecate update_attribute
2012-06-14 14:18:25 -07:00
Steve Klabnik
b081f6b59f Deprecate update_attribute.
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being deprecated in favor of
update_column, and will be removed in Rails 4.

See the discussion on rails-core here:
https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
2012-06-14 23:14:40 +02:00
Aaron Patterson
e7d1849be1 adding a test for #6459 2012-06-14 14:12:14 -07:00
Santiago Pastorino
7f93791457 ActionController::Caching depends on RackDelegation and AbstractController::Callbacks 2012-06-13 16:18:55 -03:00
Rafael Mendonça França
966371adec Merge pull request #6716 from frodsan/patch-2
Fix Build
2012-06-12 15:18:56 -07:00
Francesco Rodríguez
eed1cfe058 Fix build 2012-06-12 17:10:10 -05:00
Aaron Patterson
10cdbbc56b Merge branch '3-2-stable-rel' into 3-2-stable
* 3-2-stable-rel:
  updating changelogs
  bumping version numbers
  updating changelogs with security fixes
  updating changelogs
  Array parameters should not contain nil values.
  Additional fix for CVE-2012-2661
2012-06-12 14:25:27 -07:00
Aaron Patterson
8381d398ce updating changelogs 2012-06-12 14:02:40 -07:00
Rafael Mendonça França
5dd2cfc8b4 Merge pull request #6715 from arunagw/add_asserts
Need a assert here in tests
2012-06-12 15:48:46 -03:00
Rafael Mendonça França
32709ea41e Merge pull request #6676 from aurelian/master
Don't assign the attributes if the list is empty
2012-06-12 14:47:52 -03:00
Rafael Mendonça França
6522a127e5 Merge pull request #6682 from acapilleri/dup_validation_fix_backport_for_1_9_3
Dup validation fix backport for 1 9 3
2012-06-12 10:21:52 -07:00
Angelo capilleri
b97e0a1127 Fix the the backport of the object dup with the ruby 1.9.3p194.
At the end of initialize_dup was added the call to super if it exists,
so it also works with 1.8.7 where initialize_dup doesn't exist.
This issu was introduced with the pull request #6324
2012-06-12 18:04:44 +02:00
Aaron Patterson
ee4209a31e bumping version numbers 2012-06-11 15:40:36 -07:00
Aaron Patterson
ceb8ec3eff updating changelogs with security fixes 2012-06-11 15:39:59 -07:00
Aaron Patterson
301974a44a updating changelogs 2012-06-11 15:32:24 -07:00
Aaron Patterson
38edea0c91 Array parameters should not contain nil values. 2012-06-11 14:00:05 -07:00
Ernie Miller
cc2903da9f Additional fix for CVE-2012-2661
While the patched PredicateBuilder in 3.1.5 prevents a user
from specifying a table name using the `table.column` format,
it doesn't protect against the nesting of hashes changing the
table context in the next call to build_from_hash. This fix
covers this case as well.
2012-06-11 14:00:05 -07:00
kennyj
0ccdeeb6b5 Change the string to use in test case.
Conflicts:

	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
	activerecord/test/cases/adapters/mysql2/schema_test.rb
2012-06-11 11:00:29 -07:00
kennyj
22994b2d63 Fix GH #3163. Should quote database on mysql/mysql2.
Conflicts:

	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
2012-06-11 11:00:29 -07:00
Rafael Mendonça França
0391ae9a14 Merge pull request #6690 from suginoy/fix-templates-copy
Fix: 'rake rails:templates:copy' doesn't work
Conflicts:
	railties/test/application/rake_test.rb
2012-06-11 14:43:09 -03:00
Rafael Mendonça França
c9f27e3a47 Merge pull request #6698 from yahonda/address_ora_911_master
Address ORA-00911 errors because of the heading underscore.
2012-06-11 00:10:55 -03:00
Rafael Mendonça França
bbec883edb Merge pull request #6521 from Empact/throw-result
Fix that #exists? can blow up with ThrowResult exception
Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
2012-06-10 22:05:38 -03:00
Rafael Mendonça França
9e6eb8b648 Remove warning 2012-06-10 17:22:06 -03:00
Rafael Mendonça França
179276e2b6 Add test to column alias in exists? SQL.
This behavior was added in dd286a4c73

Closes #1139.

Fixes #2553, #1141, #1623 and #2062.
2012-06-10 17:05:01 -03:00
iaddict
dd286a4c73 Minimal change to query generation of exists? that makes SQLServer and others happy that do not work without a column alias.
Conflicts:
	activerecord/lib/active_record/relation/finder_methods.rb
2012-06-10 17:00:55 -03:00
Rafael Mendonça França
35c89a4803 Merge pull request #6688 from c42engineering/buffered_logger_level_while_creation
BufferedLogger level while creation
2012-06-10 12:08:38 -07:00
Rafael Mendonça França
5dfb01e25b Merge pull request #6695 from kennyj/fix_6635
Fix #6635. We should call Scoping methods, before calling Array methods.
2012-06-10 15:30:25 -03:00
José Valim
6cc941dedb Merge pull request #6693 from jkraemer/3-2-stable
Bugfix: Namespace collision with test-unit-activesupport 1.0.0
2012-06-10 02:39:27 -07:00
Jens Kraemer
e66c240a8f fix namespace collision with test-unit-activesupport 2012-06-10 11:22:56 +02:00
José Valim
eaeebc2884 Merge pull request #6687 from tiegz/3-2-optimizations
ActiveRecord#attributes optimization: minimize objects created
2012-06-09 03:24:41 -07:00
Andrew White
6900a4ec3e Merge pull request #6689 from arunagw/duplicate_test_removed
Duplicate test removed
2012-06-09 00:14:37 -07:00
Arun Agrawal
f36fd0e09c Duplicate tests removed. 2012-06-09 12:28:00 +05:30
Niranjan Paranjape
01f8f29dc9 buffered logger is initialized with the log level passed trough the initializer 2012-06-09 12:23:18 +05:30
Tieg Zaharia
6e4a064256 ActiveRecord#attributes optimization: minimize objects created 2012-06-09 00:42:55 -04:00
Piotr Sarnacki
8475cddc98 Don't add sqlite3 to gemspec with -O on rails plugin new
(closes #6672)
2012-06-08 19:56:46 +02:00
Rafael Mendonça França
0e4d16f78f Merge pull request #6678 from arunagw/fix_issue_6673
Fix issue 6673
2012-06-08 09:44:36 -07:00
Rafael Mendonça França
dfb1ebe63d Merge pull request #6677 from arunagw/3-2-stable
Removed protected as we already doing it above.
2012-06-08 06:20:09 -07:00
Arun Agrawal
8b1d475f96 We should not include engine.rake file into rake
if we are passing -T which is skip_test_unit

See issue #6673 for more details.

I saw that we are not creating dummy app even if 
we do skip_test_unit. 

Fixes #6673
2012-06-08 18:30:18 +05:30
Arun Agrawal
7ad5f8b4b9 Removed protected as we already doing it above. 2012-06-08 17:46:15 +05:30
Piotr Sarnacki
fa352c46da Fix railties test suite
Apparently asset_environment should not be invoked if it's not needed.
This fixes broken build by getting back to the code more similar to the
version changed here: 5b0a891
2012-06-08 00:15:52 +02:00
Piotr Sarnacki
5b0a8916ea Fix asset tags for files with more than one dot
After the fix done in 39f9f02a, there are cases that will not work
correctly. If you have file with "2 extensions", like foo.min.js and you
reference the file without extension, like:

    javascript_include_tag "foo.min"

it will fail because sprockets finds foo.min.js with foo.min argument.

This commit fixes this case and will get the right file even when
referrencing it without extension.

(closes #6598)
2012-06-07 21:48:24 +02:00
Jon Leighton
68d3e1f42f Make test cover previous reversion 2012-06-07 20:45:23 +01:00
Jon Leighton
959fb8ea65 Revert "Perf: Don't load the association for #delete_all."
This reverts commit b98d1e2163.

Closes #6609

Conflicts:

	activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
2012-06-07 20:02:49 +01:00
José Valim
6b6c1de9f9 Merge pull request #6642 from kuroda/3-2-activemodel-translation-patch
Fix human attribute_name to handle deeply nested attributes
2012-06-06 00:18:59 -07:00
Tsutomu Kuroda
029936efbe Fix human attribute_name to handle deeply nested attributes
This is a back-port of b0e2fc84 to Rails 3.2.
See #5843 and #3859 also.
2012-06-06 12:50:09 +09:00
Rafael Mendonça França
3cba6eee66 Revert "fix the Flash middleware loading the session on every request (very dangerous especially with Rack::Cache), it should only be loaded when the flash method is called"
This reverts commits e3069c64b2 and 2b2983d76f.

Reason: This add a non-backward compatible change in the way that flash
works now (swept in every request).
2012-06-05 16:05:55 -03:00
Rafael Mendonça França
f7cde3eb22 Add test to flash sweep after two redirects
This test is needed to avoid regressions in the way that flash works
now (swept in every request).
2012-06-05 16:05:49 -03:00
Rafael Mendonça França
6347554109 Merge pull request #6613 from carlosgaldino/3-2-data-confirm
Deprecate `:confirm` in favor of `:data => { :confirm => 'Text' }` option
2012-06-05 11:42:19 -07:00
Carlos Galdino
fc092a9cba Deprecate :confirm in favor of :data => { :confirm => 'Text' } option
This deprecation applies to:
`button_to`
`button_tag`
`image_submit_tag`
`link_to`
`submit_tag`

As :confirm is an UI specific option is better to use the data attributes,
teaching users about unobtrusive JavaScript and how Rails works with it.
2012-06-05 15:34:30 -03:00
Rafael Mendonça França
9f52d1526c Merge pull request #6622 from kennyj/fix_6591-32
[3-2-stable back ported] Fix #6591 Rails 3.2.5 Regression: incorrect _changed? for datetimes
2012-06-04 07:00:28 -07:00
kennyj
510ef2be53 Fix #6591. If a field with timezone isn't changed, we don't call will_change!. 2012-06-04 21:12:44 +09:00
Evan Arnold
bebbdb5d4e Add failing test for 3.2.5 datetime attribute regression 2012-06-04 21:12:44 +09:00
Rafael Mendonça França
43f0af4d39 Merge pull request #6593 from yahonda/skip_test_remove_column_with_array_as_an_argument_is_deprecated
Skip test_remove_column_with_array_as_an_argument_is_deprecated with Oracle
2012-06-01 12:37:06 -07:00
Piotr Sarnacki
f550d4db96 Allow to use mounted helpers in ActionView::TestCase
Similarly to 6525002, this allows to use routes helpers for mounted
helpers, but this time in ActionView::TestCase
2012-06-01 20:58:19 +02:00
Yasuo Honda
7544c7a9f2 Skip test_remove_column_with_array_as_an_argument_is_deprecated with Oracle adapter.
Because Oracle adapter supports only remove_column :table_name, :column_name syntax
and it has never supported remove_column :table_name, [:column_name].
2012-06-02 02:08:43 +09:00
José Valim
5b6b0df8c5 Merge pull request #6588 from nbibler/polymorphic_to_model
Correct the use of to_model in polymorphic routing
2012-06-01 07:40:41 -07:00
Nathaniel Bibler
537ede9128 Use to_model delegates for polymorphic route generation 2012-06-01 10:38:30 -04:00
Rafael Mendonça França
b13d89ea9e Add release date of 3.2.5 on the CHANGELOG 2012-06-01 11:32:36 -03:00
Piotr Sarnacki
8d4f63a1a5 Include routes.mounted_helpers into integration tests
In integration tests, you might want to use helpers from engines that
you mounted in your application. It's not hard to add it by yourself,
but it's unneeded boilerplate. mounted_helpers are now included by
default. That means that given engine mounted like:

    mount Foo::Engine => "/foo", :as => "foo"

you will be able to use paths from this engine in tests this way:

    foo.root_path #=> "/foo"

(closes #6573)
2012-06-01 16:28:43 +02:00
Rafael Mendonça França
ecd1722235 Merge pull request #6587 from amatsuda/controller_generator_remove_blank_line_32
Backporting #6586 patch to 3-2-stable
2012-06-01 07:20:31 -07:00
Akira Matsuda
8984bc2b7b remove unneeded blank line from !namespeced? controller generators 2012-06-01 23:13:08 +09:00
Aaron Patterson
b57fa0bf69 bumping to 3.2.5 2012-05-31 20:38:03 -07:00
Andrew White
7056079761 Restore behavior of Active Record 3.2.3 scopes
A series of commits relating to preloading and scopes caused a regression.
Cloning the relation calls initialize_copy which resets a number of instance
variables to nil. Without this the scope thinks that it is already loaded
when it is called again.

Reverts the following commits:
13f1401a6c
8491740ca5
dffbb521a0

Fixes #6575, #6576 & #6577
2012-06-01 03:03:50 +01:00
Aaron Patterson
4df9680714 Merge branch '3-2-rel' into 3-2-stable
* 3-2-rel:
  bumping to 3.2.4
  adding security notifications to CHANGELOGs
  updating changelogs
  Merge pull request #6558 from parndt/fix_regression
2012-05-31 11:26:44 -07:00
Aaron Patterson
d66fd08175 Merge branch '3-2-stable-sec' into 3-2-stable
* 3-2-stable-sec:
  Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
  predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
  bumping to 3.2.4.rc1
2012-05-31 11:25:54 -07:00
Aaron Patterson
febd65223e bumping to 3.2.4 2012-05-31 10:27:47 -07:00
Aaron Patterson
44aca7b295 adding security notifications to CHANGELOGs 2012-05-31 10:23:39 -07:00
Aaron Patterson
71827489e9 Merge branch '3-2-stable-sec' into 3-2-rel
* 3-2-stable-sec:
  Strip [nil] from parameters hash. Thanks to Ben Murphy for reporting this!
  predicate builder should not recurse for determining where columns. Thanks to Ben Murphy for reporting this
2012-05-31 10:19:41 -07:00
Aaron Patterson
d3e5d1c295 updating changelogs 2012-05-31 10:19:29 -07:00
Rafael Mendonça França
f8f6ad6ebc Merge pull request #6562 from martinoconnor/generator-fix-stable
3-2-stable Changed symbol platform to platforms for the commented out call to gem 'therubyracer'.
2012-05-30 18:58:59 -07:00
Martin O'Connor
9bbdceb34d Changed symbol platform to platforms for the commented out call to gem 'therubyracer'.
Dependency.rb expects the symbol to be named :platforms as opposed to platform. RubyMine's inspections indicate that the symbol should be named :platforms.
Updating tests.
2012-05-30 21:56:09 -04:00
Aaron Patterson
ac465d5dd2 Merge pull request #6558 from parndt/fix_regression
Fix regression
2012-05-30 17:27:34 -07:00
Aaron Patterson
4c8805d60e Merge pull request #6558 from parndt/fix_regression
Fix regression
2012-05-30 17:26:15 -07:00
Philip Arndt
4ce7f98c3b Revert "Removes unneeded caching from ActiveRecord::Base.relation"
This reverts commit ebfa58abc8.

This change caused a regression in my application's tests:

* Failing build http://travis-ci.org/#!/resolve/refinerycms/builds/1461242

Broken tests pass after this change is reverted.
2012-05-31 12:22:54 +12:00
Aaron Patterson
dff6db1884 Strip [nil] from parameters hash.
Thanks to Ben Murphy for reporting this!

CVE-2012-2660
2012-05-30 15:13:42 -07:00
Aaron Patterson
71f7917c55 predicate builder should not recurse for determining where columns.
Thanks to Ben Murphy for reporting this

CVE-2012-2661
2012-05-30 15:04:11 -07:00
Rafael Mendonça França
b6727a1ed3 Merge pull request #6477 from steveklabnik/close_discovered_pg_connection
Properly discover a connection is closed in postgresql_adapter
2012-05-30 17:44:49 -03:00
Piotr Sarnacki
9f1b689cd9 Merge pull request #6553 from erichmenge/3-2-stable-json-patch
3 2 stable json patch
2012-05-30 13:06:50 -07:00
Erich Menge
bcfa013399 Deprecate ActiveSupport::JSON::Variable 2012-05-30 14:32:24 -05:00
Aaron Patterson
c470001891 Merge pull request #5810 from kennyj/fix_5797
Fix #5797. Error calling dup method on AR model with serialized field
Conflicts:
	activerecord/lib/active_record/core.rb
2012-05-30 15:50:24 -03:00
Erich Menge
624f801d27 True, False, and Nil should be represented in as_json as themselves.
Conflicts:

	activesupport/lib/active_support/json/encoding.rb
	activesupport/test/json/encoding_test.rb
2012-05-30 10:24:23 -05:00
Carlos Antonio da Silva
f09ae8538f Merge pull request #6519 from oscardelben/3-2-stable
Display annotations in coffee files
2012-05-29 20:54:57 -07:00
Oscar Del Ben
2f71d4063f Remove irrelevant assertion 2012-05-29 20:41:32 -07:00
Rafael Mendonça França
12e5c727ae Merge pull request #6531 from freerange/3-2-stable-minitest-passthrough-exceptions
Exceptions like Interrupt should not be rescued in tests.
2012-05-29 03:56:34 -07:00
James Mead
0813b45127 Exceptions like Interrupt should not be rescued in tests.
This is a back-port of rails/rails#6525. See the commit notes there for
details.
2012-05-29 11:14:50 +01:00
Aaron Patterson
fe4dfdd644 bumping to 3.2.4.rc1 2012-05-28 11:58:15 -07:00
Bartlomiej Kozal
4ababde21f Display annotations from .coffee files in rake notes 2012-05-28 09:41:57 -07:00
Piotr Sarnacki
0e69705b0f Fix railties_order when application object is passed
railites_order method, introduced in 40b19e0, had a bug that was causing
loading application instance twice in initializers if railties_order
already included application instance. So for example

    railties_order = [Foo::Engine, :main_app, Bar::Engine]

would result in such railties array:

    [MyApp::Application, Foo::Engine, MyAppApplication, Bar::Engine]

In order to fix it, we need to check for existence of application in
both railties_order and railties arrays.
2012-05-27 14:13:45 +02:00
José Valim
81ad94e0ac Merge pull request #6494 from pwim/no-memcache-require
memcache require not needed for cache store
2012-05-27 00:30:19 -07:00
Brian Durand
ba6d9350d9 remove unnecessary memcache equire in ActionDispatch::Session::CacheStore 2012-05-26 10:14:45 +09:00
Rafael Mendonça França
c90f3de6d3 Merge pull request #5244 from fotos/myqsl2_wait_timeout
Maximum wait_timeout on Windows is 2147483
2012-05-25 14:13:29 -03:00
Carlos Antonio da Silva
a9af9f10cb Merge pull request #5925 from Juanmcuello/pg_structure_dump
Quote arguments in db:structure:dump for PostgreSQL.
2012-05-24 15:12:11 -07:00
Aaron Patterson
356f2a6d8b Merge pull request #6467 from aselder/3-2-stable
Synchronize the body of the ConnectionPool#release method to improve thread safety.
2012-05-23 13:23:59 -07:00
Andrew Selder
e663aa39aa Synchronize the ConnectionPool#release method to avoid thread safety issues [#6464]
Fixes #6464

Synchronize the contents of the release method in ConnectionPool due to
errors when running in high concurrency environments.

    Detected invalid hash contents due to unsynchronized modifications
with concurrent users
    org/jruby/RubyHash.java:1356:in `keys'
/usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:294:in
`release'

/usr/local/rvm/gems/jruby-1.6.7@new_import/gems/activerecord-3.2.3/lib/a
ctive_record/connection_adapters/abstract/connection_pool.rb:282:in
`checkin'
2012-05-23 11:08:41 -07:00
Juan M. Cuello
587de84258 Use Shellwords to scape arguments in db:structure:dump for PostgreSQL.
fixes #5913
2012-05-22 23:49:35 -03:00
Rafael Mendonça França
ff3cddf876 Merge pull request #6451 from chancancode/3-2-stable_restore_frozen_state_on_rollback
Fixes the build break caused by 9ee8528 in #6445.
2012-05-22 15:35:23 -07:00
Godfrey Chan
d3715f6573 Fixes the build break caused by 9ee8528 in #6445.
Ruby 1.8 raises a TypeError when trying to modify a frozen Hash, while
Ruby 1.9 raises a RuntimeError instead. Also, Ruby < 1.9.3 uses a
lowercase 'hash' in the exception message while Ruby >= 1.9.3 uses an
uppercase 'Hash' instead. This commit normalizes those issues in the
test case.
2012-05-22 14:23:27 -07:00
Rafael Mendonça França
9ee85281bc Merge pull request #6445 from chancancode/3-2-stable_restore_frozen_state_on_rollback
Restore the frozen state on rollback. (Backports #6420)
2012-05-22 12:15:06 -07:00
Godfrey Chan
a5430024fd Restore the frozen state on rollback. Fixes #6417.
This is a 3-2-stable backport for #6420 which was merged into master.

Currently, when saving a frozen record, an exception would be thrown
which causes a rollback. However, there is a bug in active record that
"defrost" the record as a side effect:

    >> t = Topic.new
    => #<Topic id: nil, ...>
    >> t.freeze
    => #<Topic id: nil, ...>
    >> t.save
    RuntimeError: can't modify a frozen Hash
    >> t.frozen?
    => false
    >> t.save
    => true

This patch fixes the bug by explictly restoring the frozen state on the
attributes Hash after every rollback.
2012-05-22 12:08:51 -07:00
Piotr Sarnacki
56b86a377a Use require_dependency in generated controllers
Using require in development mode will prevent required files from
reloading, even if they're changed. In order to keep namespaced
application_controller reloadable, we need to use require_dependency
instead of require.
2012-05-22 01:47:08 -07:00
Aaron Patterson
5d6cca1d64 Merge pull request #6418 from pwnall/pgsql_bytea_limit3
Postgresql doesn't accept limits on binary (bytea) columns (for 3-2-stable)
2012-05-21 09:58:46 -07:00
Carlos Antonio da Silva
f051071c00 Merge pull request #6423 from lest/patch-2
assets: don't add extension if other given and file exists
2012-05-21 06:02:56 -07:00
Sergey Nartimov
39f9f02ab0 Assets: don't add extension if other given and file exists
We should lookup if asset without appended extension exists.
When sprockets are disabled the asset tag helpers incorporate
this logic. When sprockets are enabled we should have the same
logic.

For example, we have style.ext file in app/assets/stylesheets and
we use stylesheet_link_tag in the layout. In this case we should
have /assets/style.ext instead of /assets/style.ext.css in the
output.

Closes #6310
2012-05-21 15:47:12 +03:00
Victor Costan
36fdb728c6 Postgresql doesn't accept limits on binary (bytea) columns. 2012-05-21 03:21:32 -04:00
Piotr Sarnacki
64e12ff109 More info on commit messages in contributing guide
Add more info on how to write a good commit messages along with
example showing nicely formatted commit message.

Rails git history does not look too well when you try to figure out why
particular changes were introduced. We can do much better than that and
it's never too late to start.
2012-05-21 00:07:34 -07:00
Piotr Sarnacki
b0f8355d28 Fix generators to help with ambiguous ApplicationController issue
In development mode, dependencies are loaded dynamically at runtime,
using `const_missing`. Because of that, when one of the constants is
already loaded and `const_missing` is not triggered, user can end up
with unexpected results.

Given such file in an Engine:

```ruby
module Blog
  class PostsController < ApplicationController
  end
end
```

If you load it first, before loading any application files, it will
correctly load `Blog::ApplicationController`, because second line will
hit `const_missing`. However if you load `ApplicationController` first,
the constant will be loaded already, `const_missing` hook will not be
fired and in result `PostsController` will inherit from
`ApplicationController` instead of `Blog::ApplicationController`.

Since it can't be fixed in `AS::Dependencies`, the easiest fix is to
just explicitly load application controller.

closes #6413
2012-05-20 17:04:30 -07:00
Rafael Mendonça França
68a454c2af Merge pull request #6410 from Bodacious/tag_helper_data_fix_3-2-stable
TagHelper creates invalid data attributes when value is a BigDecimal
2012-05-20 14:02:50 -07:00
José Valim
fe9731ee67 Merge pull request #6407 from pinetops/565c1b0a0772ac6cf91c77e9285806f7b028614c
Template concurrency fixes
2012-05-20 14:01:52 -07:00
Bodacious
39b9c943b7 Fixed tag_helper data-attribute bug with BigDecimals 2012-05-20 20:42:16 +01:00
Tom Clarke
565c1b0a07 Prevent concurrent compilation of templates - closes #6400 2012-05-20 12:42:30 -04:00
Piotr Sarnacki
6ef9fda1a3 Improve docs for try by adding note on BasicObject
[ci skip] closes #5790
2012-05-20 00:30:58 -07:00
Piotr Sarnacki
0d73d6e7b6 Fix uniqueness validator with allow_nil: false also for mysql
MySQL's adapter was changing value for case sensitive comparison. We
don't need to do it for `nil`.
2012-05-19 23:55:11 -07:00
Piotr Sarnacki
f7d01ecf75 Fix validates_uniqueness_off :field, :allow_nil => false
Closes (#5853)

Uniqueness validator was not properly checking if there are any existing
records, when value was `nil` and column was text type. `nil` was
converted to string, which resulted in queries looking like:

```sql
SELECT 1 FROM "posts" WHERE "posts"."title" = '' LIMIT 1
```

instead of

```sql
SELECT 1 FROM "posts" WHERE "posts"."title" IS NULL LIMIT 1
```
2012-05-19 21:49:55 -07:00
Carlos Antonio da Silva
c5205041f6 Use right option for excerpt text helper in tests, fix build
`excerpt` text helper uses `:radius`, not `line_width` (that is used by
`word_wrap` helper).

Also cleanup some whitespaces.
2012-05-19 18:24:16 -03:00
Aaron Patterson
879611f50c Merge pull request #6398 from pmahoney/threadsafe-connection-pool
Synchronize read and modification of @reserved_connections
2012-05-19 11:50:47 -07:00
Piotr Sarnacki
d64164645d Ensure that CollectionAssociation#replace returns proper target
The fix commited in e2a070c was returning the `new_target`, as
a try to return whatever user replaced association with. The
problem is, the resulting association target may be ordered
differently. In such case we want to return the target that
will be later used for that association.
2012-05-19 05:20:25 -07:00
José Valim
4dd4621f5b Merge pull request #5020 from KL-7/fix-blank-image_tag-source
Render img tag with empty src if empty string is passed to image_tag.
2012-05-18 18:26:18 -03:00
Rafael Mendonça França
8ad8f61b3f Merge pull request #6390 from ernie/invalid-ruby18-syntax-in-habtm
Invalid ruby18 syntax in habtm
2012-05-18 13:47:56 -07:00
Ernie Miller
3b444eed71 Fix HABTM syntax error in Ruby 1.8.x 2012-05-18 16:35:21 -04:00
Jon Leighton
855fabca66 fix #delete_all with habtm with :delete_sql 2012-05-18 21:11:47 +01:00
Jon Leighton
b98d1e2163 Perf: Don't load the association for #delete_all.
Bug #6289

Conflicts:

	activerecord/test/cases/associations/has_many_associations_test.rb
2012-05-18 20:55:12 +01:00
Rafael Mendonça França
2802ad0f72 Merge pull request #6377 from ihid/depreciate_old_text_helper_apis
Deprecate old APIs for highlight, excerpt and word_wrap
2012-05-18 07:24:01 -07:00
Jeremy Walker
616c91db0a Deprecate old APIs for highlight, excerpt and word_wrap 2012-05-18 15:19:58 +01:00
Vijay Dev
75e8e77125 Merge pull request #6367 from frodsan/fix_validators_docs
Fix validators docs [3-2-stable]
2012-05-17 11:46:47 -07:00
Francesco Rodriguez
4bbd05c90e fix validations docs 2012-05-17 10:54:29 -05:00
Piotr Sarnacki
0f4359252f Fix CollectionAssociation#replace to return new target (closes #6231)
Conflicts:

	activerecord/test/cases/associations/has_many_associations_test.rb
2012-05-16 17:24:58 -07:00
Aaron Patterson
e3033e3b49 Merge pull request #6340 from bcardarella/patch-3
Changing the indentation level of the block comment close for Sass
2012-05-16 16:02:10 -07:00
Brian Cardarella
9f4c4f6dd0 Changing the indentation level of the block comment close for SASS
If one wants to use use SASS for application.css.sass the comment block indentation is invalid.
2012-05-15 23:00:00 -03:00
Rafael Mendonça França
8470fdb734 Merge pull request #6329 from acapilleri/backport_dup_validation_3_2
Backport dup validation 3 2
2012-05-15 12:53:01 -07:00
Angelo Capilleri
e885b18fe9 add backport for the pull request #6324 2012-05-15 21:32:10 +02:00
Carlos Antonio da Silva
2dfa8b5995 Fix indent from previous merge 2012-05-15 13:41:49 -03:00
Rafael Mendonça França
9a868a01b8 Merge pull request #6324 from acapilleri/dup_validation_3_2
Dup validation 3 2
2012-05-15 09:32:46 -07:00
Angelo capilleri
396e383286 clean the errors if an object that includes validations errors is duped,for 3-2-stable
It Fixes #5953 in 3-2-stable, it's the same pull request of #6284
2012-05-15 18:20:53 +02:00
Vijay Dev
007539d12d Merge pull request #6321 from frodsan/backport_docs
Backporting docs
2012-05-15 08:14:51 -07:00
Francesco Rodriguez
b2f73c40b8 Backporting some docs on core_ext/hash 2012-05-15 10:00:09 -05:00
Carlos Galdino + Rafael Mendonça França
e9051e20ae Deprecate :disable_with for button_tag too 2012-05-14 16:55:13 -03:00
Carlos Galdino + Rafael Mendonça França
d47d6e7eda Fix typo 2012-05-14 16:43:54 -03:00
Carlos Galdino + Rafael Mendonça França
21141e777b Deprecate :disable_with in favor of 'data-disable-with' option for button_to and submit_tag helpers. 2012-05-14 16:43:54 -03:00
Carlos Antonio da Silva
2506d4ad9e Merge pull request #6018 from lest/patch-1
mailer can be anonymous
2012-05-14 10:21:27 -03:00
José Valim
ec68258f19 Default escape_html_entities_in_json to true in new apps 2012-05-14 08:03:40 +02:00
Egor Homakov
4588684389 Update railties/lib/rails/generators/rails/app/templates/config/application.rb
Signed-off-by: José Valim <jose.valim@gmail.com>
2012-05-14 07:58:30 +02:00
Carlos Antonio da Silva
9199ddfb76 Merge pull request #6266 from alexeymuranov/remove_unused_private_method
Remove unused private method
2012-05-13 18:56:27 -07:00
Rafael Mendonça França
1aff7725c7 Deprecate :mouseover options for image_tag helper. 2012-05-13 19:49:24 -03:00
Rafael Mendonça França
9ff97b0605 Merge pull request #3237 from sakuro/data-url-scheme
Support data: url scheme
2012-05-13 19:17:28 -03:00
Carlos Antonio da Silva
e7d5ba37f0 Merge pull request #6306 from erichmenge/3-2-stable-guide-fix
3 2 stable guide fix [ci skip]
2012-05-13 13:24:42 -07:00
Santiago Pastorino
8a5b51e1e6 Merge pull request #6299 from guilleiguaran/upgrade-sprockets-3-2-stable
Upgrade sprockets to 2.1.3
2012-05-13 09:35:20 -07:00
Mikhail Dieterle
3f7ed52d3b :foreign_key option should be on has_many side of association 2012-05-13 11:20:32 -05:00
Guillermo Iguaran
62b74b1845 Upgrade sprockets to 2.1.3 2012-05-13 03:04:33 -05:00
Vijay Dev
3d0e7ad736 Merge pull request #6294 from frodsan/docs_backport
Adding examples and docs [3-2-stable]
2012-05-12 23:56:45 -07:00
Francesco Rodriguez
2f4696de6c adding examples and docs 2012-05-12 20:48:00 -05:00
Rafael Mendonça França
41e7a2ae40 Merge pull request #6292 from erichmenge/3-2-stable-docfix
3 2 stable guides fix
2012-05-12 16:14:26 -07:00
Erich Menge
ccf80c2ec4 Update 'getting started' guides for new whitelist security implementation. Closes #6286. 2012-05-12 15:45:04 -05:00
Santiago Pastorino
9cead4afbe Merge pull request #6262 from arunagw/ruby_prof_fix
Ruby prof fix
2012-05-11 08:10:16 -07:00
Alexey Muranov
5ecd14c5f1 Remove unused private method yaml_fixtures_key 2012-05-11 11:43:37 +02:00
Arun Agrawal
4b599611e4 Ruby-Prof works with ruby-1.9.3 also. 2012-05-11 09:07:06 +05:30
Arun Agrawal
9d616ea360 Update performance profiler to work with latest ruby-prof
Thanks to @carlosantoniodasilva
2012-05-11 09:07:05 +05:30
Andrew White
62f098dddf Return false for exists? with new records - fixes #6199.
(cherry picked from commit fa21b73ebb8339ad388f149c817c433b6254d490)
2012-05-10 23:22:54 +01:00
Andrew White
66e338aa98 Don't ignore nil positional arguments for url helpers - fixes #6196. 2012-05-10 22:13:04 +01:00
Andrew White
f3aaac46e6 Refactor the handling of default_url_options in integration tests
This commit improves the handling of default_url_options in integration
tests by making behave closer to how a real application operates.

Specifically the following issues have been addressed:

* Options specified in routes.rb are used (fixes #546)
* Options specified in controllers are used
* Request parameters are recalled correctly
* Tests can override default_url_options directly
2012-05-10 21:12:31 +01:00
Jeremy Kemper
a9fc8a986d Merge pull request #6230 from spectator/active_resource_exceptions
ActiveResource::TimeoutError is not loaded
2012-05-10 09:39:54 -07:00
Yury Velikanau
c2193c11ad Make sure TimeoutError is loaded. 2012-05-10 09:19:07 -07:00
Jeremy Kemper
22a60728a9 Merge pull request #6221 from alexeymuranov/deprecate__instantiate_fixtures__arity
Deprecate ActiveRecord::Fixtures.instantiate_fixtures unused parameter
2012-05-09 19:01:34 -07:00
Alexey Muranov
981055540c Remove deprecated use of ::instantiate_fixtures 2012-05-10 00:40:26 +02:00
Alexey Muranov
f02e7dc9ab Deprecate ::instantiate_fixtures unused parameter
Deprecate the use of AcitiveRecord::Fixtures::instantiate_fixtures(object, fixture_set_name, fixture_set, load_instances = true), use instead instantiate_fixtures(object, fixture_set, load_instances = true).

To be changed in master branch.
2012-05-10 00:40:26 +02:00
Santiago Pastorino
f8dae865b5 Merge pull request #6149 from jmbejar/javascript_include_tag_with_not_duplicates
Make sure that javascript_include_tag/stylesheet_link_tag methods don't consider duplicated assets
2012-05-09 12:36:20 -07:00
Piotr Sarnacki
8f5079f190 Merge pull request #6219 from frodsan/fix_build
Fix build - 3.2
2012-05-09 09:34:32 -07:00
Vijay Dev
b003ddf2ae Merge pull request #6228 from mjtko/changelog-fixes-for-3-2-stable
Updated activesupport CHANGELOG [for 3-2-stable]
2012-05-09 07:23:26 -07:00
Mark J. Titorenko
9b777d5adb Add CHANGELOG section for unreleased Rails 3.2.4; document addition of #beginning_of_hour and #end_of_hour to Time and DateTime core extensions. 2012-05-09 13:32:28 +01:00
Mark J. Titorenko
705a70fb59 Bring activesupport CHANGELOG up-to-date/consistent with master. 2012-05-09 13:31:10 +01:00
Andrew White
381f6e7c68 Merge pull request #6223 from carlosantoniodasilva/remove-columns-deprecation-ruby187
Stop showing deprecations for Ruby 1.8.7 with remove_column
2012-05-09 05:02:54 -07:00
Carlos Antonio da Silva
fa34acec20 Stop showing deprecations for Ruby 1.8.7 with remove_column
String is Enumerable in 1.8.7, which means that passing a String to
remove_column was generating deprecation warnings during tests.
2012-05-09 08:52:44 -03:00
Vijay Dev
cb242a9e48 Merge pull request #6218 from frodsan/fix_docs_32stable
Fix docs to support 1.8 syntax
2012-05-09 00:11:15 -07:00
Francesco Rodriguez
dd7e7b3719 fix attribute_accessors docs to support 1.8 syntax 2012-05-09 02:05:20 -05:00
Francesco Rodriguez
ba48e230c6 Fix build 2012-05-09 01:01:02 -05:00
Vijay Dev
5059c323b0 Merge pull request #6213 from frodsan/cut_docs_dup
Removing attribute_accessor docs duplication
2012-05-08 14:12:54 -07:00
Francesco Rodriguez
16a9a87728 removing docs duplication 2012-05-08 16:07:30 -05:00
Vijay Dev
ad4d4088c4 Merge pull request #6211 from frodsan/docs_attr_accessor_32stable
Adding docs to attribute accessor methods.
2012-05-08 13:02:30 -07:00
Francesco Rodriguez
96fe0af185 added docs to attribute_accessors methods 2012-05-08 14:20:36 -05:00
Santiago Pastorino
b12d03d66b Merge pull request #6200 from arunagw/3-2-stable
locking ruby-prof for now.
2012-05-08 09:46:15 -07:00
Arun Agrawal
764e2de6b7 locking ruby-prof until we got a fix 2012-05-08 12:32:14 +05:30
José Valim
b86e0be327 Merge pull request #6198 from whistlerbrk/3-2-stable
Address ActionPack head method not respecting explicitly set content-type #3436
2012-05-07 23:19:41 -07:00
Kunal Shah
4d52738738 If content_type is explicitly passed to the :head method use the value or fallback 2012-05-07 18:56:36 -04:00
Kunal Shah
6f38348265 Add failing test re #3436 which demonstrates content_type is not respected when using the :head method/shortcut 2012-05-07 15:23:06 -04:00
Jeremy Kemper
7fb268d8dd Merge pull request #6170 from mjtko/feature-beginning_of_hour-for-3-2-stable
Backport beginning and end of hour support for Time and DateTime to 3-2-stable
2012-05-05 00:40:44 -07:00
Piotr Sarnacki
915879ccf0 Give more detailed instructions in script/rails in engine
closes #4894
2012-05-04 23:15:48 -07:00
Aaron Patterson
80a292cbd9 Merge pull request #6128 from frodsan/delete_all_limit_32
Fix #4979 against 3-2-stable
2012-05-04 19:00:26 -07:00
José Valim
efb054baa0 Merge pull request #4445 from nragaz/role_based_params_wrapping
specify a role for identifying accessible attributes when wrapping params
2012-05-04 12:44:34 -07:00
Mark J. Titorenko
145cc69524 added beginning_of_hour support to core_ext calculations for Time and DateTime 2012-05-04 20:27:32 +01:00
Vijay Dev
5384bdb855 Merge pull request #6158 from Dagnan/3-2-stable
improvements in "caching_with_rails" guide
2012-05-04 10:39:08 -07:00
kucaahbe
b4ae94fb83 improvements in "caching_with_rails" guide - backported from docrails
Conflicts:

	railties/guides/source/caching_with_rails.textile
2012-05-04 19:19:17 +02:00
Nick Ragaz
bfb25f9cae Add a role option to wrap_parameters.
The role option identifies which parameters are accessible and should be wrapped. The default role is :default.
2012-05-04 10:14:14 -04:00
Jorge Bejar
0621ecb20b Make sure that javascript_include_tag/stylesheet_link_tag methods in
sprockets/helpers/rails_helper.rb discard duplicated assets
2012-05-03 19:07:03 -03:00
Andrew White
7c7fb3a862 Reset the request parameters after a constraints check
A callable object passed as a constraint for a route may access the request
parameters as part of its check. This causes the combined parameters hash
to be cached in the environment hash. If the constraint fails then any subsequent
access of the request parameters will be against that stale hash.

To fix this we delete the cache after every call to `matches?`. This may have a
negative performance impact if the contraint wraps a large number of routes as the
parameters hash is built by merging GET, POST and path parameters.

Fixes #2510.
(cherry picked from commit 56030506563352944fed12a6bb4793bb2462094b)
2012-05-03 00:00:19 +01:00
Francesco Rodriguez
4657dba60e Fix #4979 against 3-2-stable - delete_all raise an error if a limit is provided 2012-05-02 17:26:26 -05:00
Jeremy Kemper
ebe994f83c Merge pull request #6095 from route/assets_precompile_task
Fix that asset precompile didn't respect the index.js convention. Fixes #3993.
2012-05-02 14:13:26 -07:00
Piotr Sarnacki
02ca9151a0 Deprecate remove_column with array as an argument 2012-05-02 11:47:06 -07:00
Dmitry Vorotilin
580e767a8e Added test for assets:precompile for index files 2012-05-01 13:26:04 +04:00
Dmitry Vorotilin
df8457748e Fix #3993 assets:precompile task does not detect index files 2012-05-01 03:53:13 +04:00
Dave Gerton
5fe88b11f1 Correcting some confusion. Pago Pago is part of American Samoa, not Samoa.
Further, Samoa and Tokelau jumped across the IDL from Dec 29 to Dec 31, 2011
switching from UTC-11 to UTC+13. American Samoa did not make the change and
remains at UTC-11. Pacific/Fakaofo and Pacific/Apia are in TZInfo and
documentation about the dateline change is in austalasia at IANA.

(cherry picked from commit 1d08ce5f56e45fdee41bb16b2d8d4464bc69bf22)
2012-04-30 13:57:39 +01:00
Piotr Sarnacki
2b2983d76f Failing test for #6034 2012-04-30 00:17:35 -07:00
Will Bryant
e3069c64b2 fix the Flash middleware loading the session on every request (very dangerous especially with Rack::Cache), it should only be loaded when the flash method is called 2012-04-30 00:17:27 -07:00
Andrew White
a72fe84d00 Add note about using 303 See Other for XHR requests other than GET/POST
IE since version 6 and recently Chrome and Firefox have started following
302 redirects from XHR requests other than GET/POST using the original request
method. This can lead to DELETE requests being redirected amongst other things.

Although it doesn't directly affect the Rails framework since it doesn't return
a 302 redirect to any non-GET/POST request a note has been added to raise
awareness of the issue. Some references:

Original article from @technoweenie:
http://techno-weenie.net/2011/8/19/ie9-deletes-stuff/

Hacker News discussion of the article:
http://news.ycombinator.com/item?id=2903493

WebKit bug report:
https://bugs.webkit.org/show_bug.cgi?id=46183

Firefox bug report and changeset:
https://bugzilla.mozilla.org/show_bug.cgi?id=598304
https://hg.mozilla.org/mozilla-central/rev/9525d7e2d20d

Chrome bug report:
http://code.google.com/p/chromium/issues/detail?id=56373

HTTPbis bug report and changeset:
http://trac.tools.ietf.org/wg/httpbis/trac/ticket/160
http://trac.tools.ietf.org/wg/httpbis/trac/changeset/1428

Roy T. Fielding's history of the issue:
http://ftp.ics.uci.edu/pub/ietf/http/hypermail/1997q3/0611.html

Automated browser tests for the issue:
http://www.mnot.net/javascript/xmlhttprequest/

Fixes #4144
(cherry picked from commit 24f143789a8989f3bccde14ff28067de25cafd87)
2012-04-30 06:59:15 +01:00
Jeremy Kemper
8fec5d7657 Merge pull request #5922 from rafaelfranca/deprecate_javascript_helpers
Deprecate link_to_function and button_to_function
2012-04-29 21:45:05 -07:00
Rafael Mendonça França
3005f5834e Add release data to Rails 3.2.3 2012-04-30 01:40:24 -03:00
Rafael Mendonça França
342b54a55a Add CHANGELOG entry.
Closes #5886
Closes #3093
2012-04-30 01:40:24 -03:00
Rafael Mendonça França
9dc57fe9c4 Deprecate link_to_function and button_to_function helpers 2012-04-30 01:40:18 -03:00
Rafael Mendonça França
6b8a3a0a51 Add missing require when helpers are used in isolation 2012-04-30 01:39:11 -03:00
Andrew White
6cad407623 Restore interpolation of path option in redirect routes 2012-04-29 22:51:04 +01:00
Andrew White
4075a39453 Add missing require from b608cdd64c 2012-04-29 22:41:00 +01:00
Andrew White
b608cdd64c Escape interpolated params when redirecting - fixes #5688 2012-04-29 21:19:18 +01:00
José Valim
0df261a4d1 Merge pull request #6051 from rafaelfranca/fix_build
Fix the build
2012-04-29 09:42:53 -07:00
Rafael Mendonça França
b18603b890 Remove warning of unused variable 2012-04-29 12:33:15 -03:00
Rafael Mendonça França
a782aa5a5c Fix the build.
* The method for persisted records in 3-2-branch is 'PUT'
* size is generated by default in inputs
2012-04-29 12:32:08 -03:00
Andrew White
d6bbd337ef Don't convert params if the request isn't HTML - fixes #5341
(cherry picked from commit 7a80b69e00f68e673c6ceb5cc684aa9196ed3d9f)

Conflicts:

	actionpack/test/controller/test_test.rb
2012-04-29 10:27:17 +01:00
Piotr Sarnacki
beba8267c9 Lazy load default_form_builder if it's passed as a string
closes #3341
2012-04-28 23:02:39 -07:00
tomhuda
7dc83f7823 Allow Thor 0.15 and 1.0, to be released shortly 2012-04-28 15:57:25 -07:00
Piotr Sarnacki
86559bebf2 Merge pull request #6038 from arunagw/warning_removed_3-2-stable
Warning removed 3 2 stable
2012-04-28 12:10:57 -07:00
Oscar Del Ben
61d84e0e81 Remove circular require of time/zones 2012-04-29 00:07:39 +05:30
Aaron Patterson
434be0fd69 Merge pull request #6022 from sikachu/3-2-stable-record_tag_backport
Do not mutate options hash
2012-04-27 15:39:52 -07:00
Carlos Antonio da Silva
7006e975ac Do not mutate options hash 2012-04-27 18:34:20 -04:00
Aaron Patterson
05bee990b4 Merge pull request #4528 from j-manu/log-tailer-fix
Fix for log tailer when the log file doesn't exist.
2012-04-27 08:51:29 -07:00
Vijay Dev
006de2577a fix number_to_human docs [ci skip] 2012-04-26 15:29:14 +05:30
Jeremy Kemper
7d95b81458 Merge pull request #5971 from carlosantoniodasilva/fix-build-3-2
Add extra order clause to fix failing test on Ruby 1.8.7
2012-04-24 19:23:35 -07:00
Carlos Antonio da Silva
20f398d19f Add extra order clause to fix failing test on Ruby 1.8.7 2012-04-24 19:23:26 -03:00
Jeremy Kemper
9212083cd4 Merge pull request #5968 from sikachu/3-2-stable-backport
Backport workarounds for Mocha behavior changes.
2012-04-24 13:29:39 -07:00
kennyj
d95f3d3f73 Fix build. It seems that the Mocha's behavior were changed. 2012-04-24 15:00:36 -05:00
Santiago Pastorino
db6787af68 Merge pull request #5946 from sikachu/3-2-stable-fix-merge-conflict
Fix broken test from the earlier merge conflict
2012-04-23 16:30:38 -07:00
Prem Sichanugrist
0f3fd78953 Fix broken test from the earlier merge conflict
Seriously people, please run the test before submitting pull request.
2012-04-23 17:33:22 -05:00
Aaron Patterson
0f5af608d9 Merge pull request #5866 from tiegz/minor_fixes_3-2-stable
Catch nil.to_sym errors in partial_renderer, and raise ArgumentError instead
2012-04-23 08:24:21 -07:00
Jeremy Kemper
dd01c11f98 Merge pull request #5919 from joevandyk/rake-dsl-fix
Only include Rake::DSL if it's defined (Rake >= 0.9)
2012-04-23 06:03:18 -07:00
Vijay Dev
979e9d0a10 Merge pull request #5936 from arunagw/other_readme_fixes
Updated other README to point 3-2-stable
2012-04-23 03:33:06 -07:00
Arun Agrawal
21b1a79151 Updated other README to point 3-2-stable 2012-04-23 15:56:59 +05:30
Vijay Dev
0ed6e1367b Merge pull request #5935 from arunagw/readme_fixes_3-2-stable
As ARes is removed from master then 3-2-stable URL should be in README.
2012-04-23 03:24:48 -07:00
Arun Agrawal
210713e49d ARes URL should be pointed to 3-2-stable tree not master. 2012-04-23 15:51:18 +05:30
Jeremy Kemper
c3d50b35b0 Merge pull request #5896 from sferik/revert_5861
Revert #5861. Feature-detect which MultiJson API to use.
2012-04-21 12:15:39 -07:00
Joe Van Dyk
07b1fe5b3f Only include Rake::DSL if it's defined.
rake < 0.9 doesn't define Rake::DSL.
2012-04-21 03:10:25 -07:00
Akira Matsuda
f51557deb0 Be sure to correctly fetch PK name from MySQL even if the PK has some custom option
Backports #5900

Conflicts:

	activerecord/lib/active_record/connection_adapters/abstract_mysql_adapter.rb
	activerecord/test/cases/adapters/mysql/mysql_adapter_test.rb
2012-04-19 06:46:18 -07:00
Jeremy Kemper
b9e5c5aca3 Merge pull request #5898 from benedikt/3-2-stable
Readds the fix for #5667 and back ports the regression fix from #5718
2012-04-19 06:26:13 -07:00
Benedikt Deicke
ebfa58abc8 Removes unneeded caching from ActiveRecord::Base.relation 2012-04-19 10:07:28 +02:00
Benedikt Deicke
2c21a2f7eb Revert "Revert "Fix #5667. Preloading should ignore scoping.""
This reverts commit 1166d49f62.

Conflicts:

	activerecord/test/cases/associations/eager_test.rb
2012-04-19 10:04:24 +02:00
Benedikt Deicke
8491740ca5 Adds test to check that circular preloading does not modify Model.unscoped (as described in #5667)
Conflicts:

	activerecord/test/cases/associations/eager_test.rb
2012-04-19 10:01:32 +02:00
Benedikt Deicke
13f1401a6c Removes caching from ActiveRecord::Core::ClassMethods#relation
The #relation method gets called in four places and the return value was instantly cloned in three of them. The only place that did not clone was ActiveRecord::Scoping::Default::ClassMethods#unscoped. This introduced a bug described in #5667 and should really clone the relation, too. This means all four places would clone the relation, so it doesn't make a lot of sense caching it in the first place.

The four places with calls to relations are:

activerecord/lib/active_record/scoping/default.rb:110:in `block in build_default_scope'"
activerecord/lib/active_record/scoping/default.rb:42:in `unscoped'"
activerecord/lib/active_record/scoping/named.rb:38:in `scoped'"
activerecord/lib/active_record/scoping/named.rb:52:in `scope_attributes'"

Conflicts:

	activerecord/lib/active_record/core.rb
2012-04-19 10:00:58 +02:00
Erik Michaels-Ober
5e62670131 Use Object#respond_to? to determine which MultiJson API to use 2012-04-18 22:01:34 -07:00
Erik Michaels-Ober
e01bf0a78a Revert "multi_json is restricted to < 1.3 "
This reverts commit 9b14e3ff80.
2012-04-18 19:54:19 -07:00
Jeremy Kemper
1166d49f62 Revert "Fix #5667. Preloading should ignore scoping."
Causes a subtle regression where record.reload includes the default
scope. Hard to reproduce in isolation. Seems like the relation is
getting infected by some previous usage.

This reverts commit dffbb521a0.
2012-04-18 19:27:04 -07:00
Santiago Pastorino
39861395ff Add hook for add_resource_route 2012-04-18 17:59:03 -03:00
Aaron Patterson
476fa7aca2 Merge pull request #5894 from norman/3-2-fix-nil-logger
Fix nil logger on 3.2
2012-04-18 11:33:50 -07:00
Norman Clarke
d92166cb26 Check for nil logger 2012-04-18 14:44:32 -03:00
Jeremy Kemper
89f99e8112 Merge pull request #5874 from asanghi/3-2-stable
replace ruby-debug19 with debugger on Rails 3-2 stable
2012-04-17 07:41:16 -07:00
Aditya Sanghi
56674dbfc1 Replace ruby-debug19 which doesnt work on 1.9.3 out of the box with a more maintained debugger gem 2012-04-17 15:00:33 +05:30
Tieg Zaharia
6b8dd70083 converting some tests to assert_raises, and DRY'ing retrieve_variable changes
Conflicts:

	actionpack/test/template/render_test.rb
2012-04-16 15:37:51 -04:00
Tieg Zaharia
dcc11b2282 catch nil.to_sym errors in partial_renderer, and raise ArgumentError instead 2012-04-16 13:53:51 -04:00
Jeremy Kemper
9a97699460 Merge pull request #5861 from arunagw/multi_json_fix_3-2-stable
Restrict multi_json to >= 1.0, < 1.3 to avoid API changes in 1.3
2012-04-16 07:47:36 -07:00
Arun Agrawal
9b14e3ff80 multi_json is restricted to < 1.3
Some API changes are there above 1.3. 
3-2-stable
2012-04-16 20:15:15 +05:30
Piotr Sarnacki
a748eca6cf Add missing require in Active Support time zones (fixes #5854)
I also removed the other require as it's already present in
`activesupport/core_ext/time/calculations`
2012-04-15 23:45:59 +02:00
ask
2f9fdbfb94 "rails new -h" shows message in rails directory 2012-04-13 16:05:25 +02:00
Vijay Dev
efa9a1ff8b fix typo in readme [ci skip] 2012-04-12 21:49:32 +05:30
Prem Sichanugrist
c0e6a85a56 Fix code example in generator test case 2012-04-12 21:48:22 +05:30
Jeremy Kemper
e473e1f213 Merge pull request #5820 from arunagw/more_ruby-2-0-fixes
Update test for Ruby 2 compatibility
2012-04-12 05:57:52 -07:00
Aaron Patterson
96d81e5df4 test against ruby features in order to fix tests on Ruby 2.0 2012-04-12 17:12:52 +05:30
Jeremy Kemper
e0fd4fc9e2 Merge pull request #5800 from arunagw/bigdecimal_dup
Backport BigDecimal#duplicable? feature check from master
2012-04-10 08:41:05 -07:00
Aaron Patterson
fedd87cc05 probably should require the objects we monkey patch. 2012-04-10 21:08:53 +05:30
Aaron Patterson
2991370a40 bigdecimal can be duped on Ruby 2.0
Conflicts:

	activesupport/test/core_ext/duplicable_test.rb
2012-04-10 21:06:17 +05:30
Aaron Patterson
ca0c0a20ac add the class name to the assertion message 2012-04-10 21:05:47 +05:30
Vijay Dev
a85ffd0fc0 Merge pull request #5799 from arunagw/readme_fix
Readme fix
2012-04-10 00:55:05 -07:00
Arun Agrawal
b1c28d7105 README fix! [skip ci] 2012-04-10 13:07:23 +05:30
Xavier Noria
dab76b11f5 Merge pull request #5725 from kevmoo/remove_unused_castcode
Remove unused castcode
2012-04-09 10:05:32 -07:00
Xavier Noria
b125db84a4 rewords the section about default_url_options in the Action Controller Overview guide 2012-04-09 18:26:47 +02:00
Santiago Pastorino
e7671b5b7f Merge pull request #5784 from rafaelfranca/default_url-3-2
[3-2-stable] Document that default_url_options must return a hash with symbolized keys
2012-04-08 20:58:09 -07:00
Rafael Mendonça França
6f4f499845 Document that default_url_options must return a hash with symbolized
keys
2012-04-09 00:02:59 -03:00
Rafael Mendonça França
5c7bcfc111 default_url_options does not receive one argument anymore 2012-04-08 23:54:36 -03:00
Anil Wadghule
05d4ccffce Fix 'Everyday Git' link 2012-04-07 22:14:04 +05:30
Vijay Dev
bfd5c84085 Merge pull request #5765 from anildigital/3-2-stable
Update getting started guide to change Rails version to Rails 3.2
2012-04-06 11:31:52 -07:00
Anil Wadghule
1cd939a323 Fix Rails version in getting started guide. 2012-04-06 23:40:05 +05:30
Santiago Pastorino
56d9945e8a Merge pull request #5737 from rafaelfranca/3-2-stable
Fix tests of benchmark with silence equals to true
2012-04-04 12:16:07 -07:00
Rafael Mendonça França
1124ac00c9 Fix tests of benchmark with silence equals to true 2012-04-04 16:14:13 -03:00
Santiago Pastorino
6663dd0969 Merge pull request #5188 from jlxw/patch-1
logger.silence is deprecated
2012-04-04 14:40:44 -03:00
Aaron Patterson
c4d31028f1 Merge pull request #5727 from hone/ar_database_url_logging
ActiveRecord configuration logging
2012-04-03 20:12:30 -07:00
Terence Lee
d46ad3460a log which config format AR uses to connect with 2012-04-03 21:59:24 -05:00
Terence Lee
93f25ac6fc test initializer logic for DATABASE_URL env var 2012-04-03 21:50:18 -05:00
Kevin Moore
6f19262719 Remove unused 'cast_code' variable 2012-04-03 17:39:53 -07:00
Tim Pope
8e315b0e0a DATABASE_URL allows omission of database.yml 2012-04-03 15:57:18 -07:00
Piotr Sarnacki
515e1d33f2 Usage file in generators shouldn't be fetched only based on source_root
In case `source_roout` is not set, `default_source_root` is used,
which includes also `templates` directory. If there is no `templates`
directory, `default_source_root` is not available and USAGE will not
be displayed. USAGE should be also checked based on default
directory excluding `templates`.
2012-04-02 00:30:42 +02:00
Rafael Mendonça França
27fc6ec95e Fix the redirect when it receive blocks with arity of 1.
Closes #5677
2012-03-31 17:59:21 +02:00
Aaron Patterson
9894d16653 Merge pull request #5662 from arturopie/3-2_fixing_IM_when_using_find_select
Fixing Identity Map when using find select in rails 3.2
2012-03-30 16:45:24 -07:00
Santiago Pastorino
69465d9f7c Merge branch '3-2-3' into 3-2-stable 2012-03-30 19:34:33 -03:00
Santiago Pastorino
45d6cd94b3 Bump up to 3.2.3 2012-03-30 19:22:28 -03:00
Jon Leighton
dffbb521a0 Fix #5667. Preloading should ignore scoping.
Conflicts:

	activerecord/test/cases/associations/eager_test.rb
2012-03-30 16:24:41 +01:00
Santiago Pastorino
5c7bb86a1b Remove the leading \n added by textarea on assert_select 2012-03-30 11:45:12 -03:00
Santiago Pastorino
13fe1903d8 Remove the leading \n added by textarea on assert_select 2012-03-30 11:44:15 -03:00
Arturo Pie
6896cd4515 refactor instantiate method in base, so we remove nesting if's which make the code harder to read. Minor changes to contain_all_columns in IdentityMap.
Conflicts:

	activerecord/lib/active_record/base.rb
2012-03-29 22:39:01 -04:00
Arturo Pie
714a2c810d refactor the checking of the attributes of the record in IdentityMap#add, so it's more readable 2012-03-29 22:24:15 -04:00
Arturo Pie
2c8f84d3a6 Do not add record to identity map if the record doesn't have values for all the columns, so we don't get 'MissingAttributeError' later when trying to access other fields of the same record. 2012-03-29 22:24:02 -04:00
Arturo Pie
b29e868cc3 Adds a test that breaks IM when using #select 2012-03-29 22:23:49 -04:00
Santiago Pastorino
5284e650be Bumping to 3.2.3.rc2 2012-03-29 13:12:44 -03:00
Santiago Pastorino
b395ca1fda Add missing CHANGELOG entry 2012-03-29 11:19:26 -03:00
Santiago Pastorino
dd69076eb8 Add missing CHANGELOG entry 2012-03-29 10:55:47 -03:00
Vijay Dev
921c404268 fix incorrect url in the deprecation message for vendor/plugins [ci skip] 2012-03-29 09:22:04 -03:00
Vijay Dev
1d753ab6c8 fix incorrect url in the deprecation message for vendor/plugins [ci skip] 2012-03-29 17:40:42 +05:30
Santiago Pastorino
2b2a76087c Merge pull request #5644 from andhapp/fix-config-asset-manifest-3-2
Changed the config.assets.manifest to nil
2012-03-28 20:11:27 -07:00
Anuj Dutta
a157d59349 Changed the config.assets.manifest to nil in the comments in the production config template. 2012-03-28 23:45:41 +00:00
Santiago Pastorino
87825a6ab5 Set proper rendered_format when doing render :inline
Closes #5632
2012-03-28 18:55:14 -03:00
Santiago Pastorino
5747e53c92 Set proper rendered_format when doing render :inline
Closes #5632
2012-03-28 18:54:12 -03:00
Santiago Pastorino
f369f77471 Merge pull request #5640 from yahonda/address_ora_00918_with_oracle
Address an error for test_has_many_through_polymorphic_has_one with Oracle
2012-03-28 11:19:50 -07:00
Yasuo Honda
ef3f8093c0 Change the order argument from ('id') to ('taggings.id')
to address ORA-00918 error
2012-03-28 13:41:47 -04:00
Piotr Sarnacki
db2c1354eb Cover one more case in auth_token and remote forms
If embedding auth_token in remote forms is off and we
pass a value for auth_token it should respect it.
2012-03-28 18:10:44 +02:00
Piotr Sarnacki
d5980b5f52 Cover one more case in auth_token and remote forms
If embedding auth_token in remote forms is off and we
pass a value for auth_token it should respect it.
2012-03-28 18:09:53 +02:00
Jon Leighton
1b9fd797b3 Fix #5549. 2012-03-28 16:09:01 +01:00
Aaron Patterson
4c44ca5cb9 Test for #5549.
Cherry-picked from e96d04a2e4e244ea5053cb4e8ab97db604d0c796.

Conflicts:

	activerecord/lib/active_record/attribute_methods/read.rb
2012-03-28 15:31:32 +01:00
Santiago Pastorino
84ca8c8cd0 Merge pull request #5633 from drogus/embed-auth-token-in-remote-forms
Embed auth token in remote forms
2012-03-28 10:58:57 -03:00
Santiago Pastorino
0d052c0e39 Merge pull request #5633 from drogus/embed-auth-token-in-remote-forms
Embed auth token in remote forms
2012-03-28 06:58:17 -07:00
Piotr Sarnacki
d646d9d2e7 Added config.action_view.embed_authenticity_token_in_remote_forms
There is a regression introduced in 16ee611fa, which breaks
remote forms that should also work without javascript. This commit
introduces config option that allows to configure this behavior
defaulting to the old behavior (ie. include authenticity token
in remote forms by default)
2012-03-28 14:37:23 +02:00
Santiago Pastorino
2d5b60e982 Merge pull request #5616 from cbartlett/migration-indent
Fix indenting in migration generator
2012-03-28 00:13:48 -03:00
Michael Koziarski
f8b4ef189e Merge pull request #5624 from rafaelfranca/fix-build
Fix build
2012-03-27 20:01:17 -07:00
Rafael Mendonça França
79c8defa90 Add arel branch to the tests 2012-03-27 21:04:16 -03:00
Jeremy Kemper
460d2c7c28 Merge pull request #5622 from rafaelfranca/fix-2492-3-2
[3-2-stable] Fix label_tag to merge the options hash with the object hash
2012-03-27 16:15:21 -07:00
Rafael Mendonça França
6968bc16a1 Check if the options hash already exists and merge it with the another
hash.

Closes #2492 and #5614
2012-03-27 20:01:59 -03:00
Santiago Pastorino
4f66586bbf Merge pull request #5619 from jcoleman/textarea-newline-fix-breaks-haml
Textarea newline fix breaks haml (3-2-stable)
2012-03-27 18:17:26 -03:00
Santiago Pastorino
d82e4c80a8 Merge pull request #5619 from jcoleman/textarea-newline-fix-breaks-haml
Textarea newline fix breaks haml (3-2-stable)
2012-03-27 14:16:15 -07:00
Aaron Patterson
24208d9a86 adding a branch to arel 2012-03-27 14:11:51 -07:00
James Coleman
a7a422ec97 Don't break Haml with textarea newline fix.
See issue #393, issue #4000, issue #5190, and issue #5191. Adds a newline after the textarea opening tag based on @codykrieger's original patch so that we don't cause regressions in Haml-using apps. The regression caused textarea tags to add newlines to the field unintentionally (each update/save added an extra newline.)

Also fix 6 more tests that didn't yet have the newline expectation.
2012-03-27 17:00:39 -04:00
Piotr Sarnacki
c4048b39ff Merge pull request #5618 from lest/patch-1
force datetime attributes to be changed
2012-03-27 13:10:43 -07:00
Sergey Nartimov
fdcfc7521f force datetime attributes to be changed
backport ddb5d2f756d9d2655a07791a3b62832efd588474 to 3-2-stable
2012-03-27 22:55:50 +03:00
Santiago Pastorino
5f37260918 Bumping to 3.2.3.rc1 2012-03-27 14:07:36 -03:00
Andrey Samsonov
7111133371 Fixing issue #2492. ActionView::Base.field_error_proc doesn't call for label.
objectify_options method should be applied to the proper options arg.

See explanation and example of the bug - https://github.com/kryzhovnik/rails_field_error_proc_bug_example
2012-03-27 16:30:08 +04:00
José Valim
e31ec4700b Merge pull request #5603 from drogus/fix-rendered-format-for-render-partial
Fix rendered format for render partial
2012-03-27 00:38:31 -07:00
Piotr Sarnacki
449a4fc095 If partial is rendered in controller, grab format from template
Previously `rendered_format` was set only based on mime types
passed in Accept header, which was wrong if first type from
Accept was different than rendered partial. The fix is to simply
move setting rendered_format to the place where template
is available and grab format from the template. If it fails
we can fallback to formats passed by Accept header.
2012-03-27 05:33:47 +02:00
Aaron Patterson
3eb5be67b1 Merge pull request #2621 from icco/master
Issue with schema dump
2012-03-26 17:26:10 -07:00
José Valim
0e916ae232 Merge pull request #5597 from carlosantoniodasilva/fix-build-3-2
Fix build for branch 3-2-stable - return the same session hash object
2012-03-26 14:11:55 -07:00
Piotr Sarnacki
3f1b8c6a95 Merge pull request #5596 from lest/patch-3
apply form_for namespace option to date_select
2012-03-26 13:18:35 -07:00
Sergey Nartimov
bd8a9701c2 apply form_for namespace option to date_select 2012-03-26 21:53:10 +03:00
Abe Voelker
ed7567ca7a Fix 'Security#Mass Assignment' URL typo 2012-03-26 21:39:29 +05:30
Carlos Antonio da Silva
907bcce9a0 Return the same session data object when setting session id
Make sure to return the same hash object instead of returning a new one.
Returning a new one causes failures on cookie store tests, where it
tests for the 'Set-Cookie' header with the session signature.

This is due to the hash ordering changes on Ruby 1.8.7-p358.
2012-03-24 11:20:43 -03:00
Aaron Patterson
eb0d8ee4fd chdir before globbing so that we don't need to escape directory names.
fixes #5521
2012-03-23 11:50:00 -07:00
Aaron Patterson
0382e44080 Merge pull request #5537 from kennyj/fix_4399-32
[3-2-stable] migrate(:down) method with table_name_prefix
2012-03-23 10:50:16 -07:00
Piotr Sarnacki
ef48cea169 Merge pull request #5558 from carlosantoniodasilva/fix-build-3-2
Fix build for branch 3-2-stable - Part 2
2012-03-23 06:42:48 -07:00
Carlos Antonio da Silva
0879ebdf36 Fix identity map tests 2012-03-23 02:21:49 -03:00
Aaron Patterson
ea4e021dce Merge pull request #5557 from carlosantoniodasilva/fix-build-3-2
Fix build for branch 3-2-stable
2012-03-22 21:04:32 -07:00
Carlos Antonio da Silva
b332891b2a Add order to tests that rely on db ordering, to fix failing tests on pg
Also skip persistente tests related to UPDATE + ORDER BY for postgresql

PostgreSQL does not support updates with order by, and these tests are
failing randomly depending on the fixture loading order now.
2012-03-22 22:41:10 -03:00
José Valim
b714140f4d Merge pull request #5525 from kennyj/fix_5411
Fix GH #5411. When precompiling, params method is undefined.
2012-03-22 01:40:54 -07:00
kennyj
8c262f7591 Fix GH #5411. When precompiling, params method is undefined. 2012-03-22 13:25:37 +09:00
Piotr Sarnacki
89f88669bf Merge pull request #5542 from mhfs/port_5522_to_32stable
Port of #5522 'Fix adding/removing field's index when generating migration'
2012-03-21 18:23:19 -07:00
Marcelo Silveira
35bf748cd2 [3-2-stable] Port of #5522 'Fix adding/removing field's index when generating migration' 2012-03-21 19:43:41 -03:00
José Valim
f829515ad9 Merge pull request #5533 from mhfs/migration_blank_line_3_2
[3-2-stable] Remove blank line from generated migration
2012-03-21 00:28:38 -07:00
kennyj
565bfb9cd4 migrate(:down) method with table_name_prefix 2012-03-21 15:53:27 +09:00
Marcelo Silveira
57c6b4c0fe [3-2-stable] Remove blank line from generated migration 2012-03-20 22:07:09 -03:00
David Heinemeier Hansson
275ee0dc7b We dont need to merge in the parameters as thats all being reset by the rack headers (and its causing problems for Strong Parameters attempt of wrapping request.parameters because it will change in testing) 2012-03-20 22:16:44 +01:00
José Valim
358333f888 Merge pull request #5505 from arunagw/build_fix_1.8.7-3-2-stable
Build fix 1.8.7 3 2 stable
2012-03-18 23:50:51 -07:00
Arun Agrawal
fcc8743459 Build fix for ruby1.8.7-358 2012-03-19 11:58:55 +05:30
Mikel Lindsaar
74b782999f Increase minimum version of mail.
Second security vulnerability found in mail file delivery method
  patched in version 2.4.4.
2012-03-19 14:43:07 +11:00
José Valim
c8fbd48a26 Merge pull request #5498 from arunagw/build_fix_app_generator_test_3-2-stable
Build fix app generator test 3 2 stable
2012-03-18 09:27:21 -07:00
Arun Agrawal
9451201a3b Build fix for app_generator_test.rb 2012-03-18 21:27:23 +05:30
Piotr Sarnacki
d9355bea04 Merge pull request #5493 from kennyj/fix_5435-32
[3-2-stable] Fix GH #5435. db:structure:dump should be re-enable.
2012-03-18 02:33:33 -07:00
kennyj
f4f9ec1536 Fix GH #5435. db:structure:dump should be re-enable. 2012-03-18 14:19:30 +09:00
Piotr Sarnacki
41815f5d6c Rubyracer does not work on ruby, so add it to Gemfile with :ruby platform only 2012-03-17 23:30:28 +01:00
José Valim
c0a5b8505d Ensure load hooks can be called more than once with different contexts. 2012-03-17 17:21:02 -03:00
José Valim
e5b46cfb6d Merge pull request #5480 from drogus/rendering-issues
Fix for #5440
2012-03-17 07:08:49 -07:00
Piotr Sarnacki
7130f91591 Add missing test for #5308 2012-03-17 14:15:55 +01:00
Piotr Sarnacki
1eb6189404 Fix #5440 - multiple render_to_string breaks partials formats
This fixes situation where rendering template to string
sets `rendered_format` to the format rendered there.
This is ok to have consistent formats rendered in partials,
but it breaks on next renders if format is explicitly set
or on last render where default format does not necessarily
need to be the format of first rendered template.
2012-03-17 14:15:50 +01:00
Aaron Patterson
e135ff1afd Merge pull request #5457 from brianmario/typo-fix
Fix typo in redirect test
2012-03-15 15:22:46 -07:00
Aaron Patterson
f52ad6cf33 Merge pull request #5456 from brianmario/redirect-sanitization
Strip null bytes from Location header
2012-03-15 14:58:27 -07:00
Aaron Patterson
bd3e1ed23c Merge pull request #5437 from kennyj/fix_5430
Fix GH #5430. A Payload name for schema_search_path should be SCHEMA.
2012-03-15 11:12:08 -07:00
Aaron Patterson
f918137792 Merge pull request #5338 from mreinsch/3-2-static_invalid_byte_sequence
3 2 static invalid byte sequence
2012-03-15 10:14:13 -07:00
Piotr Sarnacki
9dfb41fd2e Check for existence of exactly the called fixture_path= method 2012-03-15 04:37:13 +01:00
Piotr Sarnacki
ccf4ff0360 Remove ActionController::TestCase#rescue_action_in_public!
This method has no effect since exception handling was
moved to middlewares and ActionController tests do not
use any middlewares.
2012-03-15 04:15:41 +01:00
David Heinemeier Hansson
e50abbad4f Allow you to force the authenticity_token to be rendered even on remote forms if you pass true 2012-03-14 19:28:36 -04:00
David Heinemeier Hansson
16ee611fad Do not include the authenticity token in forms where remote: true as ajax forms use the meta-tag value 2012-03-14 19:03:39 -04:00
Aaron Patterson
f2aea24d3b Merge pull request #5423 from jrochkind/checkout_account_for_monitor_model
ConnectionPool.checkout needs to be restructured to take account of ruby's "non-blocking" strategy for mutex ConditionVariables
2012-03-14 09:21:36 -07:00
Jonathan Rochkind
41563b49a2 ConnectionPool.checkout takes account of ruby using 'non-blocking condition variables' in mutex ConditionVariables 2012-03-13 18:00:55 -04:00
Aaron Patterson
596ecf753e Merge pull request #5417 from kennyj/fix_5399-32
[3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects.
2012-03-13 12:59:34 -07:00
João Britto
a782fea359 Close string quotes 2012-03-13 23:33:09 +05:30
Alexey Vakhov
5f281454a9 Fix layout method doc formatting 2012-03-13 23:33:00 +05:30
kennyj
21d9c0fc7f [3-2-stable] Fix GH #5399. connection_pools's keys are ActiveRecord::Base::ConnectionSpecification objects. 2012-03-14 02:34:12 +09:00
José Valim
dfbbf31dd2 Merge pull request #5410 from rafaelfranca/fix-scaffold-3-2
[3-2-stable] Do not use the attributes hash in the scaffold functional tests
2012-03-13 08:10:27 -07:00
Rafael Mendonça França
c1610ebc28 Use Ruby 1.8 hash syntax 2012-03-13 11:57:28 -03:00
Rafael Mendonça França
ac8469d233 Use the attributes hash explicitly 2012-03-13 11:23:14 -03:00
Rafael Mendonça França
5bed0e5cc0 Do not use the attributes hash in the scaffold functional tests 2012-03-13 11:23:03 -03:00
José Valim
d2ac18a822 Merge pull request #5398 from parndt/fix_issue_5193
Fix issue 5193
2012-03-13 01:57:11 -07:00
José Valim
a9320f7c0b Merge pull request #5400 from arunagw/issue_4409
Issue 4409
2012-03-13 01:48:08 -07:00
Denis Jean
f67944e757 fix activerecord query_method regression with offset into Fixnum
add test to show offset query_methods on mysql & mysql2

change test to cover public API
2012-03-13 08:52:45 +05:30
Philip Arndt
5ef806914b Fixed problem when fixture_path is not always defined (incidentally, only when ActiveRecord is according to test_help.rb). 2012-03-13 14:49:52 +13:00
Philip Arndt
f665e20dbf Fixes issue #5193 using the instructions provided in the issue. 2012-03-13 14:20:11 +13:00
Aaron Patterson
5f26ce699f make sure connections returned after close are marked as in_use 2012-03-12 11:58:38 -07:00
Aaron Patterson
da0595d7d7 Merge pull request #5391 from jrochkind/connection_pool_doc
ConnectionPooll#clear_active_connections! rdoc inaccuracy since 3.2.0
2012-03-12 09:47:19 -07:00
Jonathan Rochkind
bb8f4c2b11 inline docs for clear_active_connections! no longer says it cleans dead threads, it doesn't since 3.2.0 2012-03-12 11:07:40 -04:00
Andrew White
a01f0ab839 Add documentation for find_or_create_by_{attribute}! method. 2012-03-12 15:03:04 +00:00
Andrew White
90d96353e6 Add dynamic find_or_create_by_{attribute}! method.
(cherry picked from commit 5282485d310d1a6ffcf55e4e7f56ab234e16880d)

Conflicts:

	activerecord/CHANGELOG.md
	activerecord/lib/active_record/dynamic_finder_match.rb
2012-03-12 14:12:22 +00:00
José Valim
2b9041ba96 Merge pull request #5347 from rafaelfranca/fix-has_many_association-3-2
[3-2-stable] Fix has many through associations when mass_assignment_sanitizer is :strict
2012-03-08 23:28:10 -08:00
Vijay Dev
9814420778 Merge pull request #5350 from rafaelfranca/changelog-fix-3-2
Changelog fix 3 2
2012-03-08 22:48:13 -08:00
Rafael Mendonça França
db743ff459 Fix my name in the CHANGELOG to follow the convention
Also add missing entries and use the formating convention
2012-03-09 00:52:19 -03:00
Rafael Mendonça França
f18c0547b0 Not need to pass join attributes to association build 2012-03-08 23:29:28 -03:00
Rafael Mendonça França
7cd4063162 Add test case to has_many through association when mass_assignment_sanitizer is
:strict

Conflicts:

	activerecord/test/models/person.rb
2012-03-08 23:29:16 -03:00
Aaron Patterson
94b2c8c32d ensure that released connections move between threads 2012-03-08 16:13:12 -08:00
Aaron Patterson
cff19cf545 make active_connection? return true only if there is an open connection in use for the current thread. fixes #5330 2012-03-08 15:47:18 -08:00
Vijay Dev
263d8424b3 update changelogs for gems without changes too [ci skip] 2012-03-09 03:17:15 +05:30
Vijay Dev
3bfd6516c3 changelog updates [ci skip] 2012-03-09 02:07:42 +05:30
Vijay Dev
c1a01c795d In a nested resource route, the parent resource param is <resource_name>_id
This fix was made by @coreyhaines on docrails and merged in master.
Cleanly cherry picking into 3-2-stable wasn't possible.
2012-03-09 00:27:57 +05:30
coreyhaines
df755d4e53 Left off a : when specifying the :namespace option for a :controller
path segment
2012-03-09 00:26:32 +05:30
Caius Durling
22a8433631 Fix typo in isolated engine docs 2012-03-09 00:21:57 +05:30
Matthew Conway
061f8ae436 Fix typo in asset pipeline guide 2012-03-09 00:21:57 +05:30
Braden Schaeffer
357e288f44 Fix doc examples for has_and_belongs_to_many association 2012-03-09 00:21:57 +05:30
Swanand Pagnis
30feb8c816 Fixed a slightly misleading equivalent SQL code on the 3.2 query interface. 2012-03-09 00:21:56 +05:30
Mikhail Dieterle
1f2224da77 typo 2012-03-09 00:21:53 +05:30
Carlos Antonio da Silva
e63f04cc0c Improve docs for attr_accessible|protected related to Hash#except|slice 2012-03-09 00:21:45 +05:30
Michael Reinsch
55cac81bc5 fix ArgumentError being raised in case of invalid byte sequences 2012-03-08 20:44:28 +09:00
kuahyeow
9bcd6622dd Add tests to test that through associations are not readonly, and we can update the records we retrive from the association 2012-03-08 09:49:21 +13:00
José Valim
524e8a1a80 Merge pull request #5316 from Jacobkg/master
Update ActiveRecord::AttributeMethods#attribute_present? to return false for empty strings
2012-03-07 16:08:26 +01:00
José Valim
3775058f1f Remove usage of deprecated module. 2012-03-07 15:26:56 +01:00
Carlos Antonio da Silva
b35fd40891 Add test case for #5307 2012-03-07 15:03:19 +01:00
José Valim
e7560bc787 Set the rendered_format on respond_to. 2012-03-07 15:03:08 +01:00
José Valim
bcea8cd6d6 Just change the formats on first render, closes #5307, closes #5308. 2012-03-07 14:55:20 +01:00
Santiago Pastorino
74fe7e1018 Deprecate ActionController::SessionManagement 2012-03-06 18:13:30 -02:00
José Valim
9c56401c0e Use latest rack-cache. 2012-03-06 10:13:44 +01:00
Mikel Lindsaar
0d2798eda5 Increasing minimum version of mail due to security vulnerability found in Mail 2.4.1 for sendmail or exim 2012-03-06 19:58:48 +11:00
José Valim
688e4f0fd1 Merge pull request #5299 from sikachu/3-2-stable-fix-responder
Always passing a respond block from to responder
2012-03-06 00:50:00 -08:00
Prem Sichanugrist
82a8698e56 Always passing a respond block from to responder
We should let the responder to decide what to do with the given
overridden response block, and not short circuit it.

Fixes #5280
2012-03-05 21:09:47 -05:00
Mario Visic
5b73a3a5ca Failing test for mime responder respond_with using a block. 2012-03-05 21:09:36 -05:00
Jean Boussier
e1a882a15b Fix #5069 - Protect foreign key from mass assignment throught association builder 2012-03-05 10:33:47 -08:00
Michael Koziarski
ebc5a19ba2 Merge pull request #5278 from rafaelfranca/fix-build-3-2
[3-2-stable] Fix build
2012-03-04 18:04:47 -08:00
Rafael Mendonça França
2a6b7e5a0c Now all the models need to explicitly declare the accessible attributes 2012-03-04 22:37:16 -03:00
Rafael Mendonça França
f604a6368b Only add the whitelist_attributes option if ActiveRecord is present
Conflicts:

	railties/test/generators/app_generator_test.rb
	railties/test/isolation/abstract_unit.rb
2012-03-04 22:37:04 -03:00
Michael Koziarski
06a3a8a458 Whitelist all attribute assignment by default.
Change the default for newly generated applications to whitelist all attribute assignment.  Also update the generated model classes so users are reminded of the importance of attr_accessible.
2012-03-05 11:12:01 +13:00
Carlos Antonio da Silva
864d755177 Only run binary type cast test with encode! on Ruby 1.9 2012-03-04 16:35:35 +01:00
Lars Kanis
f6d478adcd fix associations when using per class databases
would get ConnectionNotEstablished error because it always tried to use
ActiveRecord::Base's connection, even though it should be using the connection
of the model whose context we're operating in
2012-03-04 16:16:07 +01:00
Vijay Dev
23ca13a877 CSS fix for guides. Closing #5028 [ci skip]
In Ubuntu Chrome, in the last lines of code blocks, the underscore isn't
visible. Increasing the line height slightly seems to fix this. This
problem doesn't exist in Firefox even on Ubuntu. Too lazy to test in
any other OS-browser combo :)
2012-03-03 23:49:37 +05:30
Santiago Pastorino
520571ac8a Turn off verbose mode of rack-cache, we still have X-Rack-Cache to check that info
Closes #5245
2012-03-03 00:29:02 -02:00
Aaron Patterson
af02291871 only log an error if there is a logger. fixes #5226
Conflicts:

	activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb
2012-03-02 10:28:06 -08:00
Santiago Pastorino
8674823350 Add CHANGELOG entry 2012-03-02 14:34:23 -02:00
Carlos Antonio da Silva
5fd360133a Stop SafeBuffer#clone_empty from issuing warnings
Logic in clone_empty method was dealing with old @dirty variable, which
has changed by @html_safe in this commit:
139963c99a

This was issuing a "not initialized variable" warning - related to:
https://github.com/rails/rails/pull/5237

The logic applied by this method is already handled by the [] override,
so there is no need to reset the variable here.
2012-03-02 16:05:46 +01:00
Piotr Sarnacki
1a71e84ad8 Fix #5238, rendered_format is not set when template is not rendered 2012-03-02 12:50:36 -02:00
Xavier Noria
bbe7dac223 revert setting NOT NULL constraints in add_timestamps
Commit 3dbedd2 added NOT NULL constraints both to table
creation and modification. For creation the new default
makes sense, but the generic situation for changing a
table is that there exist records. Those records have
no creation or modification timestamps, and in the
general case you don't even know them, so when updating
a table these constraints are not going to work. See
a bug report for this use case in #3334.
2012-03-01 16:16:31 -08:00
Aaron Patterson
c2897901de Merge branch '3-2-2' into 3-2-stable
* 3-2-2:
  bumping to 3.2.2
  Ensure [] respects the status of the buffer.
  Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
  Merge pull request #5084 from johndouthat/patch-1
  updating RAILS_VERSION
  delete vulnerable AS::SafeBuffer#[]
  use AS::SafeBuffer#clone_empty for flushing the output_buffer
  add AS::SafeBuffer#clone_empty
  fix output safety issue with select options
2012-03-01 09:51:51 -08:00
Aaron Patterson
01b470f526 bumping to 3.2.2 2012-03-01 09:16:28 -08:00
Aaron Patterson
c60c1c0812 Merge branch '3-2-stable-security' into 3-2-2
* 3-2-stable-security:
  Ensure [] respects the status of the buffer.
  delete vulnerable AS::SafeBuffer#[]
  use AS::SafeBuffer#clone_empty for flushing the output_buffer
  add AS::SafeBuffer#clone_empty
  fix output safety issue with select options
2012-03-01 09:05:34 -08:00
José Valim
55ac1b9d88 Ensure [] respects the status of the buffer. 2012-02-29 16:13:29 -08:00
Aaron Patterson
5bb5780f7b Merge pull request #5206 from kennyj/fix_5173-32
[3-2-stable] Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931
2012-02-29 11:53:32 -08:00
kennyj
f1f2e8c80b Fix type_to_sql with text and limit on mysql/mysql2. Fix GH #3931. 2012-02-29 01:23:37 +09:00
Aaron Patterson
72ae0b4b07 call binmode on the tempfile for Ruby 1.8 compatibility 2012-02-27 11:57:18 -08:00
Aaron Patterson
210c33f352 Merge pull request #5190 from rafaelfranca/fix-393-3-2-stable
[3-2-stable] Add a new line after the textarea opening tag.
2012-02-27 11:12:59 -08:00
Aaron Patterson
b543f8f88c Merge pull request #5179 from RalphShnelvar/Binary_mode_Window_bug
Binary mode window bug
2012-02-27 10:10:34 -08:00
Rafael Mendonça França
2b4e7a784e Add a new line after the textarea opening tag.
Closes #393
2012-02-27 13:57:32 -03:00
Rafael Mendonça França
663904f869 Revert "No need to pass options which is never used"
Options is needed for some Rails extensions to determine when
referential integrity should be disabled

This reverts commit bcb466c543.

Fixes #5052
2012-02-26 12:08:44 -08:00
Andrew White
b8c4f2d545 Adding tests for non-optional glob parameters 2012-02-26 00:21:08 +00:00
Ralph Shnelvar
06dc8ed289 Fixing Windows asset tag helper test failure
In asset_tag_helper_test.rb there is an assert on the number of bytes in a
concatenated file.  This test failed because Windows converts \n to \r\n as
the default for "w".  This is different than in *nix systems where there is
no conversion done.

THe test that failed was test_caching_stylesheet_link_tag_when_caching_on

Using bin mode fixes this behavior on windows and makes no change on the
*nix systems.
2012-02-25 15:35:29 -07:00
Justin Woodbridge
b229bc70e5 Fix typo in match :to docs 2012-02-25 21:54:59 +05:30
Noah Hendrix
e1f799a42f Fixed typo in composed_of example with Money#<=>, was comparing amount itself instead of other_money.amount 2012-02-25 21:54:38 +05:30
Santiago Pastorino
0a1357b6fb Merge pull request #5170 from arunagw/3-2-stable
assert => assert_equal
2012-02-25 07:45:45 -08:00
Arun Agrawal
a9b1397f5f assert => assert_equal 2012-02-25 21:11:01 +05:30
Xavier Noria
8125304f20 Merge pull request #5166 from arunagw/3-2-stable
3 2 stable
2012-02-25 04:42:22 -08:00
Arun Agrawal
0bfcd4ffff Checking headers in a better way. as doing here
406ece4729
2012-02-25 17:58:19 +05:30
Xavier Noria
5661dab5fe Merge pull request #5164 from arunagw/build_fix_ruby187-p358
Build fix ruby187 p358
2012-02-25 03:43:38 -08:00
Arun Agrawal
99fa8e5e94 Build fix for ruby187-p358 2012-02-25 17:02:48 +05:30
Aaron Patterson
ecff25cda6 Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
Fix usage of psql in db:test:prepare
2012-02-23 11:03:49 -08:00
Aaron Patterson
6dbf6f39f9 Merge pull request #4834 from sskirby/fix_usage_of_psql_in_db_test_prepare
Fix usage of psql in db:test:prepare
2012-02-23 11:00:09 -08:00
José Valim
419040f203 Avoid inspecting the whole route set, closes #1525 2012-02-23 12:50:49 +01:00
Aaron Patterson
c5c3274b65 Merge pull request #5087 from pwnall/no_view_logger
Remove reference to config.action_view.logger from Rails configuration guide
2012-02-22 15:59:23 -08:00
Aaron Patterson
93f1667e91 Merge pull request #5084 from johndouthat/patch-1
Remove reference to rails_legacy_mapper, which isn't compatible with 3.2...
2012-02-22 15:57:49 -08:00
Aaron Patterson
fadad9fcef Merge pull request #5084 from johndouthat/patch-1
Remove reference to rails_legacy_mapper, which isn't compatible with 3.2...
2012-02-22 15:57:43 -08:00
Aaron Patterson
4bcd437f76 updating RAILS_VERSION 2012-02-22 12:03:13 -08:00
Santiago Pastorino
82d6dedc7a Fix CHANGELOG 2012-02-22 12:30:35 -02:00
Santiago Pastorino
110b43c8a9 Add CHANGELOG entry 2012-02-22 12:25:38 -02:00
Santiago Pastorino
19433ce870 format lookup for partials is derived from the format in which the template is being rendered
Closes #5025 part 2
2012-02-22 11:13:02 -02:00
Aaron Patterson
35626feb61 bumping up arel 2012-02-21 16:13:56 -08:00
Aaron Patterson
83e42d52e3 prepared statements can be disabled 2012-02-21 16:09:01 -08:00
Aaron Patterson
a566ee5308 tag bind params with a bind param object 2012-02-21 15:46:18 -08:00
Aaron Patterson
c73f8833d5 more ruby 2.0 respond_to? changes 2012-02-21 11:37:12 -08:00
Aaron Patterson
0052d90f20 ruby 2.0 makes protected methods return false for respond_to, so pass true as the second param 2012-02-21 10:33:07 -08:00
Vijay Dev
cc848d6250 fix bad docs from f373f296 [ci skip] 2012-02-21 23:48:47 +05:30
Santiago Pastorino
f92c81213c Don't wrap the raise with ensure 2012-02-21 15:58:25 -02:00
Aaron Patterson
d70ed102c8 Merge pull request #5096 from lawso017/master
Restoring ability to derive id/sequence from tables with nonstandard sequences for primary keys
2012-02-21 09:17:59 -08:00
Santiago Pastorino
4eff6bc6df Restore lookup formats to the previous value after searching for the failing view 2012-02-21 14:55:52 -02:00
Santiago Pastorino
b1229685c4 Add CHANGELOG entry 2012-02-21 13:23:47 -02:00
Santiago Pastorino
c4265914fb Merge pull request #5106 from kennyj/fix_warnings_20120210
[3-2-stable] Fix some warnings
2012-02-21 03:17:41 -08:00
kennyj
39d4617033 Fix some warnings on 3-2-stable 2012-02-21 12:43:41 +09:00
Akira Matsuda
dfa33fa3da delete vulnerable AS::SafeBuffer#[] 2012-02-20 16:14:56 -08:00
Akira Matsuda
42fabd2366 use AS::SafeBuffer#clone_empty for flushing the output_buffer 2012-02-20 16:14:51 -08:00
Akira Matsuda
621d219959 add AS::SafeBuffer#clone_empty 2012-02-20 16:14:47 -08:00
Sergey Nartimov
7b73913701 fix output safety issue with select options 2012-02-20 15:41:17 -08:00
Santiago Pastorino
b80d8f7111 Fix a failing test 2012-02-20 18:11:18 -02:00
Santiago Pastorino
8b86259bea Use the right format when a partial is missing.
Closes #5025
2012-02-20 17:53:02 -02:00
José Valim
8c870f11f2 Merge pull request #5101 from ckdake/ckdake_actionview_handler_reset
Reset memoized hash keys when new ActionView::Template handler is registered
2012-02-20 11:48:14 -08:00
Chris Kelly
68d3a46194 Reset memoized hash keys when new entry added 2012-02-20 14:35:30 -05:00
Aaron Patterson
3b824d66cd search private / protected methods in trunk ruby 2012-02-20 11:02:56 -08:00
Sokolov Yura
0c0f278ab2 sync __run_callbacks with ruby-trunk
https://bugs.ruby-lang.org/projects/ruby-trunk/repository/revisions/34580
In this revision behavior of respond_to? had changed: now to ask about
protected method one should pass second argument `true`
2012-02-20 10:02:41 -08:00
Andrew White
41c182c368 Remove fixture files with Windows incompatible filenames
Windows doesn't allow `\ / : * ? " < > |` in filenames so create
the fixture files at runtime and ignore the incompatible ones when
running on Windows.
2012-02-20 04:57:49 +00:00
Victor Costan
64fa7f7258 Removed (outdated?) config.action_view.logger from configuration guide. 2012-02-19 03:58:52 -05:00
Vijay Dev
b2e9bbdcff fix a typo [ci skip] 2012-02-18 23:00:32 +05:30
Mike Gunderloy
44849b1dda Documenting the :inverse_of option for associations 2012-02-18 22:58:54 +05:30
Sergey Nartimov
ed3a15da90 fix spacer template example 2012-02-18 22:21:27 +05:30
Eric Oestrich
ea54d2c93e Update Time#change docs to reflect the options it uses
[ci skip]
2012-02-18 22:21:27 +05:30
Alexey Vakhov
168e6532d5 Fix actionpack readme weblog example 2012-02-18 22:21:27 +05:30
Xavier Noria
3b61efc4af Merge pull request #5081 from arunagw/fix_ar_test
Fix ar test
2012-02-18 04:52:31 -08:00
Arun Agrawal
742b6159d5 fix test with ruby 187-p358 2012-02-18 15:47:24 +05:30
Andrew White
1b4e6ca9d8 Simplify regexp 2012-02-17 14:45:48 +00:00
Andrew White
86d3bc37b8 Fix ActionDispatch::Static to serve files with unencoded PCHAR
RFC 3986[1] allows sub-delim characters in path segments unencoded,
however Rack::File requires them to be encoded so we use URI's
unescape method to leave them alone and then escape them again.

Also since the path gets passed to Dir[] we need to escape any glob
characters in the path.

[1]: http://www.ietf.org/rfc/rfc3986.txt
2012-02-17 14:08:13 +00:00
Santiago Pastorino
1a0bc2ab7f Merge pull request #5071 from arunagw/fix_failing_test_ruby187_p358
Fix failing test ruby187 p358
2012-02-17 03:54:34 -08:00
José Valim
45503ecbb9 Merge pull request #5073 from asanghi/4918_backport
Backporting #4918 with one added test for googlebot accept header as I saw it
2012-02-17 01:52:55 -08:00
Aditya Sanghi
dffd85a192 backporting #4918 to 3.2 stable; adding extra test for accept header given by googlebot 2012-02-17 15:10:52 +05:30
Arun Agrawal
c17608fe8f Fixes failing test with ruby 1.8.7-p358
Same as 91a9b24417
2012-02-17 14:43:34 +05:30
José Valim
a1b9acb72e Merge pull request #5049 from fabioyamate/master
Fix sanitize_for_mass_assigment when role is nil
2012-02-15 14:24:35 +01:00
Aaron Patterson
201e67ed36 adding tests to document behavior for #4817 2012-02-14 16:51:49 -08:00
Santiago Pastorino
7c79996c67 Rack body respond to each and not to join
This fixes undef `to_str' for Rack::Chunked::Body when using
caches_action + streaming on an action

Closes #5027
2012-02-14 21:53:38 -02:00
José Valim
5f9a5a51de Merge pull request #5038 from carlosantoniodasilva/fix-db-migrate-redo
Always reenable _dump task in AR databases rake. Closes #5030
2012-02-14 12:10:56 +01:00
José Valim
305d5d5e90 Fix deprecation warning in AS::Concern. 2012-02-13 15:29:26 +01:00
Jeremy Kemper
92acd5d0e7 Fix that failed tests should exit with a nonzero error code.
Partially reverts 14c89e7285d4e7cd40a542fbc31d9345f60c3aa4.

Hat tip to @tenderlove for paring down the TestTask!
2012-02-10 10:34:35 -08:00
Aaron Patterson
73fcbaaa78 Merge pull request #4988 from kennyj/fix_4720-3
Fix GH #4720. Routing problem with nested namespace and already camelized controller option.
2012-02-10 10:01:06 -08:00
José Valim
6d17b36778 Merge pull request #4941 from rafaelfranca/fix-build
Use real table and columns for index test
2012-02-08 06:42:32 -08:00
Rafael Mendonça França
7c167dd2de Use real table and columns for index test 2012-02-08 11:53:32 -02:00
José Valim
d3d807a173 Push proper test changes for previous commit conflicts. 2012-02-08 14:06:44 +01:00
Paul Sadauskas
0a75336c89 Handle nil in add_index :length option in MySQL
Our schema.rb is being generated with an `add_index` line similar to this:

    add_index "foo", ["foo", "bar"], :name => "xxx", :length => {"foo"=>8, "bar=>nil}

This is the same as it was on Rails 3.1.3, however, now when that
schema.rb is evaluated, its generating bad SQL in MySQL:

    Mysql::Error: You have an error in your SQL syntax; check the manual
    that corresponds to your MySQL server version for the right syntax
    to use near '))' at line 1: CREATE UNIQUE INDEX
    `xxx` ON `foo` (`foo`(8), `bar`())

This commit adds a check for nil on the length attribute to prevent the
empty parens from being output.

Conflicts:

	activerecord/test/cases/migration/index_test.rb

Signed-off-by: José Valim <jose.valim@gmail.com>
2012-02-08 13:34:04 +01:00
Jon Leighton
77b4edce15 Fix attribute_before_type_cast for serialized attributes. Fixes #4837.
Conflicts:

	activerecord/lib/active_record/core.rb
2012-02-07 23:41:21 +00:00
Aaron Patterson
b3328779d0 always flush all logs. fixes #4277 2012-02-07 13:50:50 -08:00
Xavier Noria
dafc3c7a06 no need to check for this constant 2012-02-07 21:20:54 +01:00
José Valim
f3595b5924 Merge pull request #4916 from rmm5t/fix_force_ssl_redirect_with_params
Fixed force_ssl redirects to include original query params
2012-02-07 09:05:07 -08:00
Ryan McGeary
0e482b3681 Added unit test to cover changes to RouteSet.url_for
ActionDispatch::Routing::RouteSet.url_for now handles passing params through to
ActionDispatch::Http::Url.url_for
2012-02-07 11:56:26 -05:00
Markus Fenske
8c7378aae8 Fixed the documenation for 'to_xml' 2012-02-07 17:32:15 +01:00
José Valim
bc85fcb052 Merge pull request #4920 from guilleiguaran/revert-gemfile-edge
In Rails 3.2.x --edge generate apps with rails 3-2-stable
2012-02-07 05:31:20 -08:00
Guillermo Iguaran
5bfee55947 --edge option should generate app with rails 3-2-stable 2012-02-07 08:27:32 -05:00
Ryan McGeary
391e6a47db Fixed force_ssl redirects to include original query params
`ActionController.force_ssl` redirects http URLs to their https equivalent;
however, when a URL contains a query string, the resulting redirect lacked the
original query string.
2012-02-06 17:47:17 -05:00
Aaron Patterson
dd54137e82 Merge pull request #4912 from guilleiguaran/fix-edge-gemfile
Add branch to sass-rails and coffee-rails for apps generated with --dev or --edge (3-2-stable)
2012-02-06 10:39:13 -08:00
Guillermo Iguaran
995c076d34 Add branch to sass-rails and coffee-rails for apps generated with --dev or --edge options (3.2.x) 2012-02-06 13:32:42 -05:00
José Valim
ab44418881 Merge pull request #4908 from kennyj/fix_3864
Fix url_for method's behavior. GH #3684.
2012-02-06 17:03:42 +01:00
Santiago Pastorino
93f5361957 Merge pull request #4890 from kennyj/improvement_4883
GH #4883. Optional start_day argument for Time#all_week
2012-02-05 07:14:47 -08:00
kennyj
b0374018c2 GH #4883. Optional start_day argument for Time#all_week 2012-02-05 23:51:11 +09:00
José Valim
2bf2055f7a Clean up a bit default_response handling and cache format negotiation. 2012-02-04 16:01:01 +01:00
José Valim
44b9992c11 Merge pull request #4870 from sikachu/3-2-stable-responder-fix
Fix override API response bug in respond_with
2012-02-04 07:00:49 -08:00
José Valim
9cb0e12e46 Merge pull request #4879 from kennyj/fix_4873
Fix GH #4873. Allow swapping same class middleware.
2012-02-04 15:32:40 +01:00
Xavier Noria
ee6e3c128b let automatic EXPLAIN ignore CACHE notifications 2012-02-03 16:12:18 -08:00
Prem Sichanugrist
567ac65b42 Fix override API response bug in respond_with
Default responder was only using the given respond block when user
requested for HTML format, or JSON/XML format with valid resource. This
fix the responder so that it will use the given block regardless of the
validity of the resource. Note that in this case you'll have to check
for object's validity by yourself in the controller.

Fixes #4796
2012-02-03 14:26:34 -05:00
Aaron Patterson
9aa4c6d7ce Merge pull request #4868 from skult/3-2-stable
Fix Issue #4819
2012-02-03 09:10:59 -08:00
densya203
daa266536e Fix Issue #4819
'uninitialized constant ActiveRecord::Deprecation in Rails3.2.1'

Just a typo of 'ActiveSupport::...'
2012-02-04 00:51:08 +09:00
Aaron Patterson
4ca633e466 Merge pull request #4809 from cfeist/feist-sqlite-binary-corruption
Fix for SQLite binary data corrupter (to master branch)
2012-02-02 09:16:06 -08:00
Jon Leighton
42dab646eb Merge pull request #4543 from jdelStrother/find_or_init
Don't instantiate two objects in collection proxy / find_or_instantiate_by
2012-02-01 23:19:25 +00:00
José Valim
780bf52085 Merge pull request #4827 from sikachu/3-2-stable-fix-plugin-new
Fix plugin_new test failure from c8c84397
2012-02-01 10:11:51 -08:00
Prem Sichanugrist
b673ca68f1 Fix plugin_new test failure from c8c84397
`plugin_new` generator doesn't generate `sass-rails` in the Gemfile, so
you can't check for that.
2012-02-01 13:09:33 -05:00
José Valim
0696a514bc Merge pull request #4822 from carlosantoniodasilva/strict-validation-3-2
Generate strict validation error messages with attribute name (3-2-stable)
2012-02-01 06:05:02 -08:00
Santiago Pastorino
21735d225d Merge pull request #4815 from kennyj/fix_4749
Fix GH #4749. Remove branch options, because edge is not 3-2-stable.
2012-02-01 06:03:21 -08:00
Carlos Antonio da Silva
91f8cf2264 Generate strict validation error messages with attribute name
Backported from master.
2012-02-01 11:55:07 -02:00
kennyj
c8c84397cd Fix GH #4749. Remove branch options, because edge is not 3-2-stable. 2012-02-01 15:12:05 +09:00
Santiago Pastorino
1444ec6c91 Merge pull request #4811 from rafaelfranca/3-2-stable-fix
Fix broken build in 3-2-stable branch
2012-01-31 17:54:26 -08:00
Rafael Mendonça França
f532cd1040 Fix broken tests added by 85c724d59 2012-01-31 23:39:29 -02:00
Jon Leighton
e1de54079b Improve deprecation message 2012-01-31 20:26:16 +00:00
Aaron Patterson
81f14a5433 Merge pull request #4735 from arton/master
Re-launch assets:precompile task using original $0 if $0 is batch file so it works on Windows
2012-01-31 11:00:17 -08:00
Aaron Patterson
60cb7d6af0 Merge pull request #4779 from bsodmike/bsodmike-3-2-stable
Update comment in Gemfile re Unicorn (minor clarification)
2012-01-31 10:36:22 -08:00
José Valim
bd93ba5b16 Merge pull request #4793 from kennyj/fix_4760
[3-2-stable] Fix GH #4760. A Block was not evaluated.
2012-01-31 07:09:56 -08:00
Jon Leighton
85c724d59e Merge pull request #4783 from gregolsen/ids_reader_fix
ids_reader method fixed, test added to has_many association (for PostgreSQL)
2012-01-31 13:51:09 +00:00
José Valim
7beb5a71f3 Merge pull request #4790 from marten/fix-require-deprecation-in-activesupport
Fix Deprecation usage in ActiveSupport when requiring only parts of AS
2012-01-31 05:29:11 -08:00
Marten Veldthuis
2380a2d76c Fix use of Deprecation without requiring active_support/deprecation in whiny nil 2012-01-31 14:19:59 +01:00
Marten Veldthuis
f3e1b21ca9 Fix use of Deprecation without requiring active_support/deprecation in message verifier 2012-01-31 14:19:59 +01:00
Marten Veldthuis
563be40c59 Fix use of Deprecation without requiring active_support/deprecation in ActiveSupport::Concern in Base64 2012-01-31 13:41:08 +01:00
Marten Veldthuis
cb46423c53 Fix use of Deprecation without requiring active_support/deprecation in ActiveSupport::Concern 2012-01-31 13:40:11 +01:00
kennyj
91700bfc2d Fix GH #4760. A Block was not evaluated. 2012-01-31 21:26:17 +09:00
José Valim
175cdd11f4 Merge pull request #4786 from lest/patch-2
fix assets test in 3-2-stable
2012-01-31 03:35:21 -08:00
Sergey Nartimov
cfea673135 fix assets test 2012-01-31 14:27:40 +03:00
Jon Leighton
b2955edcea Allow writing unknown attributes, but with a deprecation warning. Closes #4583. 2012-01-31 08:50:36 +00:00
Jon Leighton
0bfc504d9c Add workaround and deprecation if the inherited hook is not executed. Closes #4757. 2012-01-31 08:41:51 +00:00
Jon Leighton
c472843bbc Merge pull request #4763 from kennyj/fix_4754
[MySQL] Fix GH #4754. Remove double-quote characters around PK when using sql_mode=ANSI_QUOTES
2012-01-31 08:23:25 +00:00
Michael de Silva
93306be571 clarification to prevent confusing newbies; Passenger/Unicorn are app servers, Apache/Nginx are the web servers along with thin a la Heroku etc. 2012-01-31 09:59:38 +03:00
Xavier Noria
413790559c query cache instrumentation should included the bindings in the payload [closes #4750] 2012-01-30 13:48:05 -08:00
Vijay Dev
766e12aa7d fix typo [ci skip] 2012-01-30 23:45:55 +05:30
David Heinemeier Hansson
f78cb5583f Inline the prefix assignment so it doesnt look so daft 2012-01-27 20:43:49 +01:00
David Heinemeier Hansson
66b445c319 Revert "Fix expanding cache key for single element arrays"
This reverts commit abe915f237.

This broke all existing keys and it's wrong anyway. The array is just there as a convenience option for building the string. It's intentional that [ "stuff"] and "stuff" generates the same key.
2012-01-27 20:41:37 +01:00
José Valim
2e5ec3b399 Merge check box fixes from remote-tracking branch 'cantonio/checkbox-hidden-backport' into 3-2-stable 2012-01-27 13:15:52 +01:00
Damien Mathieu
defb751681 don't set the hidden checkbox value if it's nil 2012-01-27 10:06:49 -02:00
Tadas Tamošauskas
19be5ea877 check_box helper with :disabled => true generates disabled hidden field. fixes #1953 2012-01-27 10:06:44 -02:00
Jon Leighton
1c5bd8a33d Merge pull request #4715 from pwim/find-create-multi-args
Fix regression from Rails 3.1
2012-01-27 09:31:48 +00:00
Xavier Noria
8e6ef371c5 fixes whitespace in CHANGELOG entries 2012-01-26 15:46:47 -08:00
Xavier Noria
67b8fbca92 updating RAILS_VERSION 2012-01-26 14:54:02 -08:00
Xavier Noria
97e8d1d819 CHANGELOG revision for v3.2.1 2012-01-26 14:28:48 -08:00
José Valim
c134f24f8f Revert usage of safe constantize
Signed-off-by: José Valim <jose.valim@gmail.com>
2012-01-26 20:52:56 +01:00
Alex Tambellini
6c367a0d78 safe_constantize should handle wrong constant name NameErrors Fixes #4710
Signed-off-by: José Valim <jose.valim@gmail.com>
2012-01-26 20:52:51 +01:00
Aaron Patterson
70cbb1c1cd bumping journey to 1.0.1 2012-01-26 10:24:15 -08:00
Aaron Patterson
5ac5acd63e Merge pull request #4696 from rafaelfranca/issue-4653
Remove extra attributes from HABTM join tables in AR tests
2012-01-26 09:41:04 -08:00
Aaron Patterson
7ba3ecca34 global variables may not be set depending on the match. fixes #4703 2012-01-26 09:24:45 -08:00
Rafael Mendonça França
06dcd9c0fb Remove extra attributes from HABTM join tables in AR tests
HABTM Join tables should not have extra attributes

When extra attributes is needed in HABTM join tables is better to use
`has_many :through` association.

Fix #4653
2012-01-26 10:32:10 -02:00
Xavier Noria
280937578b registers 2483460 in the CHANGELOG 2012-01-26 13:04:40 +01:00
Xavier Noria
24834606c2 disable automatic explain if there is no logger [closes #4671] 2012-01-26 02:51:18 -08:00
brainopia
3a087b8b5e Fix contributing guide to reflect preferred position on indentation
Fix incorrect recommendation from indenting after private/protected to not.

Based on opinions of @spastorino, @jonleighton, @tenderlove

https://github.com/rails/rails/pull/1838#issuecomment-1440281
https://en.twitter.com/#!/spastorino/status/142054749351575552
https://en.twitter.com/#!/tenderlove/status/142014046445641728
https://en.twitter.com/#!/jonleighton/status/142021813415841794
2012-01-26 10:58:22 +01:00
Sergey Nartimov
36d7af34d6 call to_s on value passed to table_name=
Signed-off-by: José Valim <jose.valim@gmail.com>
2012-01-26 08:19:45 +01:00
Aaron Patterson
1a93eaae4e Merge pull request #4675 from lunks/3-2-stable
Duping log handler on buffered logger silencer.
2012-01-25 11:13:13 -08:00
Vijay Dev
b023921141 Merge pull request #4673 from carlosantoniodasilva/validation-guides-update-3-2
Validation guides update 3 2
2012-01-25 11:09:59 -08:00
Pedro Nascimento
c9cd0eb2d0 Duping log handler. fixes #4668 2012-01-25 16:53:51 -02:00
Carlos Antonio da Silva
2d73f70ac5 Fix callbacks order for destroying an object in validations guide
Also add around save to creating/updating callbacks order, and fix save
example with no validation
2012-01-25 16:36:28 -02:00
Carlos Antonio da Silva
79a0488cea Improve field error proc example in validations guide 2012-01-25 16:36:28 -02:00
Carlos Antonio da Silva
eb171fa328 Change ActiveRecord::Errors to ActiveModel::Errors in guides
Use ActiveModel::Errors in inflection example docs as well.

Also fixes wrong information and link to locale file related to
Errors#full_messages in I18n guide.
2012-01-25 16:36:27 -02:00
Carlos Antonio da Silva
6a85c45b1c Fix custom validation methods section in AR validations and callbacks guide
The methods validate_on_create and validate_on_update are not available
anymore in Rails, this removes them from the guide and adds an example
on how to use validate with the :on option.
2012-01-25 16:36:27 -02:00
Rohit Arondekar
a267090946 remove extra 'the' 2012-01-26 00:01:43 +05:30
Damian Le Nouaille
fd9d394cc3 example bracket error 2012-01-26 00:01:39 +05:30
Aaron Patterson
11e88a465c Merge pull request #4658 from pwim/unicode-paths
Test for unicode path support
2012-01-25 09:22:19 -08:00
Paul McMahon
22980e0c17 Test for unicode path support
This is currently broken due to a bug in journey.
2012-01-25 15:27:33 +09:00
José Valim
9e9e17a62e Merge pull request #4654 from pwim/explicit-deprecation-require
Explicit deprecation require
2012-01-24 19:52:45 -08:00
Paul McMahon
75d58fef26 allow requiring of 'active_model/naming'
Requiring 'active_model/naming' will raise an uninitialized constant
ActiveSupport::Deprecation exception because the module core extension
doesn't require 'active_support/deprecation'. This require cannot be
added to the core extension because of circular dependency issues.
2012-01-25 11:14:01 +09:00
Aaron Patterson
1d67f1ade7 Merge pull request #4639 from joevandyk/datetime-infinity-select-fix
datetime_select fix for dates of -infinity and +infinity
2012-01-24 15:06:27 -08:00
José Valim
dc81d0054b Merge pull request #4643 from rafaelfranca/3-2-stable
Remove unused variables to avoid warnings
2012-01-24 12:38:02 -08:00
Rafael Mendonça França
3cd28e24a1 Remove unused variables to avoid warnings 2012-01-24 18:06:41 -02:00
José Valim
5a66d33e28 Merge pull request #4641 from rafaelfranca/date_select-fix-3-2
date_select fixes [3-2-stable]
2012-01-24 11:35:11 -08:00
Aaron Patterson
e0fe62b926 Merge pull request #4514 from brainopia/update_timezone_offets
Update time zone offset information
2012-01-24 11:17:29 -08:00
Rafael Mendonça França
c4b7ca06a4 Fix date_select with discard_month and discard_year options
Closes #4553 and #4633
2012-01-24 16:38:08 -02:00
Joe Van Dyk
59a408eb64 datetime_select should work with -/+ infinity dates 2012-01-24 10:30:46 -08:00
Indrek Juhkam
d92b5fe07c Fix date_select nil and blank and order case 2012-01-24 16:03:16 -02:00
Indrek Juhkam
d4cfc4cec0 Add failing test for date_select
date_select does not work when day is discarded, include blank option is
enabled and struct date itself is nil.
2012-01-24 16:03:14 -02:00
kennyj
dc826f9977 Fix GH #4344. A defined callback in extended module is called too.
Conflicts:

	activesupport/test/callbacks_test.rb
2012-01-24 09:55:23 +01:00
Aaron Patterson
1a56a76153 work against 1-0-stable until a new journey is released 2012-01-23 17:23:13 -08:00
Aaron Patterson
3913b510b7 Added custom regexps to ASTs that have literal nodes on either side of
symbol nodes.  Fixes #4585
2012-01-23 17:21:29 -08:00
José Valim
b84046192b Merge pull request #4601 from carlosantoniodasilva/patch-1
Add missing require to Array#wrap in generators action methods
2012-01-23 08:18:48 -08:00
Vijay Dev
912f144190 test base64 encode and decode 2012-01-23 16:17:56 +05:30
Vijay Dev
70d81b319e Merge pull request #4611 from jviney/3-2-stable
Fix ActiveSupport::Base64.decode64
2012-01-23 02:42:17 -08:00
Jonathan Viney
44319eff4a The deprecated ActiveSupport::Base64.decode64 method should call ::Base64.decode64 not ::Base64.encode64 2012-01-23 21:37:10 +13:00
José Valim
ede01ce8b2 Support decimal{1,2} and decimal{1-2} and decimal{1.2} so it works fine with bash, zsh, etc, closes #4602 2012-01-22 15:58:58 +01:00
José Valim
334e5cab2a Merge pull request #4604 from ihid/3-2-stable
3-2-stable: Fixed regression - unable to use a range as choices for form.select.
2012-01-22 06:09:35 -08:00
Jeremy Walker
c6dcc3537c Allow form.select to accept ranges. 2012-01-22 13:39:15 +00:00
Carlos Antonio da Silva
d246da1603 Add missing require to Array#wrap in generators action methods 2012-01-22 10:08:58 -02:00
Jonathan Viney
9ab2904822 Fix $rails_rake_task global variable warning without replacing the value of $rails_rake_task if it is already set.
Fixes #4591.

Signed-off-by: José Valim <jose.valim@gmail.com>
2012-01-22 08:43:18 +01:00
José Valim
d5dde3734b Merge pull request #4586 from waseem/assert_with_no_deprecation_warnings
Assert with no deprecation warnings activesupport tests.
2012-01-21 12:23:46 -08:00
Waseem Ahmad
892c67018d Remove deprecation warning from console output when running
activesupport tests.
2012-01-22 01:45:32 +05:30
José Valim
a720e347e2 Merge pull request #4582 from kennyj/fix_4580
Fix  GH #4580. Rails 3.2: uninitialized constant ActiveSupport::TaggedLogging::ERROR
2012-01-21 12:03:32 -08:00
kennyj
caf78564c2 Fix GH #4580. Rails 3.2: uninitialized constant ActiveSupport::TaggedLogging::ERROR 2012-01-22 04:40:09 +09:00
Jonathan Roes
c70135807e document :raise option support for several helpers [ci skip] 2012-01-21 21:34:49 +05:30
Jon Leighton
fab664a8e9 Fix another race condition.
From 2c667f69aa2daac5ee6c29ca9679616e2a71532a.

Thanks @pwnall for the heads-up.

Conflicts:

	activerecord/lib/active_record/core.rb
2012-01-20 18:31:41 +00:00
David Heinemeier Hansson
f36dcaf488 Preparing for 3.2.0 release 2012-01-20 17:44:32 +01:00
Vijay Dev
6c656761ec update release notes [ci skip] 2012-01-20 00:47:14 +05:30
José Valim
5b906355f1 Update CHANGELOG 2012-01-19 19:49:13 +01:00
José Valim
08d6eb6824 Do not deprecate performed? 2012-01-19 19:45:22 +01:00
Vijay Dev
ff813dc385 add uglifier version info in the 'what to update' section 2012-01-19 23:36:50 +05:30
Vijay Dev
b259bf91ae fix duplicate ids for the headers [ci skip] 2012-01-19 23:36:45 +05:30
Vijay Dev
a0e439f2f8 document AR::Base#with_lock in release notes [ci skip] 2012-01-19 23:22:01 +05:30
Vijay Dev
6e311b93ad update the getting_started guide code [ci skip] 2012-01-19 23:13:19 +05:30
Aaron Patterson
4c5b73fef8 Merge pull request #4531 from exviva/pessimistic_with_lock
Add ActiveRecord::Base#with_lock
2012-01-19 09:39:20 -08:00
Simon Baird
00554568e0 Fix small typo in mail_to docs in url_helper.rb 2012-01-19 22:13:42 +05:30
Vijay Dev
c4508332c9 revising release notes [ci skip] 2012-01-19 22:12:22 +05:30
Fujimura Daisuke
ead04eeabd update release note: timestamps is non-null as default 2012-01-19 22:12:22 +05:30
Vijay Dev
c8b584f576 select doesn't take multiple arguments - fixes #4539 [ci skip]
Didn't cherry pick the master commit because this one already had some
of the fixes made in master.
2012-01-19 21:58:19 +05:30
Vijay Dev
2e6ca53da3 revise wording [ci skip] 2012-01-19 02:53:59 +05:30
Guillermo Iguaran
3bfbc455ff Adding Action Mailer section to 3.2 release notes 2012-01-19 02:53:57 +05:30
Guillermo Iguaran
683854918f Update Release Notes: sprockets-rails section should be inside of ActionPack section 2012-01-19 02:53:54 +05:30
Vijay Dev
f2af2acac7 Merge pull request #4525 from guilleiguaran/am-changelog-3-2-stable
Update AM CHANGELOG
2012-01-18 10:54:01 -08:00
Makoto Inoue
619731f2bb ActionController::UrlEncodedPairParser is deprecated. Replaced the url parsing example with Rack::Utils.parse_query
- https://webrat.lighthouseapp.com/projects/10503/tickets/161-urlencodedpairparser-removed-in-edge-rails
2012-01-19 00:14:52 +05:30
Guillermo Iguaran
939a84a40a Update AM CHANGELOG 2012-01-18 13:41:11 -05:00
Vijay Dev
0960eb97d9 updates to 3.2 release notes 2012-01-18 23:51:23 +05:30
José Valim
f74afd973d Merge pull request #4518 from guilleiguaran/silent-sprockets-logger-3-2-stable
Silent Sprockets logger when config.assets.logger is set to false (3-2-stable)
2012-01-18 05:20:20 -08:00
Guillermo Iguaran
ae7037eba0 Update CHANGELOG and docs for config.assets.logger 2012-01-18 08:06:48 -05:00
Guillermo Iguaran
02e4d7ffd4 Silent Sprockets logger when config.assets.logger is set to false 2012-01-18 07:55:49 -05:00
José Valim
2f52bd3082 Merge pull request #4498 from carlosantoniodasilva/action-controller-refactor-3-2
Action controller refactor - deprecate Compatibility module
2012-01-17 12:10:39 -08:00
Carlos Antonio da Silva
ed0f0ad35c Update changelog 2012-01-17 18:07:48 -02:00
Carlos Antonio da Silva
786a0b7475 Remove duplicated constant definition
ActionController::ActionControllerError is already defined in
action_controller/metal/exceptions.
2012-01-17 18:07:08 -02:00
Carlos Antonio da Silva
e5e87041ce Deprecate AC::UnknownError and AC::DoubleRenderError
Use the constants AbstractController::ActionNotFound and
AbstractController::DoubleRenderError respectively instead.
2012-01-17 18:07:08 -02:00
Carlos Antonio da Silva
9d4fd613a6 Add default charset config to ActionDispatch 2012-01-17 18:07:08 -02:00
Carlos Antonio da Silva
57be2cfa1e Deprecate default_charset= at controller level 2012-01-17 18:07:08 -02:00
Carlos Antonio da Silva
20baeece91 Add some deprecations for logic being removed in 4.0 2012-01-17 18:07:08 -02:00
Aaron Patterson
57f73a6bcf Merge pull request #4487 from sarenji/fix-reset-counters
Fix bug where reset_counters resets the wrong counter cache.
2012-01-17 10:23:56 -08:00
José Valim
5812c35b88 Merge pull request #4501 from rafaelfranca/assets-logger-3-2
Add option to configure Sprockets logger [3-2-stable]
2012-01-17 09:40:06 -08:00
Rafael Mendonça França
c4c6bebecf Add option to configure Sprockets logger 2012-01-17 14:36:23 -03:00
Piotr Sarnacki
ed35f3747c Merge pull request #4492 from pkondzior/3-2-stable
Wrong behavior of ActiveModel::Errors#dup is causing regressions on applications using Rails 3-2-stable
2012-01-17 00:45:24 -08:00
Paweł Kondzior
7021184f9c Fix ActiveModel::Errors#dup
Since ActiveModel::Errors instance keeps all error messages as hash
we should duplicate this object as well.

Previously ActiveModel::Errors was a subclass of ActiveSupport::OrderedHash,
which results in different behavior on dup, this may result in regression for
people relying on it.

Because Rails 3.2 stills supports Ruby 1.8.7 in order to properly fix this
regression we need to backport #initialize_dup.
2012-01-16 23:56:55 -08:00
Aaron Patterson
f9275e54e0 Merge pull request #4462 from spohlenz/fix-routing-tests
Stub ip method of alternative request class in router tests
2012-01-16 09:42:07 -08:00
Piotr Sarnacki
90aae070ed Apparently asssert_empty is not available in 1.8.7 2012-01-16 18:28:01 +01:00
Vijay Dev
48f9835bf5 minor edits in getting started guide 2012-01-16 22:07:49 +05:30
Vijay Dev
39d4878a71 copy editing asset pipeline changes 2012-01-16 22:07:44 +05:30
Richard Hulse
96e5d10fd7 [docs] Update pipeline asset organization section.
* Calified how assets are included.
* Added information about using index manifests.
2012-01-16 22:07:40 +05:30
Dan Pickett
951d70dbe0 change class to id per scaffold change
#4472
2012-01-16 22:07:36 +05:30
Carlos Antonio da Silva
7b8e6d52a8 Improve description of :allow_destroy option for nested attributes in getting started guide 2012-01-16 22:07:31 +05:30
Guillermo Iguaran
30782e443e Getting Started Guide: Update reference about JavaScript runtimes 2012-01-16 22:07:27 +05:30
Piotr Sarnacki
3430647434 Add ActiveModel::Errors#delete, which was not available after move to use delegation 2012-01-16 17:24:08 +01:00
José Valim
42159354b4 Merge pull request #4474 from guilleiguaran/fix-route-inspector-3-2-stable
Don't hardcode assets route skipped in route inspector (3-2-stable)
2012-01-15 08:04:09 -08:00
Guillermo Iguaran
666f9316eb Don't hardcode assets route skipped in route inspector
Conflicts:

	railties/lib/rails/application/route_inspector.rb
2012-01-15 10:52:25 -05:00
Piotr Sarnacki
dee595ce04 Fix stack level too deep when model does not have attributes method.
Without that patch when using ActiveModel::AttributeMethods
in a class that does not respond to `attributes` method,
stack level too deep error will be raised on non existing
method. While documentation is clear that you need to define
`attributes` method in order to use AttributeMethods module,
`stack level too deep` is rather obscure and hard to debug,
therefore we should try to not break `method_missing` if
someone forgets about defining `attributes`.
2012-01-15 16:01:05 +01:00
Mikel Lindsaar
95027d2240 Upgrade mail dependency to 2.4.0 2012-01-15 22:16:16 +10:30
Aaron Patterson
fce3afa9b2 Merge pull request #4471 from semaperepelitsa/enum_sum
Pass a symbol instead of a block in Enumerable#sum
2012-01-14 20:42:52 -08:00
Semyon Perepelitsa
d696f8de92 Pass a symbol instead of a block. This is faster and more concise.
At least Ruby 1.8.7 is required which is ok since 3.2.

Benchmark:

```ruby
require "benchmark"

enum = 1..10_000
N = 100
Benchmark.bm do |x|
  x.report "inject block" do
    N.times do
      enum.inject { |sum, n| sum + n }
    end
  end

  x.report "inject symbol" do
    N.times do
      enum.inject(:+)
    end
  end
end
```

Result:

```
       user     system      total        real
inject block   0.160000   0.000000   0.160000 (  0.179723)
inject symbol  0.090000   0.000000   0.090000 (  0.095667)
```
2012-01-15 11:42:31 +08:00
José Valim
78ef738313 Add begin/ensure block since we are returning. 2012-01-14 09:18:57 +01:00
Jon Leighton
70b762d1a7 Fix race condition 💣 2012-01-13 22:58:26 +00:00
Santiago Pastorino
c159b01b85 Use a BodyProxy instead of including a Module that responds to close.
Closes #4441 if Active Record is disabled assets are delivered correctly
2012-01-13 19:44:44 -02:00
José Valim
4ca3592f86 No AS::TestCase here. 2012-01-13 20:57:51 +01:00
José Valim
b745fe1e83 config.force_ssl should mark the session as secure. 2012-01-13 19:55:34 +01:00
José Valim
70631e723c Merge pull request #4451 from guilleiguaran/add-therubyracer-commented 2012-01-13 12:40:10 -02:00
Guillermo Iguaran
05367e656f Update Railties section of 3.2 release notes 2012-01-13 12:40:43 +05:30
Xavier Noria
01c1127461 warns against using temporary subscribers 2012-01-12 14:59:07 -08:00
Vijay Dev
700f778814 fix rails binary path when using --dev [ci skip] 2012-01-13 01:57:06 +05:30
Piotr Sarnacki
a6dce45f42 Added note about [ci skip] tag to contributing guide 2012-01-12 21:19:35 +01:00
Vijay Dev
e4c7ebef87 add info about kindle guides in the release guide [ci skip] 2012-01-13 01:31:59 +05:30
Piotr Sarnacki
0d1df723c7 Fix table_name in ActiveRecord with more than one abstract ancestors
When subclassing abstract_class table_name should be always computed
based on class name, no matter if superclass is subclassing base
or another abstract_class. So:

class FirstAbstract < ActiveRecord::Base
  self.abstract_class = true
end
class SecondAbstract < FirstAbstract
  self.abstract_class = true
end

class Post < SecondAbstract
  self.table_name #=> 'posts' (not 'second_abstracts')
end
2012-01-12 20:53:01 +01:00
Vijay Dev
ac153fe485 prepare for 3.2 guides release :) 2012-01-13 01:20:10 +05:30
Vijay Dev
ddfd2cf1c2 remove hidden link in guides layout 2012-01-13 01:19:58 +05:30
Aaron Patterson
1d74af6688 moving to arel 3.0.0 2012-01-12 11:39:35 -08:00
Aaron Patterson
6dac17f04d depend on journey 1.0.0 2012-01-12 11:34:15 -08:00
Vijay Dev
040c9e491c add 3.2 release notes to the guides index 2012-01-13 00:42:48 +05:30
Vijay Dev
03a719843e minor edits 2012-01-13 00:42:40 +05:30
Vijay Dev
e6b59432ea fixes in api docs 2012-01-13 00:42:33 +05:30
Vijay Dev
8ff8ca7a82 minor revision in 3.2 release guide 2012-01-13 00:16:23 +05:30
Santiago Pastorino
3f16f5b7a0 Add CHANGELOG entry 2012-01-11 23:52:41 -02:00
Santiago Pastorino
fc74a51c3f on and ON are type casted to a true boolean column 2012-01-11 23:26:32 -02:00
Vijay Dev
ffc8e59e8b add some missing formats in the release guide 2012-01-11 23:22:29 +05:30
Santiago Pastorino
9e94e26d6b Merge pull request #4412 from kennyj/fix_3743
Fix GH #3743. We must specify an encoding in rdoc_option explicitly.
2012-01-11 15:08:13 -02:00
Vijay Dev
260999067e Some revisions to the release notes guide
Conflicts:

	railties/guides/source/3_2_release_notes.textile
2012-01-11 20:46:32 +05:30
Matt Jones
d0915ac2f9 add documentation explaining reorder behavior 2012-01-11 20:24:22 +05:30
codesnik
96d4da1719 Made an example a little more realistic 2012-01-11 20:24:17 +05:30
Santiago Pastorino
bb78804a5e Merge pull request #4408 from tomstuart/read-and-write-attribute-aliases
#[] and #[]= are no longer interchangeable with #read_attribute and #write_attribute
2012-01-11 12:10:59 -02:00
Santiago Pastorino
9c88005d97 Merge pull request #4404 from rizwanreza/edits-to-spastorino-upgrade-notes
Edits to spastorino's upgrade notes
2012-01-11 05:44:18 -08:00
Rizwan Reza
7be7710f52 Edits to spastorino's additions in 3.2 Release Notes 2012-01-11 17:09:37 +03:30
Aaron Patterson
77785c7806 FFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUU 💣 2012-01-10 13:24:15 -08:00
Aaron Patterson
5e04884bce deprecate the subdirectories parameter to migrations
Conflicts:

	activerecord/lib/active_record/migration.rb
2012-01-10 13:19:11 -08:00
Santiago Pastorino
03f62755e3 Add "What to update in your apps" section to the release notes guide
We should keep this up to date and the current version is probably wrong
and/or incomplete. HELP!!!
2012-01-10 18:22:33 -02:00
José Valim
ae14b71b70 Remove duplicated test line which was causing Ci failures on 1.8.7. 2012-01-10 20:51:45 +01:00
Santiago Pastorino
bda0ae76a8 Remove dead code 2012-01-10 16:46:26 -02:00
Santiago Pastorino
6f48fb3ad3 Add CHANGELOG entry 2012-01-10 16:36:18 -02:00
Santiago Pastorino
3375a093e9 Rails initialization with initialize_on_precompile = false should set assets_dir 2012-01-10 16:34:13 -02:00
Piotr Sarnacki
d65b766426 Fix http digest authentication with trailing '/' or '?' (fixes #4038 and #3228) 2012-01-10 04:42:46 +01:00
Piotr Sarnacki
79b12a0ffb Add original_fullpath and original_url methods to Request 2012-01-10 04:39:53 +01:00
Piotr Sarnacki
63305daeba Add ORIGINAL_FULLPATH to env
This behaves similarly to REQUEST_URI, but
we need to implement it on our own because
REQUEST_URI is not reliable.

Note that since PATH_INFO does not contain
information about trailing question mark,
this is not 100% accurate, for example
`/foo?` will result in `/foo` in ORIGINAL_FULLPATH
2012-01-10 04:39:43 +01:00
José Valim
a579d4bb5f Merge pull request #4352 from kennyj/improve_3694-2
[3-2-stable] Don't fork a process when assets:precompile:nondigest is invoked in assets:precompile:all.
2012-01-06 08:12:03 -08:00
kennyj
205674408b Don't fork a process when assets:precompile:nondigest is invoked in assets:precompile:all. Improve GH #3694. 2012-01-07 00:29:05 +09:00
Santiago Pastorino
6005736a98 Depend on coffee-rails 3.2.1 2012-01-05 15:31:17 -02:00
Aaron Patterson
867a7927ae Merge pull request #4311 from kuroda/3-2-negative_format
Infer currency negative format from positive one. (3-2-stable)
2012-01-05 09:18:24 -08:00
Tsutomu Kuroda
22f901cc9d Infer currency negative format from positive one.
When a locale file sets the format of the positive
currency value as '%n %u', the default negative
currency format should be '-%n %u'.

Cherry-picked from master (6724c8c8)
2012-01-05 11:08:09 +09:00
Santiago Pastorino
d268ef2f65 Bump to rc2 2012-01-04 18:59:41 -02:00
José Valim
0b24dc9148 Revert "AS::Callbacks: remove __define_runner"
Runners are used internally.

This reverts commit 40c8aa706a.
2012-01-04 21:29:05 +01:00
Jeremy Kemper
49a1017235 Add release notes URL to vendor/plugins deprecation warning. Update CHANGELOG. 2012-01-04 12:09:21 -07:00
Jeremy Kemper
d9e0c4a013 Clarify vendor/plugins deprecation warning 2012-01-04 11:49:19 -07:00
Aaron Patterson
d22592a05b Merge pull request #4282 from edgecase/order_after_reorder
correctly handle order calls after a reorder
2012-01-04 10:13:22 -08:00
Santiago Pastorino
f8df37bc01 Use sass-rails 3.2.3 2012-01-04 14:25:20 -02:00
Santiago Pastorino
3fb32cfe7c Revert "use pg 0.11.0 under ruby 1.8.7"
There's a new pg release, no need for this anymore
This reverts commit 0b5cda73e2.
2012-01-04 14:20:36 -02:00
Vijay Dev
4b2b595992 copy edits 2012-01-04 20:20:52 +05:30
Pablo Ifran
00a27c52ea improve doc in number helper options 2012-01-04 20:20:48 +05:30
Mike Gunderloy
20a4258c7d General editing pass over assets pipeline guide 2012-01-04 20:20:43 +05:30
Vijay Dev
bc36613f4d updates to 3.2 release notes 2012-01-04 20:10:32 +05:30
Kristian Freeman
6bcc1b89dc Final grammar checkup on 3.2 release notes. 2012-01-04 20:08:50 +05:30
José Valim
a10f30963d Merge pull request #4288 from kennyj/fix_4285-2
(3-2-stable) Fix GH #4285. Remove options when we record calling create_table
2012-01-03 23:43:26 -08:00
kennyj
6012970fea Fix GH #4285. Remove options when we record calling creat_table 2012-01-04 14:54:38 +09:00
Aaron Patterson
63f7a61246 When generating routes, the last defined named route wins. This is in
contrast to route recognition where the first recognized route wins.
This behavior will not exist in Rails 4.0.

See:

  https://github.com/rails/rails/issues/4245
  https://github.com/rails/rails/issues/4164
2012-01-03 14:00:24 -08:00
Aaron Patterson
e9122112fa Revert "Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)"
This reverts commit 71d769e3b5.
2012-01-03 13:56:12 -08:00
Aaron Patterson
c4a29de0e0 Merge pull request #4283 from lest/fix-singleton-checking
use correct variant of checking whether class is a singleton
2012-01-03 13:12:02 -08:00
Santiago Pastorino
caa6cdeba1 Merge pull request #4281 from lest/3-2-changelog
add CHANGELOG entry for AS::Base64 deprecation
2012-01-03 12:10:59 -08:00
Sergey Nartimov
337ac054db add CHANGELOG entry for AS::Base64 deprecation 2012-01-03 23:08:28 +03:00
Santiago Pastorino
8c129f18d2 Pass extensions to javascript_path and stylesheet_path helpers. Closes #3417 2012-01-03 17:51:10 -02:00
José Valim
124536ed9b Merge pull request #4280 from lest/3-2-backport-callbacks
backport changes in AS::Callbacks
2012-01-03 11:31:00 -08:00
José Valim
d38dac8ea9 Override respond_to? since we are also overriding method_missing. 2012-01-03 20:27:38 +01:00
Bogdan Gusiev
40c8aa706a AS::Callbacks: remove __define_runner 2012-01-03 22:14:41 +03:00
Bogdan Gusiev
5b8d27000b Refactor AS::Callbacks
Extracted `__reset_runner` from `__define_runner`
And call it in proper places
2012-01-03 22:14:37 +03:00
Bogdan Gusiev
4e8286fe12 AS::Callbacks: improved __define_runner performance 2012-01-03 22:14:33 +03:00
Bogdan Gusiev
9f8f4c2871 AS::Callbacks: improve __define_runner perfomance 2012-01-03 22:14:27 +03:00
Santiago Pastorino
0d7d3a6e77 Add font_path helper method 2012-01-03 17:05:43 -02:00
Aaron Patterson
eafdf6c9bd Merge pull request #4279 from lest/fix-log
do not rewrite log during application bootstrap
2012-01-03 09:31:45 -08:00
Santiago Pastorino
ca24ee75af Merge pull request #4278 from kennyj/fix_rdoc_generating_problem
Use -e option instead of -c option (rake rdoc task).
2012-01-03 14:05:27 -02:00
José Valim
c032ff6e3c Merge pull request #4275 from lest/3-2-deprecate-activesupport-base64
deprecate AS::Base64 methods without DeprecatedConstantProxy
2012-01-03 05:55:51 -08:00
Sergey Nartimov
1fc53df661 deprecate AS::Base64 methods without DeprecatedConstantProxy 2012-01-03 16:37:20 +03:00
Santiago Pastorino
853de2bd9a Deprecate Rails::Plugin in favor of gems 2012-01-03 10:37:47 -02:00
José Valim
2535898acf Merge pull request #4273 from lest/fix-pg-version
use pg 0.11.0 under ruby 1.8.7
2012-01-03 03:51:10 -08:00
Sergey Nartimov
0b5cda73e2 use pg 0.11.0 under ruby 1.8.7 2012-01-03 14:47:31 +03:00
Xavier Noria
e369c4e67f Merge pull request #4268 from lest/3-2-deprecate-activesupport-base64
fix base64 requires
2012-01-02 14:21:13 -08:00
Sergey Nartimov
4f440a3833 fix base64 requires 2012-01-03 01:18:34 +03:00
Xavier Noria
7bdfbac580 Merge pull request #4267 from lest/3-2-deprecate-activesupport-base64
deprecate ActiveSupport::Base64
2012-01-02 14:00:32 -08:00
Sergey Nartimov
5f09414f85 deprecate ActiveSupport::Base64
extend and define ::Base64 if needed
2012-01-03 00:57:03 +03:00
Vijay Dev
6e9cd38468 DRY up guides index page
Use the list of guides available in documents.yaml to fill in the
menu in the index page instead of duplicating the list again. Also,
remove WIP guides from the menu.
2012-01-01 23:04:37 +05:30
Alejandro Andrés
8be9d92c8b Fixed documentation error in code examples from form_tag_helper.rb 2011-12-31 19:11:00 +05:30
Sam Umbach
95a83cc248 SCSS processor is provided by the sass gem 2011-12-31 19:11:00 +05:30
Sam Umbach
003d0ff3f8 Minor readability improvements 2011-12-31 19:11:00 +05:30
Vijay Dev
ba19837a89 fix a couple of formatting issues 2011-12-31 19:11:00 +05:30
Vijay Dev
0a048f3a4f remove wiki link 2011-12-31 19:11:00 +05:30
Aaron Patterson
f12d90486c Merge pull request #4227 from gazay/3-2-stable-marshalling
3 2 stable marshalling
2011-12-30 10:04:39 -08:00
Xavier Noria
0814e745b7 adds a comments that clarifies why Range#include? chooses the comparison operator 2011-12-30 02:25:00 -08:00
Sergey Nartimov
71f59b72fe refactor Range#include? to handle ranges with floats
Conflicts:

	activesupport/lib/active_support/core_ext/range/include_range.rb
2011-12-30 02:24:46 -08:00
Aaron Patterson
766eda3e11 fixing typo. Thanks Vijay! 2011-12-29 10:23:48 -08:00
Vijay Dev
63c6feefc9 revise some doc changes 2011-12-29 23:39:06 +05:30
Kevin Moore
2e533e3435 Documented about using :path option for resources 2011-12-29 23:39:06 +05:30
Alejandro Andrés
5f57d2ad90 Fixed formatting of code examples in form_tag_helper.rb 2011-12-29 23:39:06 +05:30
Jo Liss
d8a43e2650 Document that index names are made up of all columns, not just the first.
index_name has been using the following expression

    "index_#{table_name}_on_#{Array.wrap(options[:column]) * '_and_'}"

since at least 2006 (bc7f2315), and that's how they come out in my DB.

Please check that this is correct before merging into master, perhaps
I'm misunderstanding the section I changed.
2011-12-29 23:39:06 +05:30
Uģis Ozols
bea4f9aa3f Remove unnecessary comma. 2011-12-29 23:39:06 +05:30
Alexey Gaziev
b815676ea9 Backward compatibility with 3.1 cache storing 2011-12-29 10:13:04 +08:00
Aaron Patterson
f423bdc10b Merge pull request #4216 from edgecase/master_fix_reorder_with_limited_ids
allow reorder to affect eager loading correctly
2011-12-28 17:04:23 -08:00
Aaron Patterson
80f2eeb138 Revert "Merge pull request #4196 from gazay/3-2-stable-marshalling"
This reverts commit df3701872d, reversing
changes made to a0fd9fb017.
2011-12-28 16:55:41 -08:00
Aaron Patterson
50af25ba87 last named route wins. fixes #4164
This differs from route recognition where first recognized route wins.
This will not be supported in Rails 4.0 so that route recognition and
generation rules are consistent.
2011-12-28 16:33:40 -08:00
Xavier Noria
7a80ac0162 app code in general wants Time.current, not Time.now 2011-12-28 23:47:31 +01:00
Jon Leighton
bbafe73d8f Revert "Further simplify singleton_class checking in class_attribute"
This reverts commit 520918aad9.

Reason: build failure
2011-12-28 18:45:28 +00:00
Aaron Patterson
df3701872d Merge pull request #4196 from gazay/3-2-stable-marshalling
3.2 stable marshalling
2011-12-28 10:10:36 -08:00
Santiago Pastorino
a0fd9fb017 Add CHANGELOG entry 2011-12-28 15:55:06 -02:00
Santiago Pastorino
2004a13130 Bump to rack 1.4.0 2011-12-28 15:53:08 -02:00
James Miller
520918aad9 Further simplify singleton_class checking in class_attribute 2011-12-28 09:47:36 -08:00
Xavier Noria
40cab62560 Merge pull request #4217 from tapajos/patch-2
Remove empty line
2011-12-28 07:01:21 -08:00
Marcos Tapajós
7767159a15 Remove empty line. 2011-12-28 12:57:20 -02:00
José Valim
d547761eb3 Merge pull request #4210 from tapajos/patch-1
Fix #4208
2011-12-28 00:32:36 -08:00
Marcos Tapajós
b3490d82ba Closes #4208 2011-12-27 20:31:29 -02:00
Alexey Gaziev
f7b1906ed7 Safe getting value from cache entry 2011-12-27 10:54:05 +08:00
Piotr Sarnacki
d7cfb63636 Correctly display rack apps with dynamic constraints in RoutesInspector
If you used dynamic constraint like that:

  scope :constraint => MyConstraint.new do
    mount RackApp => "/foo"
  end

routes were not displayed correctly when using `rake routes`.
This commit fixes it. If you want nice display of dynamic
constraints in `rake routes` output, please just override
to_s method in your constraint's class.
2011-12-26 11:54:27 +01:00
Vijay Dev
4cf40d04e4 add back the version info to the title in guides index page 2011-12-25 22:13:04 +05:30
Vijay Dev
68564eb2a1 Some fixes in rails guides generation
* Passing edge information to the views fixes the lack of the edge badge
and sets the appropriate welcome page on edgeguides.rubyonrails.org.
* Changes in the welcome message to hyper link the rails tree based on
the version.
* Mention the Amazon url from where kindlegen can be downloaded.
2011-12-25 20:45:27 +05:30
Vijay Dev
7a3121b0f2 fix kindle apps link in edge guides index 2011-12-25 19:40:52 +05:30
Michael Pearson
51fd3f37d9 Mip Earson -> Michael Pearson in changelog. 2011-12-25 19:40:52 +05:30
Xavier Noria
7ec847336f registers guide generation for the Kindle and Kindle apps in the Changelog 2011-12-25 04:13:28 -08:00
Xavier Noria
d6d561eed9 download guides for the Kindle and Kindle apps from the home page 2011-12-25 04:10:21 -08:00
Xavier Noria
4ae1cdd36b guides generation for the Kindle looking good now [Mip Earson & Xavier Noria] 2011-12-25 04:10:11 -08:00
Aaron Patterson
0daf80a8a6 Merge pull request #4175 from kuroda/3-2-stable
Reconnect to the first database after db:create
2011-12-24 20:59:05 -08:00
Tsutomu Kuroda
38bc917bb5 Reconnect to the first database after db:create
Otherwise, the schema and seed will be loaded onto the
test database.
2011-12-25 13:15:32 +09:00
Xavier Noria
69cc645c70 (draft) guides for the Kindle and Kindle apps [Mip Earson & Xavier Noria] 2011-12-24 17:33:18 -08:00
José Valim
bea3524e3f Last attempt to fix 1.8.7 tests. 2011-12-24 22:00:40 +01:00
Aaron Patterson
a410a9c8f7 avoid deprecation warnings when running AR tests 2011-12-24 10:43:23 -07:00
Aaron Patterson
b590fe4892 delegating and deprecating logger#silence. fixes #4159 2011-12-24 10:34:54 -07:00
José Valim
0e8cbbe7d5 assert_not_match -> assert_no_match. 2011-12-24 17:05:12 +01:00
Vijay Dev
929bfb8bdc add latest changes to 3.2 release notes 2011-12-24 20:41:36 +05:30
Vijay Dev
853439c2bd minor edits in caching guide 2011-12-24 17:38:23 +05:30
José Valim
1db5f4e9ad Fix regexp intervals. 2011-12-24 12:53:27 +01:00
José Valim
fc4299805e Update CHANGELOGs. 2011-12-24 10:52:45 +01:00
José Valim
557014d45a Tidy up migration types. 2011-12-24 10:52:45 +01:00
Dmitrii Samoilov
7f5b51686c added ability to specify from cli when generating a model/migration whether particular property should be an index like this 'rails g model person name:string:index profile:string' 2011-12-24 10:52:45 +01:00
José Valim
c4ef3d34ee Remove unecessary config_accessors. 2011-12-24 10:52:45 +01:00
José Valim
ba868929d3 Provide a class optin for page_cache_compression. 2011-12-24 10:52:45 +01:00
Andrey A.I. Sitnik
754823dd66 Gzip files on page caching
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-24 10:52:45 +01:00
Jeremy Kemper
684448b0c6 Remove broken #compute_source_path 2011-12-23 18:00:01 -07:00
Jon Leighton
0a2e37975d Fix situation where id method didn't get defined causing postgres to fail 2011-12-23 21:12:37 +00:00
Vijay Dev
4a86708e29 Rails 3.2 Release Notes 2011-12-24 00:59:36 +05:30
Jon Leighton
9d9440f686 Doh, remove debugging line 2011-12-23 18:25:30 +00:00
Jon Leighton
7bb754eaed Fix #4046. 2011-12-23 18:22:44 +00:00
Alvaro Bautista
6b9ab88a48 serialize fails on subclass 2011-12-23 18:22:42 +00:00
Xavier Noria
824334c15c removes Enumerable#pluck from the AS guide 2011-12-23 09:50:50 +01:00
José Valim
35ded6fd08 Merge pull request #4141 from arunagw/fix_build
Fix build 3-2-stable
2011-12-22 23:08:19 -08:00
Jon Leighton
96c38eca23 Fix build when IM=true 2011-12-23 12:00:37 +05:30
Aaron Patterson
5f2bfce9e0 adding an integration test for splat regexp substitutions. fixes #4138 2011-12-22 18:53:09 -07:00
Aaron Patterson
a32d3d0ad9 Adding an integration test. Fixes #4136 2011-12-22 18:04:59 -07:00
Aaron Patterson
f2e65b7d54 Merge branch '3-2-stable' of github.com:rails/rails into 3-2-stable
* '3-2-stable' of github.com:rails/rails:
  Use sass-rails >= 3.2.2 for new apps
  Make ActiveRecord::Relation#pluck work with serialized attributes
  Make read_attribute code path accessible at the class level
2011-12-22 13:11:44 -07:00
Aaron Patterson
2bc3f81c89 rack bodies should be a list 2011-12-22 13:09:54 -07:00
Santiago Pastorino
6758941898 Use sass-rails >= 3.2.2 for new apps 2011-12-22 18:05:25 -02:00
Aaron Patterson
585e291250 refactoring routing tests 2011-12-22 12:56:36 -07:00
Jon Leighton
e46e4915ff Make ActiveRecord::Relation#pluck work with serialized attributes 2011-12-22 19:24:16 +00:00
Jon Leighton
7edade337e Make read_attribute code path accessible at the class level 2011-12-22 19:24:16 +00:00
Aaron Patterson
89e2647da6 Merge branch '3-2-stable' of github.com:rails/rails into 3-2-stable
* '3-2-stable' of github.com:rails/rails:
  [docs] added missing "}" fixes #4126
2011-12-22 12:21:57 -07:00
Aaron Patterson
c0563cec6d Revert "Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH*"
This reverts commit 4d20de8a50.
2011-12-22 12:21:29 -07:00
Piotr Sarnacki
278a72ecea Merge pull request #4128 from arunagw/doc_fixes_3_2-stable
Doc fixes 3 2 stable
2011-12-22 02:03:58 -08:00
Arun Agrawal
8dc892618e [docs] added missing "}" fixes #4126 2011-12-22 12:36:15 +05:30
Aaron Patterson
1945bafba2 just require things once 2011-12-21 15:04:00 -07:00
Aaron Patterson
476dce4fc4 append puts the routes after the default, which causes a 404. instead use prepend 2011-12-21 15:03:56 -07:00
Lucas Mazza
b5bb3f8558 raises an ArgumentError if no valid options are given to TemplateRenderer#determine_template
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-21 21:17:17 +01:00
Jakub Kuźma
2d07c60b68 added failing tests for has_many, has_one and belongs_to associations with strict mass assignment sanitizer, fixed build_record to not merge creation_attributes, removed failing nested attributes tests (that feature was broken anyway) #4051
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-21 21:17:06 +01:00
Jeremy Kemper
108e34466c Move SubTestTask. Soften up tests. 2011-12-21 12:44:41 -07:00
Aaron Patterson
d5ccb5cf65 adding integration test for journey #7 2011-12-21 11:46:59 -07:00
Aaron Patterson
79778ffac5 caches should not be global, so no need to clear in the teardown 2011-12-21 11:46:53 -07:00
Jeremy Kemper
e85484814c Rails::SubTestTask warns on test failure and moves on. Renamed from TestTaskWithoutDescription.
This makes it easier to add your own tests to the default suite:

  namespace :test do
    task run: 'test:acceptance'

    Rails::SubTestTask.new acceptance: 'test:prepare' do |t|
      t.libs << 'test'
      t.pattern = 'test/acceptance/**/*_test.rb'
    end
  end

Now `rake` runs unit, functional, integration, and acceptance tests.
2011-12-21 10:15:39 -07:00
Hendy Tanata
efb75f774a Doc fixes on Rails::Generators::Base.hook_for. 2011-12-21 22:28:34 +05:30
José Valim
a2f5df526c Merge pull request #4080 from heimidal/3-2-stable
Fix regression in select form helper when options are non-string values
2011-12-20 13:48:34 -08:00
Brian Rose
a1b2dbd7d4 Check for response to #last instead of #first. 2011-12-20 13:38:16 -07:00
Brian Rose
bd89946dd3 Ensure option for select helper responds to #first before comparison. 2011-12-20 13:26:10 -07:00
Santiago Pastorino
cf2d31ab0b Merge pull request #4069 from arunagw/issue_4067
It should be README.rdoc
2011-12-20 10:17:40 -08:00
Arun Agrawal
490c00baeb It should be README.rdoc fixes #4067 2011-12-20 23:36:03 +05:30
José Valim
437f1e0af1 Merge pull request #4064 from nashby/date-helper-field-error-proc
fix adding field_with_errors to date selects, closes #3487
2011-12-20 09:43:58 -08:00
Vasiliy Ermolovich
92088131ac fix adding field_with_errors to date selects, closes #3487 2011-12-20 20:25:56 +03:00
Alex Tambellini
fec2999e65 Fix reference to old :sql schema_format location
After 15fb430 the default location of the :sql schema_format location was
changed from environment_name.sql to structure.sql. This pull request updates
a reference to the old schema format location in the migration guides.
2011-12-20 22:27:33 +05:30
Hendy Tanata
e149d5059b Improve doc for ActiveRecord::Base.unscoped. 2011-12-20 22:27:32 +05:30
José Valim
51e8adba43 Depend on 3-2-stable. 2011-12-20 17:15:53 +01:00
José Valim
f29b4a02fd Add a test case for layout nil. 2011-12-20 14:56:18 +01:00
lest
e97aa2c22c remove warnings about @variable_for_layout
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-20 14:24:01 +01:00
José Valim
2305a98f7a Check if source is encoding aware. 2011-12-20 12:39:28 +01:00
José Valim
2e0050ce5c Do not hard code encoding to UTF8 2011-12-20 11:56:38 +01:00
Xu Pan
1897be9b50 don't encode an UTF-8 encoded template
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-20 11:56:33 +01:00
José Valim
5d913640bc Remove i18n dependencies from AP and AMo since they are in AS. 2011-12-20 11:56:22 +01:00
David Heinemeier Hansson
9d6e52b55e Party like its R-C-UNO! 2011-12-19 18:34:57 -06:00
David Heinemeier Hansson
1e941dde7c Add an invitation to use jbuilder, since we are not going to bundle it in 3.2 2011-12-19 18:27:19 -06:00
Piotr Sarnacki
61d0de2009 Merge pull request #4036 from Juanmcuello/database_tasks
Fix database tasks in test namespace.
2011-12-19 13:44:24 -08:00
Aaron Patterson
9d0789c415 adding tests for #4029 2011-12-19 13:34:54 -08:00
Juan M. Cuello
626c881863 Fix database tasks in test namespace.
This is mostly the same as 876bade599
that was reverted due to test failures, but now with a correction.
2011-12-19 18:20:17 -03:00
Vasiliy Ermolovich
024d3b9fcc add failing tests for issue #3487 2011-12-19 21:55:37 +03:00
José Valim
3c1884e7dd Revert "Merge pull request #4030 from Juanmcuello/database_tasks"
This reverts commit a0edfb4d20, reversing
changes made to 4012fcff22.
2011-12-19 19:31:36 +01:00
José Valim
a0edfb4d20 Merge pull request #4030 from Juanmcuello/database_tasks
Fix database tasks in test namespace.
2011-12-19 09:43:37 -08:00
Juan M. Cuello
876bade599 Fix database tasks in test namespace. 2011-12-19 13:52:27 -03:00
Jon Leighton
4012fcff22 Don't notify campfire when the build keeps passing 2011-12-18 23:37:05 +00:00
Vijay Dev
c59409b838 fix a minor typo 2011-12-19 01:31:12 +05:30
José Valim
e8d69437d4 Update activerecord/lib/active_record/railties/databases.rake 2011-12-18 20:56:59 +01:00
José Valim
81deb346af Merge pull request #4019 from kommen/rake_db_structure
Make structure.sql file configureable in db:structure:dump analog to SCHEMA in db:schema:dump
2011-12-18 11:54:11 -08:00
Dieter Komendera
a2249eee76 Rename STRUCTURE to DB_STRUCTURE, update dump task description and add simple testcase. 2011-12-18 20:43:36 +01:00
Jon Leighton
de2306f10c Merge pull request #4014 from lest/bypass-preloading-for-ids-reader
bypass preloading for ids_reader
2011-12-18 09:42:15 -08:00
Jon Leighton
81c67c1441 Merge pull request #4011 from lest/scope-with-lambda-duplicates
call scope within unscoped to prevent duplication of where values
2011-12-18 09:35:06 -08:00
José Valim
1214e16640 Merge pull request #4018 from arunagw/warning_removed_
Warning removed in test
2011-12-18 00:09:52 -08:00
Arun Agrawal
ff502d9601 Warning removed in test 2011-12-18 13:37:07 +05:30
Sergey Nartimov
109db5a550 bypass preloading for ids_reader
when fetching ids for a collection, bypass preloading
to avoid the unnecessary performance overhead
2011-12-18 10:59:24 +03:00
José Valim
5da792711b Merge pull request #4017 from arunagw/remove_extra_require
No need 'abstract_unit' here. It's already in 'generators_test_helper'
2011-12-17 23:56:25 -08:00
Arun Agrawal
1e50af9b6f No need 'abstract_unit' here. It's already in 'generators_test_helper' 2011-12-18 13:23:54 +05:30
Piotr Sarnacki
fe72f7d8c5 Merge pull request #4009 from kirs/generate-rake-task
Rake tasks generator
2011-12-17 14:05:26 -08:00
José Valim
d2951eb089 Merge pull request #4015 from schneems/schneems/routing_error_help
Add Help Text to Routing Error
2011-12-17 12:42:21 -08:00
schneems
921dcc2570 add help text to routing error
When a newcomer hits the routing error page they
are often confused about how to trouble shoot the
next step. Adding a simple help text can gently 
remind coders where to get more help.
2011-12-17 14:23:40 -06:00
Santiago Pastorino
7bde2e2578 Add campfire notifications for travis 2011-12-17 13:05:14 -02:00
José Valim
941213040b Merge pull request #4012 from JustinCampbell/master
Allow symbols to be passed as extension aliases in Mime::Type.register
2011-12-17 05:58:18 -08:00
Justin Campbell
27f3619cd5 Add test for register_alias 2011-12-17 07:52:47 -05:00
Kir
5e68fed450 Rake tasks generator with test 2011-12-17 16:42:35 +04:00
Justin Campbell
a87690b02c Add test for type aliases 2011-12-17 07:40:54 -05:00
Justin Campbell
4d5266e270 Allow symbols to be passed for extension aliases 2011-12-17 07:40:25 -05:00
José Valim
8de96949e9 Use gem versions of sass-rails and coffee-rails. 2011-12-17 12:58:11 +01:00
Sergey Nartimov
04cea56d89 call scope within unscoped to prevent duplication of where values 2011-12-17 14:41:17 +03:00
José Valim
1bfed9efb3 Merge pull request #4010 from arunagw/fix_test_activemodel
Fixed test "ArgumentError: wrong number of arguments(1 for 0)"
2011-12-17 03:23:15 -08:00
Arun Agrawal
4fac64b1cc Fixed test "ArgumentError: wrong number of arguments(1 for 0)" 2011-12-17 16:49:01 +05:30
José Valim
3346de600f Merge pull request #4008 from arunagw/warning_variable_for_layout
warning removed "warning: instance variable @variable_for_layout not ini...
2011-12-16 22:57:02 -08:00
Arun Agrawal
23334be5b8 warning removed "warning: instance variable @variable_for_layout not initialized" 2011-12-17 12:00:57 +05:30
José Valim
4f35d5a18b Merge pull request #4007 from exviva/expand_cache_key_for_one_element_array
Fix expanding cache key for single element arrays
2011-12-16 14:40:09 -08:00
Xavier Noria
0065f37826 AS::Concern is not really needed for AR::Explain 2011-12-16 12:12:05 -08:00
José Valim
05316ba127 Merge pull request #4006 from devton/validation_error_on_message_is_empty_part_2
Fixed bug when error message is an empty string.
2011-12-16 11:24:45 -08:00
Antonio Roberto
66e747b461 Fixed bug when error message is an empty string. 2011-12-16 17:17:14 -02:00
Vijay Dev
5f6bcd74fd Merge pull request #3780 from marcbowes/master
Fix favicon_link_tag help text
2011-12-16 11:13:39 -08:00
Vijay Dev
bd84b2bb5d Merge branch 'master' of github.com:lifo/docrails 2011-12-16 23:34:00 +05:30
Olek Janiszewski
abe915f237 Fix expanding cache key for single element arrays
In short:
expand_cache_key(element) should not equal expand_cache_key([element])

This way a fragment cache key for an index page with only a single
element in the collection is different than a fragment cache for a
typical show page for that element.
2011-12-16 17:58:25 +01:00
Dieter Komendera
aa92d3732c Make structure file configureable in db:structure:dump analog to SCHEMA in db:schema dump and clean up a bit. 2011-12-16 16:15:16 +01:00
Jon Leighton
f307f4d884 Delete obsolete comment 2011-12-16 14:52:02 +00:00
Jon Leighton
eba581846e Fix the build on postgres. Note: we should probably actually make schema mutations bust the cache. 2011-12-16 14:51:22 +00:00
Jon Leighton
7b1eeea5bc Should clear the primary keys cache also 2011-12-16 13:52:07 +00:00
Jon Leighton
7f20bb995a Don't store defaults in the schema cache 2011-12-16 13:52:07 +00:00
Jon Leighton
dee94d8ab5 Defaults hash can go on the model 2011-12-16 13:52:07 +00:00
Jon Leighton
0b08ff7d92 Cache columns at the model level.
Allows two models to use the same table but have different primary keys.
2011-12-16 13:52:07 +00:00
José Valim
4fe76f4f27 Wait a full second so we have time for changes to propagate 2011-12-16 13:22:06 +01:00
José Valim
dbe28f3cb0 Fix failing asset test. 2011-12-16 11:43:29 +01:00
José Valim
6481bc5f49 Update CHANGELOGs and guides. 2011-12-16 10:45:59 +01:00
José Valim
654df86b7b Show detailed exceptions no longer returns true if the request is local in production. 2011-12-16 10:45:59 +01:00
José Valim
192e55c38e Do not raise an exception if an invalid route was generated automatically. 2011-12-16 10:45:59 +01:00
José Valim
5359262695 ShowExceptions should understand X-Cascade responses from exceptions app. 2011-12-16 10:45:59 +01:00
José Valim
7dd1c751f9 Improve the specs on exceptions app. 2011-12-16 10:45:59 +01:00
José Valim
02127e6406 Allow a custom exceptions app to set. 2011-12-16 10:45:59 +01:00
José Valim
deef8dd682 Extract the rendering of public exceptions pages into a Rack app. 2011-12-16 10:45:59 +01:00
José Valim
d142572567 Get rid of the close checks since we cannot reliably close the session anyway. 2011-12-16 10:45:59 +01:00
Piotr Sarnacki
8015f906d5 Merge pull request #4002 from arunagw/warning_removed_grouped_expression
Warning removed "warning: (...) interpreted as grouped expression"
2011-12-16 00:45:20 -08:00
Arun Agrawal
aa39149b2f Warning removed "warning: (...) interpreted as grouped expression" 2011-12-16 10:30:20 +05:30
Xavier Noria
dbfc6b8b3a removes Ruby constraint in RedCloth dependency 2011-12-15 15:22:14 -08:00
Xavier Noria
5e0dec5e10 it's -> its 2011-12-15 12:57:33 -08:00
Jon Leighton
2b22564c4e Move DefaultScope and NamedScope under Scoping 2011-12-15 20:45:42 +00:00
Jon Leighton
17ad71e514 Let AttributeMethods do its own including etc 2011-12-15 20:45:42 +00:00
Jon Leighton
ceb33f8493 Split out most of the AR::Base code into separate modules 🍰 2011-12-15 20:45:37 +00:00
José Valim
8854bf29a3 Set up delegations also for to_a and arel branches. 2011-12-15 20:59:05 +01:00
José Valim
b17bc58c76 Move delegation reponsibilities of Relation to a module. Also precompile method missing calls for rofscale. 2011-12-15 20:47:26 +01:00
José Valim
1e8b751813 Make with_scope public so we stop using send 💣 2011-12-15 20:47:26 +01:00
Xavier Noria
22bd21dc0f Merge pull request #3998 from rafacv/master
Small typo in Rails::Engine documentation
2011-12-15 11:09:30 -08:00
Rafael Valverde
4baf145375 Fixed small typo in the Rails::Engine documentation. 2011-12-15 17:03:19 -02:00
José Valim
1af2a1d0f5 Improve delegate list to avoid method missing. 2011-12-15 20:01:56 +01:00
José Valim
26e7400cc5 Fix diagnostics page for routing errors. 2011-12-15 19:43:49 +01:00
José Valim
283a087634 Clean up the cache before the request in case we are running in the reload_classes_only_on_change schema. 2011-12-15 18:48:10 +01:00
José Valim
de947c621d There isn't a column_hash. It was being invoked by method missing. 2011-12-15 17:09:48 +01:00
Jon Leighton
8dba32f125 Fix #3987. 2011-12-15 13:23:28 +00:00
José Valim
d7e714adac Merge pull request #3994 from whilefalse/sass_cache_gitignore
Added .sass-cache/ directory to the genrated gitignore in engines.
2011-12-15 04:56:10 -08:00
Jon Leighton
0ddb9d6409 Merge pull request #3991 from akaspick/attrfix
Allow nested attributes in associations to update values in it's owner o...
2011-12-15 04:50:13 -08:00
Steven Anderson
54f60c1063 Added .sass-cache/ directory to the genrated gitignore in engines. 2011-12-15 12:38:52 +00:00
Alexander
bdcc27155d Merge pull request #74 from abonec/master
Fixed typo in comments
2011-12-15 00:16:43 -08:00
José Valim
ad87752ad6 Merge pull request #3990 from ugisozols/master
Remove autoload for non-existent file
2011-12-14 21:10:47 -08:00
Uģis Ozols
8d827325d0 Remove autoload for non-existent file. 2011-12-15 06:52:42 +02:00
Aaron Patterson
e9382474fd seed file was already tested for existence. ಠ_ಠ 2011-12-14 19:09:31 -08:00
Andrew Kaspick
774ff18c09 Allow nested attributes in associations to update values in it's owner object. Fixes a regression from 3.0.x 2011-12-14 20:13:03 -06:00
Nick Howard
dcd59f2d9f escape assigns[:person], assigns[person] etc in actioncontroller testcase 2011-12-14 15:38:15 -07:00
Aaron Patterson
b6105b0b59 updating arel and journey dependencies 2011-12-14 13:26:49 -08:00
Xavier Noria
800252ca71 let sdoc say which version of rdoc we depend on 2011-12-14 22:23:17 +01:00
José Valim
2a10b914ad Merge pull request #3988 from lest/fix-date-select
fix separator insertion in date_select helper
2011-12-14 12:37:22 -08:00
Sergey Nartimov
caa1c19787 fix separator insertion in date_select helper 2011-12-14 23:20:23 +03:00
Jon Leighton
889e8bee82 Fix #3672 again (dependent: delete_all perf) 2011-12-14 19:20:19 +00:00
Jon Leighton
8a37970312 Remove that there copy/pasted code 💣 2011-12-14 17:34:35 +00:00
Jon Leighton
909b337da8 Don't try to autosave nested assocs. Fixes #2961. 2011-12-14 17:28:59 +00:00
Alexander
9e39dc48d6 Update activerecord/lib/active_record/reflection.rb 2011-12-14 20:53:39 +04:00
Jon Leighton
18bf30982b Cache column defaults on model. ~30% on Model.new due to avoiding repeatedly fetching connection. 2011-12-14 16:14:47 +00:00
Jon Leighton
7b0edbb9f2 Avoid super; speeds up Model.new by about 12% 2011-12-14 16:14:47 +00:00
José Valim
e3a4eb4b40 Close the response body on cascade pass, closes #3975. 2011-12-14 17:03:35 +01:00
Jon Leighton
19bea9f1bd Stop the build asploding on 1.8.7 2011-12-14 15:31:12 +00:00
Jeremy Kemper
384a60a16c Merge pull request #3981 from choonkeat/master
Fix url_for options[:subdomain] to allow objects as values
2011-12-14 07:07:05 -08:00
Jon Leighton
bb44e5a80a Use a separate module for 'external' attribute methods. 2011-12-14 14:51:57 +00:00
choonkeat
5f67cfeda1 Fix url_for options[:subdomain] to allow objects as values
* e.g. blog_url(subdomain: current_user) instead of blog_url(subdomain: current_user.to_param)
2011-12-14 22:43:42 +08:00
Piotr Sarnacki
a5589db063 Merge pull request #3979 from kommen/dbconsole_db_config
dbconsole: Use the app's database_configuration instead of duplicating loading code.
2011-12-14 05:48:04 -08:00
Dieter Komendera
6cbe2709d6 dbconsole: Use the app's database_configuration instead of duplicating code. 2011-12-14 14:08:41 +01:00
Jon Leighton
665ef116ac Add return for 1.8.7 2011-12-14 11:11:12 +00:00
Jon Leighton
3ab49f87e4 Unfluff the CI.
With transactional fixtures enabled, the session records would end up in
@_current_transaction_records, and at the end of the transaction,
methods would be called on them that would trigger method_missing and
trigger attribute methods to be generated.

However, at this point the sessions table would not exist, and the
columns were not cached, so an exception would be raised because we
can't find the columns to generate attribute methods for.

Not sure exactly why this didn't crop up before but there have been
changes to the schema cache code and perhaps that means that column data
that was cached previously at that point is now uncached.
2011-12-14 11:05:00 +00:00
José Valim
f3531a8fc9 Clean up details keys before some tests to expire the cache. 2011-12-14 09:23:34 +01:00
Jon Leighton
38703ac897 Revert naive O(1) table_exists? implementation.
It was a bad idea to rescue exceptions here. This can interfere with
transaction rollbacks which seems to be the cause of current CI
failure.

Instead, each adapter should implement its own DB-specific O(1)
implementation, and we fall back on the generic, slower, implementation
otherwise.
2011-12-13 23:46:26 +00:00
Aaron Patterson
c7552d988e dup the details hash if a key has already been set for this object 2011-12-13 15:26:29 -08:00
Vijay Dev
74e46e5156 Merge branch 'master' of github.com:lifo/docrails 2011-12-14 02:13:23 +05:30
Vijay Dev
23bd340a48 copy edits 2011-12-14 02:08:40 +05:30
José Valim
5dc4868962 Merge pull request #3970 from lest/backtrace-when-silenced
log exception backtrace when all backtrace lines silenced
2011-12-13 11:43:13 -08:00
Sergey Nartimov
081431fdf1 log exception backtrace when all backtrace lines silenced 2011-12-13 22:32:39 +03:00
Aaron Patterson
ab802e72dc locale and default_locale may be the same, so uniq the array 2011-12-13 11:28:30 -08:00
Aaron Patterson
9d87a67590 stop freezing the details hash 2011-12-13 11:25:03 -08:00
Aaron Patterson
8b85e4a4a1 stop freezing hash value 2011-12-13 11:13:14 -08:00
Mikhail Dieterle
485e0249d2 typo in textile markup 2011-12-14 02:28:42 +08:00
José Valim
0f4da5b393 Fix failing AP tests. 2011-12-13 15:45:16 +01:00
José Valim
1668b900b5 Merge pull request #3963 from lest/logger-missing-require
missing require in buffered logger
2011-12-13 02:33:05 -08:00
José Valim
80256abb39 FileUpdateChecker should be able to handle deleted files. 2011-12-13 11:23:21 +01:00
lest
d060d6d131 missing require in buffered logger 2011-12-13 12:36:32 +03:00
José Valim
1f5b9bbdb3 Clean up FileUpdateChecker API. 2011-12-13 10:07:02 +01:00
José Valim
693d2be827 Move hooks back to initializers (we need an API that allows hooks to be replaced). 2011-12-13 09:29:18 +01:00
José Valim
cd3033eb62 Add config.file_watcher so developers can provide their own watchers (for instance, hooking on fsevents). 2011-12-13 09:29:18 +01:00
José Valim
148d15d824 Merge pull request #3958 from lest/comment-on-whitelist
commented whitelist mode enforcement for mass assignment
2011-12-12 23:57:02 -08:00
José Valim
f9df3ef845 Merge pull request #3960 from lest/activesupport-test-missing-require
missing require in activesupport test
2011-12-12 23:56:00 -08:00
José Valim
11aa167e23 Revert "Provide a unique point for running initializers."
This reverts commit c2e3ce8d1e.

Conflicts:

	railties/lib/rails/application/configuration.rb
	railties/lib/rails/application/finisher.rb
	railties/lib/rails/engine.rb
2011-12-13 08:52:52 +01:00
lest
8a9cf790db missing require in activesupport test 2011-12-13 10:33:58 +03:00
lest
f2fa4837a8 commented whitelist mode enforcement for mass assignment 2011-12-13 10:14:38 +03:00
Aaron Patterson
810837dda8 use Array#join so that file encoding doesn't impact returned string.
Fixes #3957
2011-12-12 19:45:16 -08:00
Piotr Sarnacki
3d4f913f77 Merge pull request #3950 from guilleiguaran/use-https-for-rubygems-in-apps
Use rubygems https endpoint for the Gemfile on new apps
2011-12-12 17:45:18 -08:00
Aaron Patterson
676092f761 logger adds a newline for us 2011-12-12 16:02:59 -08:00
Aaron Patterson
d12e6d0e2f use the schema cache when asking for the primary key 2011-12-12 15:59:44 -08:00
José Valim
400929fb44 Merge pull request #3943 from sferik/add_explicit_requires
Include TagHelper but don't explicitly require it
2011-12-12 14:11:16 -08:00
Erik Michaels-Ober
196407c54f Include TagHelper but don't explicitly require it
Allow autoloading to work as intended and avoid multiple requires.
2011-12-12 14:05:25 -08:00
José Valim
ffa8bfeed9 Merge pull request #3954 from bdurand/null_store_2
Add ActiveSupport::Cache::NullStore for testing and development
2011-12-12 14:03:50 -08:00
José Valim
fa1d9a884c Speed up development by only reloading classes if dependencies files changed.
This can be turned off by setting `config.reload_classes_only_on_change` to false.

Extensions like Active Record should add their respective files like db/schema.rb and db/structure.sql to `config.watchable_files` if they want their changes to affect classes reloading.

Thanks to https://github.com/paneq/active_reload and Pastorino for the inspiration. <3
2011-12-12 22:54:04 +01:00
José Valim
62cda03fa8 Provide a dir => extension API to file update checker. 2011-12-12 22:54:04 +01:00
Aaron Patterson
b04e2d86df strip whitespace errors from the generated Gemfile 2011-12-12 13:46:16 -08:00
Brian Durand
04d5eae4e8 Add ActiveSupport::Cache::NullStore to expose caching interface without actually caching for development and test environments. 2011-12-12 13:40:29 -06:00
José Valim
ede647a505 Allow reloader to be configured. 2011-12-12 19:41:17 +01:00
José Valim
9a51053c1d Update checker returns a boolean if callback was executed or not. 2011-12-12 19:41:17 +01:00
Guillermo Iguaran
f8fa383531 Use rubygems https endpoint for the Gemfile on new apps 2011-12-12 12:37:37 -05:00
Santiago Pastorino
2fdc3ab0f1 Merge pull request #3948 from sferik/use_https_rubygems_source
Use HTTPS rubygems source
2011-12-12 09:31:19 -08:00
clst
2be6df693a changed :finder_sql example to select *
because with select p.* you can no longer use count(). Using count will result in an SQL error message.
2011-12-12 18:27:51 +01:00
José Valim
af308ff376 Merge pull request #3946 from pokonski/relative_root
Fix #3365. Default config.relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"].
2011-12-12 09:14:48 -08:00
Erik Michaels-Ober
3ffa01c426 Make quotes in Gemfile consistent (use single quotes) 2011-12-12 08:16:54 -08:00
Erik Michaels-Ober
efc74f5638 Use HTTPS rubygems source 2011-12-12 08:16:38 -08:00
Piotrek Okoński
5266eb9f61 Default relative_url_root to ENV["RAILS_RELATIVE_URL_ROOT"]. Fixes #3365 2011-12-12 17:11:07 +01:00
José Valim
c046660328 Give hooks the flexibility to choose the type of callback. 2011-12-12 16:23:50 +01:00
clst
a6b15bd2dc fixed example for :finder_sql
people.* will not work when the alias is named p
2011-12-12 15:46:42 +01:00
José Valim
c2e3ce8d1e Provide a unique point for running initializers. 2011-12-12 15:35:27 +01:00
José Valim
27f0add3f9 Improve docs for Rails::Application and add routes_reloader_hook and app_reloader_hooks. 2011-12-12 15:18:19 +01:00
José Valim
57e0c038d6 Allow FileUpdateChecker to work with globs. 2011-12-12 14:57:09 +01:00
José Valim
5c234ab8ed Composition > inheritance. 2011-12-12 14:57:09 +01:00
Suraj N. Kurapati
b15e2be6b0 disambiguate "and not" when explaining "&& return" 2011-12-11 23:18:58 -08:00
Jeremy Kemper
9147613ce0 Remove duplicate html_escape docs 2011-12-11 15:56:21 -07:00
Jeremy Kemper
63cd943226 Use 1.9 native XML escaping to speed up html_escape and shush regexp warnings
length      user     system      total        real
before  6      0.010000   0.000000   0.010000 (  0.012378)
after   6      0.010000   0.000000   0.010000 (  0.012866)
before  60     0.040000   0.000000   0.040000 (  0.046273)
after   60     0.040000   0.000000   0.040000 (  0.036421)
before  600    0.390000   0.000000   0.390000 (  0.390670)
after   600    0.210000   0.000000   0.210000 (  0.209094)
before  6000   3.750000   0.000000   3.750000 (  3.751008)
after   6000   1.860000   0.000000   1.860000 (  1.857901)
2011-12-11 15:51:43 -07:00
Lennart Fridén
dc43e402a1 Added :use_two_digit_numbers option [Lennart Fridén & Kim Persson]
Added use_two_digit_numbers select_tag option for displaying months and days with leading zeros without affecting the values (useful for e.g. ISO-style dates, 2011-08-01).

Signed-off-by: José Valim <jose.valim@gmail.com>

Conflicts:

	actionpack/CHANGELOG.md
2011-12-11 22:54:28 +01:00
José Valim
a8f2b203b4 Merge pull request #3941 from azimux/fix_nested_under_indifferent_access
Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccess
2011-12-11 13:20:55 -08:00
Miles Georgi
3d6eafe32e Overrode Hash#nested_under_indifferent_access in HashWithIndifferentAccess
to return self.
2011-12-11 13:08:50 -08:00
Vijay Dev
6887aed31b update command line guide: generated README is now an rdoc 2011-12-11 23:18:49 +05:30
Yehuda Katz
75a9d88f5f Merge pull request #3936 from guilleiguaran/skip-assets-options-when-sprockets-skipped
Skip assets options in environments files when --skip-sprockets is used
2011-12-11 09:26:36 -08:00
Vijay Dev
aa6aa9b25d revising doc 2011-12-11 22:53:59 +05:30
José Valim
78de996562 Merge pull request #3933 from wfarr/master
Add button_tag support to ActionView::Helpers::FormBuilder
2011-12-11 06:06:41 -08:00
Will Farrington
3f65e7f7be Add button_tag support to ActionView::Helpers::FormBuilder.
This support is near-identical to the existing submit_tag support.

Example:

    <%= form_for @post do |f| %>
      <%= f.button %>
    <% end %>
2011-12-11 08:56:26 -05:00
Guillermo Iguaran
ea5a70a462 Skip assets options in environments files when --skip-sprockets is used 2011-12-11 08:55:01 -05:00
José Valim
79835090e2 Merge pull request #3932 from guilleiguaran/fix-assets-helpers
Use ProcessedAsset#pathname in Sprockets helpers when debugging is on. Closes #3333 #3348 #3361.
2011-12-11 01:33:25 -08:00
Aaron Patterson
d102791df7 ensure @fixture_connections is initialized in case an exception happens during setup 2011-12-10 16:33:08 -08:00
Aaron Patterson
d09b67cfc0 Errno::ENOENT error makes more sense when a file cannot be found 2011-12-10 16:32:07 -08:00
Aaron Patterson
4beaa9b839 Try to keep people from calling the deprecated flush method. 2011-12-10 16:31:59 -08:00
Piotr Sarnacki
cde99812f1 Ensure that files that compile to js/css are not compiled by default with rake assets:precompile
This case was not tested and documentation was a bit confusing
on that topic, so it was not obvious if current code
works properly or not.
2011-12-11 00:12:09 +01:00
Guillermo Iguaran
7a7e87d5aa Use ProcessedAsset#pathname in Sprockets helpers when debugging is on. Closes #3333 #3348 #3361.
Is wrong use ProcessedAsset#to_s since it returns the content of the file.
2011-12-10 18:08:42 -05:00
Piotr Sarnacki
1c2cb7d740 Clarify the default assets.precompile matcher behavior 2011-12-11 00:03:24 +01:00
Ryan Sandridge
83bc2c2760 Fixing typo in Routing Guide. 2011-12-10 15:58:08 -05:00
José Valim
cd7fbcbba8 Fix AS test suite. 2011-12-10 11:17:00 +01:00
Yehuda Katz
aace38ae09 Merge pull request #3925 from guilleiguaran/extra-test-for-therubyrhino
Add test to verify that therubyrhino isn't included when JRuby isn't used
2011-12-09 21:25:02 -08:00
Yehuda Katz
7fc0964133 Merge pull request #3926 from guilleiguaran/skip-assets-group-if-sprockets-skipped
Skip assets groups if --skip-sprockets option is given
2011-12-09 21:24:02 -08:00
Guillermo Iguaran
b12a17665a Skip assets groups if --skip-sprockets option is given 2011-12-09 21:52:10 -05:00
Guillermo Iguaran
55afc7dc60 Add test to verify that therubyrhino isn't included when JRuby isn't used 2011-12-09 21:38:10 -05:00
Xavier Noria
3e5592848a revises some stuff that was out of sync with the recent generated README.rdoc 2011-12-10 02:10:18 +01:00
Piotr Sarnacki
efed2d56e2 Update partials documentation, partial_path is no longer generated using RecordIdentifier 2011-12-10 01:30:21 +01:00
Aaron Patterson
04ef93dae6 * ActiveSupport::BufferedLogger#silence is deprecated. If you want to squelch
logs for a certain block, change the log level for that block.

*   ActiveSupport::BufferedLogger#open_log is deprecated.  This method should
    not have been public in the first place.

*   ActiveSupport::BufferedLogger's behavior of automatically creating the
    directory for your log file is deprecated.  Please make sure to create the
    directory for your log file before instantiating.

*   ActiveSupport::BufferedLogger#auto_flushing is deprecated.  Either set the
    sync level on the underlying file handle like this:

        f = File.open('foo.log', 'w')
        f.sync = true
        ActiveSupport::BufferedLogger.new f

    Or tune your filesystem.  The FS cache is now what controls flushing.

*   ActiveSupport::BufferedLogger#flush is deprecated.  Set sync on your
    filehandle, or tune your filesystem.
2011-12-09 16:05:57 -08:00
Aaron Patterson
f79b257e0b Merge pull request #3924 from laserlemon/readme-ext
Add the .rdoc extension to the README that Rails generates for a new app
2011-12-09 14:27:41 -08:00
Steve Richert
5c60b44837 Add the .rdoc extension to the README that Rails generates for a new application 2011-12-09 17:00:37 -05:00
Piotr Sarnacki
866d2dbd87 Fix indentation 2011-12-09 22:00:56 +01:00
Piotr Sarnacki
35a1744a45 Allow to run migrations with given scope, with SCOPE=<scope>
Scope in migrations can be defined by adding suffix in filename,
like: 01_a_migration.blog.rb. Such migration have blog scope.

Scope is automatically added while copying migrations from engine,
so if you want to revert all of the migrations from given engine,
you can just run db:migrate with SCOPE, like:

    rake db:migrate SCOPE=blog
2011-12-09 22:00:51 +01:00
Piotr Sarnacki
f0b782d060 Allow to filter migrations by passing a block
Example:
  ActiveRecord::Migrator.migrate(path) do |migration|
    migration.name =~ /User/
  end

The above example will migrate only migrations with User in
the name
2011-12-09 21:43:36 +01:00
José Valim
ab30570b69 Fix extend -> include. 2011-12-09 21:42:18 +01:00
Aaron Patterson
5b82f50fef Use table_exists? from the schema cache. 2011-12-09 11:23:19 -08:00
Aaron Patterson
007965a651 don't need a begin / end. 2011-12-09 10:18:10 -08:00
Aaron Patterson
a29d1dbd59 squelch table exists? queries. 2011-12-09 10:14:49 -08:00
Aaron Patterson
c212a34e1d only load converter if the encodings are different 2011-12-09 09:33:36 -08:00
David Heinemeier Hansson
22a6079a20 Make ActiveSupport::Benchmarkable a default module for ActionController::Base, so the #benchmark method is once again available in the controller context like it used to be *DHH* 2011-12-09 18:17:57 +01:00
Piotr Sarnacki
929b2646b6 Compare migrations for copying only by name and scope 2011-12-09 12:15:54 +01:00
Piotr Sarnacki
ed0b1f6eed Add suffix for migrations copied from engines 2011-12-09 11:45:19 +01:00
Piotr Sarnacki
255d9f5ac1 String#to_a is not available in 1.9 2011-12-09 10:33:37 +01:00
José Valim
5ad5215211 Deprecate implicit layout lookup in favor of inheriting the _layout config. 2011-12-09 07:20:55 +01:00
José Valim
2995134cba Simplify path traversal logic 2011-12-09 06:25:10 +01:00
Piotr Sarnacki
1d9de9d758 Run also migrations in subdirectories.
With this commit, ActiveRecord will also look for migrations
in db/migrate subdirectories.
2011-12-09 03:33:06 +01:00
Piotr Sarnacki
b164ab75d6 Fix railties tests, identical migrations are not considered when copying 2011-12-09 03:33:06 +01:00
Piotr Sarnacki
62d556424a Ignore origin comment when checking for duplicates on Migration.copy
49ebe51 fixed copying migrations, but existing migrations would still
trigger warnings. The proper way to compare migrations is to ignore
origin lines - if migration is identical it means that we can
silently skip it, regardless where it comes from.
2011-12-09 01:54:20 +01:00
Piotr Sarnacki
652db2fc3e Fix copying migrations from engines
There was a bug in ActiveRecord::Migration.copy method, which
prevented adding special comment about the origin of migration.

Because of that, the check if migration is identical or if it's
not and should be skipped was always saying that migration is
skipped, which was causing additional useless warnings about
skipped migrations.
2011-12-09 01:54:20 +01:00
Aaron Patterson
2c471b3ac8 load the encoding converter to work around [ruby-core:41556] when switching encodings 2011-12-08 15:14:07 -08:00
Aaron Patterson
8c26cd5d97 Exceptions should read from the spec configu 2011-12-08 15:14:07 -08:00
José Valim
d4d99bbc87 Fix another regression related to the layout optimization. 2011-12-08 22:56:50 +01:00
Ryan Sandridge
65796bb5fd Replacing vague mention of an unspecified section above with a link to the actual section containing Asset Organization. 2011-12-08 16:18:12 -05:00
José Valim
c41f08cefe Move symbolize keys to the inner options as we can assume url_options will be properly symbolized. 2011-12-08 21:20:47 +01:00
Jon Leighton
5da90b3483 Fix #3890. (Calling proxy_association in scope chain.) 2011-12-08 20:10:04 +00:00
José Valim
ebd71fd0e3 Fix a regression and also fix broken test. 2011-12-08 21:00:34 +01:00
Vijay Dev
94dcbe8115 fix nodocs 2011-12-09 01:15:54 +05:30
Vijay Dev
120861c023 add haml and slim to the list of extensions supported by rake notes 2011-12-09 01:02:27 +05:30
Vijay Dev
965f6f22aa fix comments 2011-12-09 01:02:27 +05:30
Vijay Dev
c81bb97753 minor text change 2011-12-09 01:02:27 +05:30
José Valim
d1abf29e79 Remove NilClass whiners feature.
Removing this feature causes boost in performance when using Ruby 1.9.

Ruby 1.9 started to do implicit conversions using `to_ary` and `to_str`
in some STDLIB methods (like Array#join). To do such implicit conversions,
Ruby 1.9 always dispatches the method and rescues the NoMethodError exception
in case one is raised.

Therefore, since the whiners feature defined NilClass#method_missing, such
implicit conversions for nil became much, much slower. In fact, just defining
NilClass#method_missing (even without the whiners feature) already causes a
massive slow down. Here is a snippet that shows such slow down:

    require "benchmark"
    Benchmark.realtime { 1_000.times { [nil,nil,nil].join } }

    class NilClass
      def method_missing(*args)
        raise NoMethodError
      end
    end

    Benchmark.realtime { 1_000.times { [nil,nil,nil].join } }
2011-12-08 20:28:09 +01:00
José Valim
7280787a53 Improve cache on route_key lookup. 2011-12-08 19:53:16 +01:00
Aaron Patterson
3cae753963 fixing eval'd line numbers. 2011-12-08 10:39:12 -08:00
Aaron Patterson
d80e4ee20e Regexp.union seems to have different results in 1.8 2011-12-08 10:20:14 -08:00
José Valim
859a4556dd Revert accidental change from cattr_accessor to class_attribute. 2011-12-08 19:01:15 +01:00
Xavier Noria
b989b80960 Merge pull request #3909 from laserlemon/patch-1
Add dependency status (a la build status) to the README
2011-12-08 09:30:31 -08:00
Steve Richert
255c485d63 Add dependency status (a la build status) to the README 2011-12-08 12:17:28 -05:00
José Valim
7b1930a9b2 Merge pull request #3908 from kennyj/should_use_default_charset
Fix a failure in railties on ruby 1.8.x
2011-12-08 08:55:03 -08:00
kennyj
d4d2e8eb2e Fix testcase an error on ruby 1.8.x.
In Ruby 1.8.x, config.encoding sets $KCODE.
Therefore, the possible values are UTF8, SJIS, or EUC.
And, if we set SJIS, we'll has the error. Because some rails sources are written in utf-8 encoding.
2011-12-09 01:42:34 +09:00
José Valim
1bad06aebe Merge pull request #3906 from kennyj/fix_warnings_for_params_wrapper_test
Fix warning for params_wrapper_test.rb
2011-12-08 07:56:07 -08:00
José Valim
67cc07e0c4 Just use the proc if there is a chance of layout lookup. 2011-12-08 16:51:47 +01:00
José Valim
239262fee0 Optimize layout lookup to avoid double calls. 2011-12-08 16:39:06 +01:00
José Valim
efc28a7f70 Some small optimizations and improvements to benchmark code. 2011-12-08 16:39:06 +01:00
José Valim
06ac7d3ee0 Add performance scripts from wycats/rails-simple-benches to actionpack. 2011-12-08 16:39:06 +01:00
José Valim
0008918059 Remove rb-fsevent from Gemfile. 2011-12-08 16:39:06 +01:00
kennyj
3ade2f8e89 Fix warning for params_wrapper_test. 2011-12-08 23:09:09 +09:00
Mikhail Dieterle
09447856b1 Typo in list 2011-12-08 21:03:43 +08:00
Xavier Noria
c2aadf8935 updates the host and port of publish_docs, and changes the release instructions to use the task rather than curl (thanks to Vijay Dev for spotting this one) 2011-12-08 14:03:42 +01:00
Xavier Noria
4936fc35a0 use our own fork of sdoc while Vijay's fix is not applied to voloko/sdoc 2011-12-08 04:57:09 -08:00
Xavier Noria
2fe5834ddc releasing instructions: updates the URLs that triggers stable docs generation and publishing 2011-12-08 12:35:57 +01:00
José Valim
bf34a360dd Merge pull request #3900 from jfturcot/accessible_wrap_params
ParamsWrapper only wrap the accessible attributes when they were set
2011-12-08 01:13:14 -08:00
Jon Leighton
188b8c39da Fix broken test_exists_query_logging from the table_exists? change 2011-12-08 09:06:15 +00:00
Jean-Francois Turcot
677f968b77 Add information to the changelog about the changes to ActionController::ParamsWrapper 2011-12-08 04:03:55 -05:00
José Valim
e2e9eabc58 Remove dead broken code from AD::Request 2011-12-08 09:30:27 +01:00
José Valim
f84bf83b9b Merge pull request #3888 from kennyj/should_use_default_charset
Assign config.encoding to AD::Response.default_charset at the initialization time.
2011-12-08 00:18:09 -08:00
José Valim
0144f4f023 Merge pull request #3901 from mark-rushakoff/inflection-regex-fix
Fix inflection regexes for mouse, mice
2011-12-08 00:04:45 -08:00
Mark Rushakoff
6f253fb440 Fix inflection regexes for mouse, mice 2011-12-07 23:14:02 -08:00
Jean-Francois Turcot
d5526218e4 ParamsWrapper only wrap the accessible attributes when they were set 2011-12-07 22:50:01 -05:00
Aaron Patterson
a505b13774 moving ignored regexp to the instance 2011-12-07 17:42:05 -08:00
Aaron Patterson
38a8f7f8ba speeding up ignored sql testing 2011-12-07 17:32:01 -08:00
Aaron Patterson
76c29a64b9 Use a hash to look up column definitions 2011-12-07 17:25:31 -08:00
Aaron Patterson
7e176a6d12 try to normalize the objects passed to column() 2011-12-07 16:18:39 -08:00
Aaron Patterson
483a3cf287 automatically add the column definition to the columns list if creating a new one 2011-12-07 16:01:53 -08:00
Aaron Patterson
1fc47a1a84 stop calling String#to_s so frequently 2011-12-07 15:35:27 -08:00
Aaron Patterson
8523784265 the required sqlite3 adapter responds to encoding, so stop checking. 2011-12-07 15:01:04 -08:00
José Valim
30f0d7bac8 Remove #:nodoc: from partial renderer. 2011-12-07 19:16:14 +01:00
José Valim
12be0a5985 Merge pull request #3895 from kennyj/should_use_freezed_constant
Should use freezed string constant here.
2011-12-07 10:15:07 -08:00
José Valim
6867212261 Merge pull request #3889 from kielkowicz/master
Annotating haml and slim file
2011-12-07 10:14:26 -08:00
kennyj
0a958d8468 Use freezed string constant. Some string literals is used repeatedly. 2011-12-08 02:19:15 +09:00
Kazimierz Kiełkowicz
c6e6ce437c Moves migrations tests from railties/test/application/rake_test.rb to railties/test/application/rake/migrations_test.rb 2011-12-07 17:34:29 +01:00
Kazimierz Kiełkowicz
c45f744bb0 Move rake notes test to railties/test/application/rake/notes_test.rb 2011-12-07 17:31:31 +01:00
Kazimierz Kiełkowicz
8188d265a1 Update source_annotation_extractor comment. 2011-12-07 17:30:03 +01:00
José Valim
0df2ef3ef4 Merge pull request #3884 from sikachu/master-fix_layout
Allow layout fallback when using `layout` method
2011-12-07 08:00:45 -08:00
Santiago Pastorino
4f107384f0 Merge pull request #3894 from kelyar/master
reversible migration example
2011-12-07 07:10:27 -08:00
Evgeniy Kelyarsky
dd647d938e reversible migration example had missing block parameter 2011-12-07 17:03:51 +02:00
Kazimierz Kiełkowicz
8f61df0bcd Add annotation to haml and slim template. 2011-12-07 13:17:50 +01:00
kennyj
199353c658 Assign config.encoding to AD::Response.default_charset at the initialization time. 2011-12-07 21:11:08 +09:00
José Valim
eb22901920 Merge pull request #3878 from kennyj/should_use_default_charset
Use default charset when we read content type without charset.
2011-12-07 04:07:51 -08:00
kennyj
a1986e7d55 Use default charset when we read content type without charset. 2011-12-07 12:35:44 +09:00
Prem Sichanugrist
18ceed201b Allow layout fallback when using layout method
Rails will now use your default layout (such as "layouts/application") when you specify a layout with `:only` and `:except` condition, and those conditions fail.

For example, consider this snippet:

    class CarsController
      layout 'single_car', :only => :show
    end

Rails will use 'layouts/single_car' when a request comes in `:show` action, and use 'layouts/application' (or 'layouts/cars', if exists) when a request comes in for any other actions.
2011-12-06 21:16:29 -05:00
Prem Sichanugrist
0460b3a469 Fix bug in assert_template when using only :layout option
Currently if you're do this:

    assert_template :layout => "foo"

Regardless of what layout you were using, the test will always pass. This was broken since the introduction of :layout option in [d9375f3f].

We have a lot of test cases in actionpack/test/controller/layout_test.rb that use this feature. This will make sure that those test cases are not true negative.
2011-12-06 21:15:27 -05:00
José Valim
885a599303 Just track "require" if we have something in the watching stack.
A patch has been provided earlier and we have asked for feedback:

    https://gist.github.com/1437939

Except one case, all other cases showed improvements in boot time.
2011-12-06 21:09:44 +01:00
Aaron Patterson
9dee540084 avoid deprecated methods 2011-12-06 10:07:47 -08:00
Vasiliy Ermolovich
0968ee3456 add prefix and suffix to renamed tables, closes #1510 2011-12-06 10:02:45 -08:00
Vijay Dev
7eb596cddd Merge branch 'master' of github.com:lifo/docrails 2011-12-06 23:05:43 +05:30
Vijay Dev
89647a305f Revert "Added link to ActiveResource::Base documentation"
This reverts commit 03d4388786.

Conflicts:

	activeresource/README.rdoc

Reason: I don't think this is absolutely necessary given the
fact that such links won't work in both GitHub and Rails API
at the same time. See links in rails/README.rdoc and rails/Rakefile
for some hackery that needs to be done to get such links work in
both places.
2011-12-06 22:58:23 +05:30
Vijay Dev
078b4b54a6 use textile syntax in links 2011-12-06 22:51:07 +05:30
Vijay Dev
d1bf7db55d rxml and rhtml are no longer searched for source code annotations 2011-12-06 22:50:37 +05:30
Vijay Dev
cec909d938 copy edits in layouts guide, change links to be relative 2011-12-06 22:49:22 +05:30
Santiago Pastorino
9be2353fac Sync AP CHANGELOG with 3-1-stable 2011-12-06 11:28:05 -02:00
Santiago Pastorino
e58d663f3e Merge pull request #3428 from adrianpike/asset_path_conflicts
Issue #3427 - asset_path_conflicts
2011-12-06 05:16:24 -08:00
José Valim
f0f0e59c10 Ensure length validator also works on 1.8.7. 2011-12-06 14:13:44 +01:00
sandeepravi
b5e333d5b0 Added link to ActiveResource::Base documentation 2011-12-06 18:09:42 +05:30
sandeepravi
03d4388786 Added link to ActiveResource::Base documentation 2011-12-06 18:03:41 +05:30
Thomas von Deyen
7e12aa7424 Added git --rebase option for pulling rails master 2011-12-06 13:26:57 +01:00
sandeepravi
bc994470c4 Added wiki link to REST 2011-12-06 17:50:16 +05:30
José Valim
d722eb3b04 Merge pull request #3876 from tvdeyen/string_as_url_for_expire_action
Allow string as url for expire_action
2011-12-06 04:11:59 -08:00
Thomas von Deyen
0da31a1839 Allowing string as url argument for expire_action 2011-12-06 13:05:15 +01:00
sandeepravi
8a67b632ae Added wiki link for REST 2011-12-06 17:22:48 +05:30
José Valim
81fec5dfc4 Merge pull request #3872 from marcandre/i18n_key
ActiveModel::Name#i18n_key: Fix doc and add tests
2011-12-06 00:41:43 -08:00
José Valim
1ee832b2d8 Merge pull request #3873 from iangreenleaf/no_default_tokenizer
Don't tokenize string when counting characters
2011-12-06 00:41:05 -08:00
Marc-Andre Lafortune
d834755dad ActiveModel::Name#i18n_key: Fix doc and add tests 2011-12-05 22:02:53 -05:00
Aaron Patterson
a2f7c1dc67 make method signatures match the superclass signature 2011-12-05 18:36:27 -08:00
Aaron Patterson
b942ae836e return value is never tested, so stop calling presence 2011-12-05 18:36:08 -08:00
Adrian Pike
25007ad3fb Let's do the same trick for asset_path that we do for [image,javascript,stylesheet]_path to avoid namespace conflicts on named routes.
Closes #3427
2011-12-05 17:17:39 -08:00
Aaron Patterson
8aa7b8695d Quitoting the table name before querying. 2011-12-05 14:20:14 -08:00
Aaron Patterson
988061ddb8 Merge pull request #3867 from jadeforrest/master
Increase performance for table_exists?
2011-12-05 14:15:50 -08:00
Uģis Ozols
d645aed91f Use do end for multiline block. 2011-12-05 23:11:20 +02:00
José Valim
38185f670e Merge pull request #3866 from ugisozols/master
Remove .rxml, .rjs and .rhtml from source annotation regexp.
2011-12-05 12:31:37 -08:00
Uģis Ozols
d2f46d053f Remove .rxml, .rjs and .rhtml from source annotation regexp. 2011-12-05 21:24:09 +02:00
Jade Rubick
73a331c2ac Speed up table_exists? for databases with a large number of tables
At New Relic, we have hundreds of thousands of tables, and our migrations took 30 minutes without this similar patch. This cuts it down to a more reasonable amount of time.

The rescue false part is ugly, but necessary as far as I can tell. I don't know of a cross-database statement you can make that will work without trapping errors.
2011-12-05 11:20:10 -08:00
Uģis Ozols
1c65962b9d .rhtml and .rxml was removed in Rails 3. 2011-12-05 20:40:48 +02:00
José Valim
f6cc4fd7a2 Merge pull request #3861 from andyjeffries/master
Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match)
2011-12-05 08:48:25 -08:00
José Valim
168c088735 Merge pull request #3863 from lest/params-wrapper-inflections
use classify in ParamsWrapper to derive model name from controller name
2011-12-05 08:46:10 -08:00
lest
1f0e21ce30 use classify in ParamsWrapper to derive model name from controller name 2011-12-05 19:15:36 +03:00
Andy Jeffries
71d769e3b5 Named Routes shouldn't override existing ones (currently route recognition goes with the earliest match, named routes use the latest match) 2011-12-05 15:41:38 +00:00
José Valim
d4964b3386 Namespaced attribute lookup now works as 'model/association.attribute'. 2011-12-05 15:39:41 +01:00
Sergey Parizhskiy
0bcac982b6 Merge branch 'master' of github.com:lifo/docrails 2011-12-05 16:25:25 +02:00
Sergey Parizhskiy
c9cc535d2b changes in the way of how the stylesheets_link_tag works 2011-12-05 16:25:02 +02:00
José Valim
2985151000 Merge pull request #3859 from kuroda/human_attribute_name
Fix human_attribute_name to handle names with dots
2011-12-05 06:09:33 -08:00
Tsutomu Kuroda
dff19f7be2 Fix human_attribute_name to handle names with dots
Nested I18n namespace lookup under activerecord.models is deprecated now (c19bd4f).
But when a model uses accepts_nested_attributes_for, its Errors object can have
an attribute name with "addresses.street" style. In this case, the dots should be
substituted with slashes so that we can provide the translation under the
"activemodel.attributes.person.addresses/street" key.
2011-12-05 22:57:47 +09:00
Jason Noble
c921ba97b8 Remove redundant or 2011-12-05 05:22:13 -07:00
Xavier Noria
be482bd6d6 Merge pull request #3858 from Overbryd/redirect_to_url_with_network_path_reference
redirect_to url with network path reference: Do not escape forward slashes within a curly regexp
2011-12-05 02:55:08 -08:00
Overbryd
9fb5ee8beb Minor enhancement by not unnecessarely escaping forward slashing within a curly regexp and by mentoining the protocol relative scheme in the internal comment 2011-12-05 11:48:05 +01:00
José Valim
446bdb449d Merge pull request #3857 from Overbryd/redirect_to_url_with_network_path_reference
Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235"
2011-12-05 02:30:21 -08:00
Overbryd
e31c4ace97 Fix for redirect_to to respect urls with a network path reference like "//asset.host.com/resources/1235" see issue #3856 2011-12-05 11:19:48 +01:00
Ian Young
5ff71ac9f8 Don't tokenize string when counting characters 2011-12-04 23:20:54 -08:00
José Valim
cf6ccf0ebd Merge pull request #3854 from exviva/validates_associated_marked_for_destruction
Do not validate associated records marked for destruction
2011-12-04 15:57:13 -08:00
Olek Janiszewski
a8134aceb3 Do not validate associated records marked for destruction
The main reason for this change is to fix a bug where
`validates_associated` would prevent `accepts_nested_attributes_for`
with `allow_destroy: true` from destroying invalid associated records.
2011-12-05 00:19:21 +01:00
Jon Leighton
4ded0dd2de Merge pull request #3851 from ebeigarts/fix_sequence_name
Fix sequence name with abstract classes.
2011-12-04 15:19:17 -08:00
Xavier Noria
4e74bd194b moves some auto explain logic to the subscriber [José Valim & Xavier Noria] 2011-12-04 13:53:26 -08:00
Xavier Noria
7f3ce35e19 simplifies ActiveRecord::ExplainSubscriber [José Valim & Xavier Noria] 2011-12-04 13:27:03 -08:00
Xavier Noria
d59bfeb119 Merge branch 'explain' 2011-12-04 11:55:53 -08:00
Xavier Noria
cfeac38e2b implements a much faster auto EXPLAIN, closes #3843 [José Valim & Xavier Noria]
This commit vastly reduces the impact of auto
explain logging when enabled, while keeping
a negligible cost when disabled.

The first implementation was based on the idea
of subscribing to "sql.active_record" when
needed, and unsubscribing once done. This is
the idea behind AR::Relation#explain. Subscribe,
collect, unsubscribe.

But with the current implementation of notifications
unsubscribing is costly, because it wipes an internal
cache and that puts a penalty on the next event.

So we are switching to an approach where a long-running
subscriber is listening. Instead of collecting the
queries with a closure in a dedicated subscriber, now
we setup a thread local.

If the feature is disabled by setting the threshold
to nil, the subscriber will call a method that does
nothing. That's totally cheap.
2011-12-04 11:52:12 -08:00
José Valim
0ec0c9abe1 Merge pull request #3853 from nashby/form_for_as_option
form_for with :as option uses "action_as" as css class and id
2011-12-04 11:25:12 -08:00
Aaron Patterson
c24928c3ad Merge pull request #3845 from sumbach/test-return-value-from-require
Add tests for the return value of require
2011-12-04 11:22:09 -08:00
Vasiliy Ermolovich
e29773f885 form_for with +:as+ option uses "action_as" as css class and id 2011-12-04 22:12:24 +03:00
Vijay Dev
3134b467f0 Merge branch 'master' of github.com:lifo/docrails 2011-12-04 23:56:46 +05:30
Edgars Beigarts
82ae5c40ea Fix sequence name with abstract classes. 2011-12-04 20:10:14 +02:00
José Valim
91a3e92cc2 Merge pull request #3850 from carlosantoniodasilva/readonly-attributes
Refactor readonly attributes conditional
2011-12-04 04:46:59 -08:00
Carlos Antonio da Silva
4e836e4de9 Refactor readonly attributes conditional 2011-12-04 09:21:34 -02:00
Vijay Dev
69341d3686 copy edits in the migrations guide 2011-12-04 16:29:11 +05:30
Xavier Noria
5dfdc69ef9 Merge pull request #3848 from arunagw/sqlite3_bump
SQlite3 Bump
2011-12-04 01:56:50 -08:00
Arun Agrawal
ac4763f5c0 SQlite3 Bump 2011-12-04 10:27:44 +05:30
Jason Noble
95213ac477 Be explicit about where to add/remove stuff to the migration 2011-12-03 19:31:45 -07:00
Jason Noble
b6d7ce9f23 Fix missing /ruby block 2011-12-03 19:31:45 -07:00
Jason Noble
718d0ea985 Be explicit of where the constraints are. 2011-12-03 19:31:45 -07:00
Jason Noble
914b85f124 Improve readability 2011-12-03 19:31:44 -07:00
Jason Noble
452b624e1e Be more friendly than "shut up" 2011-12-03 19:31:44 -07:00
Jason Noble
6589359ed1 A table format makes this section easier to read 2011-12-03 19:31:44 -07:00
Jason Noble
e9b3b9e5d8 This section is more about changing the output of running migrations 2011-12-03 19:31:44 -07:00
Jason Noble
d1ef1b2220 Improve readability 2011-12-03 19:31:44 -07:00
Jason Noble
90f18cc85e Readability improvements 2011-12-03 19:31:44 -07:00
Jason Noble
82ba3a79bf Move this into a section so that "Resetting the database" will show up in TOC 2011-12-03 19:31:44 -07:00
Jason Noble
d8c8bf5f05 Change wording to be more explicit on what migrating with a version does 2011-12-03 19:31:44 -07:00
Jason Noble
93d9845c30 Migrations can also run the "change" method 2011-12-03 19:31:44 -07:00
Jason Noble
4130fe3a5b Reword section to make it more readable. 2011-12-03 19:31:44 -07:00
Jason Noble
f41d099720 We're using methods, not writing them 2011-12-03 19:31:44 -07:00
Jason Noble
aca34b8e51 Change wording to be more understandable 2011-12-03 19:31:44 -07:00
Jason Noble
f7740f20f2 We're using the method, not writing it 2011-12-03 19:31:43 -07:00
Jason Noble
eedb863674 Change The other... to Another... 2011-12-03 19:31:43 -07:00
Jason Noble
74807383aa Reword confusing section 2011-12-03 19:31:43 -07:00
Jason Noble
a41295fdaa Correct grammatical errors 2011-12-03 19:31:43 -07:00
Jason Noble
bc6d1ebc66 It's more that Rails needs to know how to recreate the columns 2011-12-03 19:31:43 -07:00
Jason Noble
ec2727281c Added "also" to read better 2011-12-03 19:31:43 -07:00
Jason Noble
b3f8cbd9a8 Explain the t.timestamps method a little better 2011-12-03 19:31:43 -07:00
Jason Noble
1f765a2f72 Re-word confusing section 2011-12-03 19:31:43 -07:00
Jason Noble
c8f8ecfd38 Rollback is used elsewhere in the tutorial 2011-12-03 19:31:43 -07:00
Jason Noble
78f6672a43 Alphabetize fields to make reading easier 2011-12-03 19:31:43 -07:00
Jason Noble
f9cc3f0d8e Improve wording, fix some formatting issues 2011-12-03 19:31:43 -07:00
Jason Noble
9d87fb8f68 Constrained to 80 chars per line 2011-12-03 19:31:43 -07:00
Ryan Bigg
d7c2fcd856 Update layouts and rendering guide javascript_include_tag to bring it in line with Rails 3.1 2011-12-04 08:49:55 +11:00
Jon Leighton
e9b6659c4c Add missing require 2011-12-03 20:39:49 +00:00
Jon Leighton
3f23c049c2 Enable postgres on the CI ❤️ 🍺 2011-12-03 20:09:43 +00:00
Jon Leighton
51c2ef0b81 Avoid postgres 9.X syntax 2011-12-03 20:06:46 +00:00
Sam Umbach
cfc467f73e Simplify load and require tests
- These tests don't use autoloading so there's no need to add anything to autoload_paths
2011-12-03 13:11:02 -05:00
Sam Umbach
2a9f063082 Test that require and load raise LoadError if file not found 2011-12-03 13:08:18 -05:00
Sam Umbach
0a485309a0 Test return value of ActiveSupport::Dependencies::Loadable#load 2011-12-03 12:58:41 -05:00
Sam Umbach
93580f4936 Test return value of ActiveSupport::Dependencies::Loadable#require
- Add tests to protect from regressions in require's return value behavior
- See a10606c490 (require needs to return true or false) for the original bug fix
2011-12-03 11:52:25 -05:00
Jon Leighton
9c172b2931 Fix #3837.
We also need to time zone convert time zone aware attributes when
accessed via read_attribute, not only when via direct access.
2011-12-03 16:46:46 +00:00
Xavier Noria
de24ed9f2d removes the convenience instance version of AR::Base.silence_auto_explain
Rationale: As discussed with José and Jon, this convenience
shortcut is not clearly justified and it could let the user
thing the disabled EXPLAINs are related to the model instance
rather than being globally disabled.
2011-12-03 14:26:34 +01:00
Jon Leighton
a02691ce09 Merge pull request #3820 from jaylevitt/nested_loading_through_assoc
reintroduce patch from #726 to handle nested eager loading via associations
2011-12-03 04:01:14 -08:00
Jon Leighton
2e902d52eb Merge pull request #3833 from kennyj/fix_3678-3
Use show create table (fix 3678: third time).
2011-12-03 03:36:00 -08:00
José Valim
75981a9208 Merge pull request #3842 from arunagw/app_gen_test
App Generator test
2011-12-03 02:45:22 -08:00
Arun Agrawal
c4f18683d9 Simplifying test in app/generator 2011-12-03 16:12:02 +05:30
José Valim
2ab2077235 Fix failing cascade exception. 2011-12-03 11:38:25 +01:00
Jon Jensen
0e17cf17eb Restore performance of ERB::Util.html_escape
Revert html_escape to do a single gsub again, but add the "n" flag (no
language, i.e. not multi-byte) to protect against XSS via invalid utf8

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-12-03 10:36:52 +01:00
Vijay Dev
9ac6310bd9 fix a typo in query guide 2011-12-03 03:08:18 +05:30
Xavier Noria
3a967806ad yield > block.call 2011-12-02 11:44:04 -08:00
Xavier Noria
15dab0d2f5 two small details from the previous patch 2011-12-02 11:29:35 -08:00
Xavier Noria
0be5adaedf implements AR::Base(.|#)silence_auto_explain 2011-12-02 11:16:26 -08:00
Vijay Dev
36c014193e fix typo in railties changelog 2011-12-03 00:23:58 +05:30
Vijay Dev
ee45823072 revises Enumerable#pluck in AS guide 2011-12-02 23:53:21 +05:30
Vijay Dev
baa93a1c2e Merge branch 'master' of github.com:lifo/docrails 2011-12-02 23:43:52 +05:30
Vijay Dev
f402ef5766 rephrase doc on explain threshold 2011-12-02 23:41:50 +05:30
Arun Agrawal
3d550e5174 Added doc about pluck for active_support core ext 2011-12-02 23:15:08 +05:30
Xavier Noria
31a3124f05 Merge pull request #3832 from arunagw/indentation
indentation fix warning
2011-12-02 09:29:26 -08:00
Arun Agrawal
9a59475d4a indentation fix warning 2011-12-02 22:55:15 +05:30
kennyj
f3470b08c9 Use show create table. 2011-12-03 02:21:56 +09:00
Xavier Noria
36cc1f78eb revises some details in the previous explain patch 2011-12-02 09:19:13 -08:00
Jon Leighton
9acb340e88 Revert "Roflscaling!" (for now)
This reverts commit f6b5046305.

Fear not, the roflscale will return when I have a bit more time and
figure out a better way to do it. (In particular, a way that doesn't
break the build.)
2011-12-02 13:23:31 +00:00
Xavier Noria
0306f82e0c implements automatic EXPLAIN logging for slow queries 2011-12-02 04:35:43 -08:00
David Heinemeier Hansson
4d20de8a50 Added Enumerable#pluck to wrap the common pattern of collect(&:method) *DHH* 2011-12-02 13:00:56 +01:00
José Valim
76a3ec7f6e Try to play nice with plugins doing monkey patches. 2011-12-02 09:57:43 +01:00
Arun Agrawal
9f623e2109 [Docs] Information about ActionDispatch::DebugExceptions in rake task 2011-12-02 08:45:11 +05:30
Arun Agrawal
330db28018 Adding information about ActionDispatch::DebugExceptions 2011-12-02 08:44:32 +05:30
Jon Leighton
6bff6439b1 Fewer string allocations in attribute method 2011-12-01 23:41:51 +00:00
Jon Leighton
f6b5046305 Roflscaling!
Don't prefix the name with attribute_. Avoids a string allocation on
read_attribute, which is a bit faster.
2011-12-01 23:41:51 +00:00
Jon Leighton
9ead4130de Create method with known identifier then alias into place.
This means we never have to rely on define_method (which is slower and
uses more memory), even when we have attributes containing characters
that are not allowed in standard method names.

(I am mainly changing this because the duplication annoys me, though.)
2011-12-01 23:41:51 +00:00
Jon Leighton
bd920eae82 Remove some unnecessary code etc 2011-12-01 23:41:51 +00:00
Jon Leighton
e9fb6d04bd Add test for read_attribute(:id) with non-standard PK.
Also make it actually work.

It slows down all read_attribute accesses to map 'id' to whatever the PK
actually is, inside read_attribute. So instead make sure the necessary
methods are defined and that they redirect wherever they need to go.
2011-12-01 23:41:51 +00:00
Jon Leighton
f1a534af98 Remove the need for type_cast_attribute.
This is good because it reduces duplication.
2011-12-01 23:41:51 +00:00
Jon Leighton
47b97a739d Fix up test altering global state that was causing me grief 2011-12-01 23:41:51 +00:00
Jon Leighton
3a40d38619 Get rid of the underscore versions of attribute methods!
This makes me happy!
2011-12-01 23:41:51 +00:00
Jon Leighton
3dcb127109 Don't rely on underscore-prefixed attribute methods.
Define singleton methods on the attributes module instead. This reduces
method pollution on the actual model classes. It also seems to make
something faster, I am unsure why! O_o
2011-12-01 23:41:51 +00:00
Jon Leighton
365e10b8dc Remove unnecessary *args 2011-12-01 23:41:51 +00:00
Richard Hulse
d72a85c022 [docs] removed last-modifed line from examples
This is no longer best-practice.

ref:
http://stackoverflow.com/questions/8344186/rails-3-1-on-apache-pagespeed-says-specify-cache-validator-when-using-asset-p/8348385#8348385
2011-12-02 10:44:34 +13:00
José Valim
07f90f6bec Merge branch 'exceptions' with the following features:
* A Railtie API for registering new exceptions and their respective status code (check Active Record railtie for an example)

* Extraction of ShowExceptions middleware logging and debugging features into a middleware called DebugExceptions

Conflicts:
	actionpack/CHANGELOG.md
2011-12-01 21:18:47 +01:00
José Valim
6a4606d3a6 Remove unnecessary test setup. 2011-12-01 21:17:11 +01:00
José Valim
f9edc079e0 Split and improve show and debug exceptions middlewares. 2011-12-01 21:15:42 +01:00
José Valim
750bb5c865 Split ShowExceptions responsibilities in two middlewares. 2011-12-01 20:46:18 +01:00
David Heinemeier Hansson
83d29a283c Revert "Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack"
Needless indirection with no added value.

This reverts commit 535853e83b.
2011-12-01 20:45:47 +01:00
José Valim
956ecff833 Add a deprecation to old show exceptions API (even though it was not public). 2011-12-01 20:16:12 +01:00
José Valim
0b677b18ff Add an ExceptionWrapper that wraps an exception and provide convenience helpers. 2011-12-01 20:02:00 +01:00
David Heinemeier Hansson
535853e83b Added ActiveRecord::Base#last_modified to work with the new fresh_when/stale? conditional get methods from Action Pack 2011-12-01 19:47:14 +01:00
José Valim
b4359bc723 Allow rescue responses to be configured through a railtie. 2011-12-01 19:21:35 +01:00
David Heinemeier Hansson
218c272938 Allow fresh_when/stale? to take a record instead of an options hash [DHH] 2011-12-01 19:16:10 +01:00
Tim Sjoberg
bb2adab79b fixed finger-dyslexia in active_support core extensions guide 2011-12-01 14:27:51 +02:00
José Valim
1e51cd957e Update CHANGELOG. 2011-12-01 13:22:28 +01:00
José Valim
f8b934224f Merge pull request #3660 from jdelStrother/asset_protocol
default_asset_host_protocol should not default to :relative
2011-12-01 04:18:41 -08:00
Jonathan del Strother
88237daae4 Leave default_asset_host_protocol unset
When default_asset_host_protocol is left as nil, it will use absolute protocols when a request is present, and relative protocols otherwise (eg in asset generation)
2011-12-01 11:57:33 +00:00
José Valim
cb7145700d Merge pull request #3823 from avakhov/av-length-validation-exception-msg-fix
Fix argument error message for length validation
2011-11-30 22:09:56 -08:00
Alexey Vakhov
814a4c3160 Fix argument error message for length validation 2011-12-01 09:12:16 +04:00
Jon Leighton
52eedf5e2b Add hackery to make Syck use encode_with/init_with. Fixes 1.8 after recent changes to attribute serialization. 2011-12-01 01:15:16 +00:00
Jon Leighton
1c783c6040 don't alter global state in test 2011-11-30 23:47:16 +00:00
Julius de Bruijn
4e380828ff If the table behind has no primary key, do not ask again and just return nil. 2011-11-30 23:47:16 +00:00
Jon Leighton
7a4949e7d5 consistency 2011-11-30 23:18:41 +00:00
Jon Leighton
d5f7884dc5 Don't check column type, you might implement a custom coder that serializes to a different type 2011-11-30 23:18:40 +00:00
Jon Leighton
7895182d0f omg computer science!
Implement a mini state machine for serialized attributes. This means we
do not have to deserialize the values upon initialization, which means
that if we never actually access the attribute, we never have to
deserialize it.
2011-11-30 23:18:40 +00:00
Jon Leighton
4f20eb5908 Fix typo 2011-11-30 23:18:40 +00:00
Jon Leighton
035b4244ba Don't need second param 2011-11-30 23:18:40 +00:00
Jon Leighton
efcc95acb7 No longer need to undef id as we are defining it ourselves 2011-11-30 23:18:40 +00:00
Jon Leighton
6c63f1aa44 Move some serialization stuff out of Base 2011-11-30 23:18:40 +00:00
Jon Leighton
f4853dc174 Extract attribute serialization code into a separate module 2011-11-30 23:18:40 +00:00
Jon Leighton
61489dc684 Use inheritance to avoid special-case code for the 'id' method 2011-11-30 23:18:40 +00:00
Jon Leighton
4c33d517d9 #id is an alias for whatever the primary key is 2011-11-30 23:18:40 +00:00
Jon Leighton
40840aa9ea fix indent 2011-11-30 23:18:40 +00:00
Jay Levitt
24b8814db0 reintroduce patch from #726 to handle nested eager loading via associations 2011-11-30 18:12:24 -05:00
Vijay Dev
cbeeaa6ea0 expand on pluck docs 2011-12-01 01:42:54 +05:30
Vijay Dev
a72839bc9d minor typo fix 2011-12-01 01:42:54 +05:30
Vijay Dev
04b4fe77c9 s/is is/is 2011-12-01 01:42:54 +05:30
Yehuda Katz
a604983f8b Merge pull request #3816 from lest/exception-page-utf-8
fix exception page when template contains utf-8 and parameters contain utf-8
2011-11-30 11:45:18 -08:00
Leandro Santos
fca655f391 typo in the performance testing rails guide 2011-11-30 14:29:17 -05:00
Vijay Dev
0092f0612d Merge pull request #3786 from nashby/add-namespace-to-form
update guides for the namespace option in form helpers
2011-11-30 11:23:37 -08:00
Vijay Dev
9811c3624a fix bad nodocs 2011-12-01 00:34:21 +05:30
lest
13cab6ef50 fix exception page when template contains utf-8 and parameters contain utf-8 2011-11-30 21:51:01 +03:00
Aaron Patterson
5b3d4f0785 switch WatchStack to use composition, tighten up API 2011-11-30 10:17:27 -08:00
Vijay Dev
88daf08258 Merge branch 'master' of github.com:lifo/docrails 2011-11-30 23:32:01 +05:30
José Valim
5b2eb64ceb Revert "Implement ArraySerializer and move old serialization API to a new namespace."
This reverts commit 8896b4fdc8.

Conflicts:

	activemodel/lib/active_model.rb
	activemodel/lib/active_model/serializable.rb
	activemodel/lib/active_model/serializer.rb
	activemodel/test/cases/serializer_test.rb
2011-11-30 18:48:17 +01:00
Aaron Patterson
be99f0c7eb Revert "avoid hundreds of thousands of calls to (Symbol|String)#to_s"
Test coverage isn't comprehensive enough to catch what this breaks. :(
This reverts commit 45dad592e4.
2011-11-30 09:46:35 -08:00
Aaron Patterson
45dad592e4 avoid hundreds of thousands of calls to (Symbol|String)#to_s 2011-11-30 09:08:30 -08:00
Aaron Patterson
4da879079e run_test method conflicts with newer minitest, so change the name 2011-11-30 09:08:30 -08:00
Jeremy Kemper
b757663af7 Using InstanceMethods in a Concern is deprecated 2011-11-30 10:06:07 -07:00
José Valim
3b07bb33e1 Merge pull request #3810 from lest/fix-warnings
fix method redefined warnings in tests
2011-11-30 08:07:51 -08:00
lest
6ce924fa9f fix method redefined warning in activemodel 2011-11-30 18:57:17 +03:00
lest
93387e2e7c fix deprecation warnings in activeresource 2011-11-30 18:57:17 +03:00
lest
565d92f578 fix method redefined warnings in tests 2011-11-30 18:57:12 +03:00
José Valim
2b96b20f3a Merge pull request #3809 from lest/test-helpers-in-erb
fix warning in tests when using render_erb helper
2011-11-30 07:11:40 -08:00
lest
a985309abc fix warning in tests when using render_erb helper 2011-11-30 18:05:23 +03:00
José Valim
ae53fcc5a7 Merge pull request #3806 from lest/test-helpers-in-erb
Test helpers in erb using erb
2011-11-30 06:47:05 -08:00
lest
e975fe710a test helpers in erb using erb 2011-11-30 17:38:09 +03:00
Jon Leighton
271308cb96 Merge pull request #1915 from bogdan/active_record_map
ActiveRecord::Base.map method for direct select by single column
2011-11-30 01:41:09 -08:00
Bogdan Gusiev
a382d60f6a ActiveRecord::Relation#pluck method 2011-11-30 11:03:00 +02:00
José Valim
38ab982cff Log 'Filter chain halted as CALLBACKNAME rendered or redirected' every time a before callback halts. 2011-11-30 09:53:09 +01:00
José Valim
a6ee246e5c Update sprockets which theoretically fixes the regression we have seen. 2011-11-30 09:53:09 +01:00
José Valim
6093d88ed8 Fixes for using action view template in isolation. 2011-11-30 09:53:09 +01:00
Aviv Ben-Yosef
e3bc1385f1 Fixing incorrect documentation
`path_names` can only be used for affecting `new` and `edit`
2011-11-30 06:55:34 +02:00
Aaron Patterson
d9c2882077 Module#synchronize is deprecated with no replacement. Please use monitor from ruby's standard library. 2011-11-29 15:40:46 -08:00
Aaron Patterson
c606fe2c6f push synchronization in to each method. Reduces method calls and makes
it clear which methods are synchronized.
2011-11-29 15:30:04 -08:00
Aaron Patterson
0e2477b602 Automatic closure of connections in threads is deprecated. For example
the following code is deprecated:

Thread.new { Post.find(1) }.join

It should be changed to close the database connection at the end of
the thread:

Thread.new {
  Post.find(1)
  Post.connection.close
}.join

Only people who spawn threads in their application code need to worry
about this change.
2011-11-29 15:04:41 -08:00
Aaron Patterson
29d2040b29 AbstractAdapter#close can be called to add the connection back to the
pool.
2011-11-29 14:40:37 -08:00
Aaron Patterson
ce3d8d646a Start implementing @reserved_connections in terms of connection leases. 2011-11-29 14:02:59 -08:00
Aaron Patterson
5725e397fe Rename checked_out to more descriptive active_connections 2011-11-29 14:02:59 -08:00
Aaron Patterson
b72b477c37 Use connection lease to determine "checked_out" connections 2011-11-29 14:02:59 -08:00
Aaron Patterson
f866f66b30 expire will set in_use to false 2011-11-29 14:02:58 -08:00
Aaron Patterson
79306de791 last_use is set on connection lease 2011-11-29 14:02:58 -08:00
Aaron Patterson
134cc8f939 Leased connections return false on second lease 2011-11-29 14:02:58 -08:00
Aaron Patterson
9bf8bf82b9 Adapters keep in_use flag when leased 2011-11-29 14:02:58 -08:00
Aaron Patterson
7837574e5b namespace the adapter test 2011-11-29 14:02:58 -08:00
Jon Leighton
3da5fba56a Fix ruby 1.8 compat. const_defined? only takes a second arg on 1.9. 2011-11-29 20:43:05 +00:00
Jon Leighton
8df787d428 Deprecated define_attr_method in ActiveModel::AttributeMethods
This only existed to support methods like `set_table_name` in Active
Record, which are themselves being deprecated.
2011-11-29 20:13:37 +00:00
Jon Leighton
f3c84dc316 Deprecate set_locking_column in favour of self.locking_column= 2011-11-29 20:13:37 +00:00
Jon Leighton
1a474cc8e4 Deprecate set_primary_key in favour of self.primary_key= 2011-11-29 20:13:37 +00:00
Jon Leighton
4aad289428 Make sure the original_foo accessor still works (but deprecated) if we are using self.foo= 2011-11-29 20:13:37 +00:00
Jon Leighton
e51ecfaaa3 extract method 2011-11-29 20:13:37 +00:00
Jon Leighton
7af719e81c Deprecate set_sequence_name in favour of self.sequence_name= 2011-11-29 20:13:37 +00:00
Jon Leighton
fd7ca98bb6 Add tests for set_sequence_name etc 2011-11-29 20:13:36 +00:00
Jon Leighton
34609d67b4 Deprecate set_inheritance_column in favour of self.inheritance_column= 2011-11-29 20:13:36 +00:00
Jon Leighton
0b72a04d0c Deprecate set_table_name in favour of self.table_name= or defining your own method. 2011-11-29 20:13:36 +00:00
Aaron Patterson
f73f53455a respond_to? information of AR is not the responsibility of the spec
resolver.
2011-11-29 11:48:55 -08:00
Jon Leighton
2169603385 Merge pull request #3636 from joshsusser/master
association methods are now generated in modules
2011-11-29 10:09:42 -08:00
Josh Susser
c347b3c06c don't change class definition in test case 2011-11-29 09:14:21 -08:00
Jon Leighton
d534c8fbe2 Fix resolver_test.rb on travis (postgresql isn't setup, so it can't load the connection adapter) 2011-11-29 12:47:54 +00:00
Jon Leighton
1defb6adb8 Fix schema_cache_test.rb for sqlite3_mem 2011-11-29 12:29:42 +00:00
Vijay Dev
6e399acaa8 Merge pull request #3797 from HeeL/test
splited a long line to shorter ones
2011-11-29 02:23:06 -08:00
Sergey Parizhskiy
69d56cb933 splited a long line to shorter ones 2011-11-29 11:50:02 +02:00
Vijay Dev
42d70d9852 Merge pull request #3790 from masterkain/patch-1
Fix typo in AS::TaggedLogging
2011-11-29 00:30:00 -08:00
José Valim
913c42a6a9 Merge pull request #3793 from marcandre/asset_host
Handle correctly optional parameters for callable asset_host.
2011-11-28 23:56:42 -08:00
Marc-Andre Lafortune
d3bc12b27f Handle correctly optional parameters for callable asset_host. 2011-11-29 02:01:18 -05:00
Claudio Poli
2a76f33b51 Fix typo in AS::TaggedLogging 2011-11-29 00:26:58 +01:00
Aaron Patterson
52a9884ce4 remove unused instance variable 2011-11-28 15:23:26 -08:00
Aaron Patterson
beff819a4d just check in all connections 2011-11-28 15:23:26 -08:00
Aaron Patterson
884a04007f remove useless class_eval 2011-11-28 15:23:25 -08:00
Aaron Patterson
dde2113867 Move connection resoluion logic to it's own testable class. 2011-11-28 15:23:25 -08:00
Aaron Patterson
30f7c59e90 clean up string => hash conversion for connection pool 2011-11-28 15:23:25 -08:00
Aaron Patterson
ffb218c750 pools are 1:1 with spec now rather than 1:1 with class 2011-11-28 15:23:25 -08:00
Aaron Patterson
2a9a8ad4df break establish_connection to smaller methods 2011-11-28 15:23:24 -08:00
Travis Pew
237272e049 Fix ActionDispatch::Request method explanations
The methods, "post?", "put?", "head?", etc. contain an incorrect
explanation. They state that they are equivalent to request_method ==
:type, but this is not accurate because the methods convert the string
to a symbol. They are actually equivalent to:
  request_method_symbol == :type
2011-11-28 15:46:09 -05:00
Jakub Kuźma
d1afd98746 added information about callbacks created by autosave association (#3639) 2011-11-28 19:37:00 +01:00
Vasiliy Ermolovich
331080a14f update guides 2011-11-28 20:37:08 +03:00
Aaron Patterson
ba0b3eee14 Merge pull request #3768 from janv/master
Test and fix for Issue 3450
2011-11-28 09:35:43 -08:00
José Valim
a0c61c81d7 Merge pull request #3785 from lest/backtrace-cleaner-env
Put backtrace_cleaner to env
2011-11-28 08:43:14 -08:00
lest
fe7d4f09ef put backtrace_cleaner to env 2011-11-28 19:25:37 +03:00
Sergey Parizhskiy
afa31cf327 there is no need to repeat about possibility of using -h option to get full help 2011-11-28 17:40:14 +02:00
Sergey Parizhskiy
e2e2d6298e Merge branch 'master' of github.com:lifo/docrails 2011-11-28 17:33:23 +02:00
Sergey Parizhskiy
493cf44682 completed documentation for the rails server command 2011-11-28 17:33:01 +02:00
Vijay Dev
970caea5bc Merge pull request #3783 from HeeL/master
fixed a typo in a travis message
2011-11-28 07:18:22 -08:00
Rodrigo Rosenfeld Rosas
6d05c793ca Update information about foreign key plugins support in the guides
There is not "a number" of up-to-date maintained plugins for dealing with foreign keys.

The foreign_key_migrations does not have any update since 2009 and is also about to be removed:

Extracted from http://www.harukizaemon.com/2009/09/plugins-grab-em-while-theyre-stale.html,
referenced in the plugin reference of the old guide version:

"And so it is that I will very shortly (within the next month) delete most of the plugins from
my GitHub account (harukizaemon)"
2011-11-28 13:15:07 -02:00
Sergey Parizhskiy
cc5f68d56b fixed a typo in a message when there is no failuresin a build 2011-11-28 16:45:40 +02:00
José Valim
f4ce002c0e Merge pull request #3278 from arunagw/rails_rake_task_warning
Global variable `$rails_rake_task' not initialized Warning removed
2011-11-28 04:25:55 -08:00
Arun Agrawal
8ef1ec427f global variable `$rails_rake_task' not initialized Warning removed 2011-11-28 17:35:10 +05:30
José Valim
5f75a92c32 Merge pull request #3657 from arunagw/mysql2_bump_master
Bump Mysql2!
2011-11-28 03:15:30 -08:00
Vijay Dev
9ca58ba492 Revert "use any? to check for size"
This reverts commit c4af5f00f6.
2011-11-28 16:29:55 +05:30
José Valim
89925e817c Revert "Use any instead of length"
This reverts commit 1756629835.
2011-11-28 11:18:39 +01:00
Xavier Noria
152bd3c510 Revert "Used any? instead of length call"
Reason: This is slower, and any? is not equivalent in the
general case.

See discussion in https://github.com/rails/rails/pull/3779

This reverts commit 20cbf8eddc.
2011-11-28 11:07:01 +01:00
Marc Bowes
9d7795638d * A / is required if you want to explicitly skip the assets directory. This is important because public/assets is typically git-ignored.
* The asset id is no longer generated.
2011-11-28 11:55:14 +02:00
Arun Agrawal
e7dff9c1f1 Revert "fixed typo in getting started form_for for comments"
This reverts commit 2f428a6245.

See comments here 2f428a6245
2011-11-28 14:10:23 +05:30
Tim Reischmann
2f428a6245 fixed typo in getting started form_for for comments 2011-11-28 09:27:42 +01:00
José Valim
ad5c8b0d52 Merge pull request #3776 from nashby/add-namespace-to-form
add namespace options to form_for
2011-11-27 23:59:36 -08:00
Vasiliy Ermolovich
2559256963 update CHANGELOG 2011-11-28 10:54:12 +03:00
José Valim
5cf56a4e77 Merge pull request #3779 from rahul100885/rahul100885_work
Used any? instead of length call
2011-11-27 23:13:39 -08:00
Rahul P. Chaudhari
20cbf8eddc Used any? instead of length call 2011-11-28 12:07:31 +05:30
Josh Susser
124c97fbe2 avoid warnings
This change uses Module.redefine_method as defined in ActiveSupport.
Making Module.define_method public would be as clean in the code, and
would also emit warnings when redefining an association. That is pretty
messy given current tests, so I'm leaving it for someone else to decide
what approach is better.
2011-11-27 14:15:40 -08:00
Josh Susser
10834e975a changelog & docs for GeneratedFeatureMethods 2011-11-27 14:12:46 -08:00
Jan Varwig
cba5a3a367 Test case and fix for rails/rails#3450
Asssigning a parent id to a belongs_to association actually updates the object that is validated when the association has :validates => true
2011-11-27 22:29:56 +01:00
Jon Leighton
b00cf122e2 Merge pull request #3748 from samsonasu/has_many_custom_pk_new_record
New records should load has_many relationships with custom primary keys
2011-11-27 13:05:19 -08:00
Vasiliy Ermolovich
fb8b555c49 add namespace options to form_for
You can provide a namespace for your form to ensure uniqueness of id attributes on form elements.
The namespace attribute will be prefixed with underscore on the generate HTML id
2011-11-27 23:41:23 +03:00
Santiago Pastorino
af3aacaa47 Merge pull request #3773 from rahul100885/rahul100885_work
Use any instead of length
2011-11-27 12:11:41 -08:00
José Valim
0b7cd7b570 Merge pull request #3771 from kennyj/fix_rake_test_warnings
Call a block passed rake_tasks method in the self context
2011-11-27 11:25:07 -08:00
Josh Susser
61bcc318c8 use GeneratedFeatureMethods module for associations 2011-11-27 11:22:12 -08:00
José Valim
e7e046fa1c Merge pull request #3769 from kennyj/fix_index_html
avoid url started with "/" for the rails.png in public/index.html
2011-11-27 07:12:15 -08:00
José Valim
ee8db25e64 Merge pull request #3772 from lest/label-with-block
fix label with block in erb
2011-11-27 06:47:32 -08:00
Rahul P. Chaudhari
1756629835 Use any instead of length 2011-11-27 20:02:09 +05:30
lest
bc81ba2451 fix label with block in erb 2011-11-27 16:59:44 +03:00
kennyj
7f8f554d75 Call a block passed rake_tasks method in the self context 2011-11-27 22:49:37 +09:00
Tadas Tamošauskas
9cf285599c Update Object#in? description for https://github.com/rails/rails/pull/3767 2011-11-27 12:44:14 +00:00
kennyj
78ad94aaa7 avoid absolute path for the rails.png in index.html 2011-11-27 20:25:05 +09:00
Arun Agrawal
28e3935360 [Docs] Adding RequestId middleware in configuring middleware 2011-11-27 12:55:22 +05:30
Arun Agrawal
0ce64ba9aa Documentation about config.log_level config options 2011-11-27 12:34:14 +05:30
Alexey Vakhov
448df2d100 Cosmetic fixes in AM validatations docs 2011-11-27 10:23:40 +04:00
Yehuda Katz
3c81fc3b91 Merge pull request #3767 from tadast/object_in
Object#in? also accepts multiple parameters
2011-11-26 18:10:48 -08:00
Tadas Tamošauskas
ebf69ab163 Object#in? also accepts multiple parameters 2011-11-26 23:51:09 +00:00
José Valim
71b387d91e Merge pull request #3765 from qoobaa/orm-instance-fix
added tests to #3763
2011-11-26 11:05:28 -08:00
Jakub Kuźma
4e5eaae1fa added tests, replaced classify with constantize - using classify here cuts the last 's' in ORM name 2011-11-26 19:57:51 +01:00
José Valim
140a0e49e5 Merge pull request #3763 from qoobaa/orm-instance-fix
allow using orm_instance without invoking orm_class in generators
2011-11-26 10:28:36 -08:00
Vijay Dev
d157ca881b add more tests for monday and sunday methods 2011-11-26 23:53:57 +05:30
Vijay Dev
9030cdadff Merge pull request #3764 from arunagw/test_sunday_monday
Tests added for monday and sunday
2011-11-26 10:18:07 -08:00
Vijay Dev
ab854db649 documenting monday and sunday methods 2011-11-26 23:43:52 +05:30
Arun Agrawal
cd6c5677fb Tests added for monday and sunday
Reference commits : 
a8f2860d0e
80ac4dc6d0
2011-11-26 23:37:01 +05:30
Vijay Dev
80ac4dc6d0 Adds Time#sunday method 2011-11-26 23:15:11 +05:30
Vijay Dev
a8f2860d0e Convert aliases monday and sunday to methods
A recent change to beginning_of_week and end_of_week added an argument
that can be used to specify the week's starting day as a symbol. Now
these methods were aliased as monday and sunday respectively which as a
consequence of the argument addition, made calls like obj.monday(:sunday)
possible. This commit makes them methods on their own.
2011-11-26 23:08:58 +05:30
Arun Agrawal
fc20d6b681 Let's say this 3.1.3 instead of 3.1.1 in docs 2011-11-26 22:38:58 +05:30
Vijay Dev
8135e5e699 s/end_on_week/end_of_week 2011-11-26 22:06:47 +05:30
Vijay Dev
99ff8fdab5 minor doc changes 2011-11-26 22:06:47 +05:30
Jakub Kuźma
89d6db05d7 allow using orm_instance without invoking orm_class first in generators 2011-11-26 17:11:17 +01:00
José Valim
f754521675 Merge pull request #3760 from arunagw/warning_removed_unused_var
Warning removed unused variable
2011-11-26 06:35:42 -08:00
Arun Agrawal
9817a8b7d6 Warning removed unused variable 2011-11-26 19:30:11 +05:30
Vijay Dev
1d89540686 Merge branch 'master' of github.com:lifo/docrails 2011-11-26 19:14:39 +05:30
Vijay Dev
5c2a2ee76e rephrased ef38c3089e and
mentioned about OS X and windows usually having a JS runtime
2011-11-26 19:07:36 +05:30
Vijay Dev
c4af5f00f6 use any? to check for size 2011-11-26 18:52:10 +05:30
Xavier Noria
b6916e0b92 removes a Serialization constant left in the previous revert 2011-11-25 15:06:30 -08:00
Xavier Noria
b30b932447 finders guide: adds some pointers to help users interpret the output of EXPLAIN 2011-11-25 14:58:43 -08:00
Xavier Noria
1be9830d4d add the query to AR::Relation#explain output
Rationale: this is more readable if serveral queries
are involved in one call. Also, it will be possible
to let AR log EXPLAINs automatically in production
mode, where queries are not even around.
2011-11-25 14:29:34 -08:00
Xavier Noria
a5b362df56 some tweaks to PR#3547. [Closes #3547] 2011-11-25 12:02:49 -08:00
gregolsen
7a33a005d7 API docstrings updated with default value info 2011-11-25 12:02:49 -08:00
gregolsen
3f1a4c3415 beginning_of_week extended in both Time and Date so that to return week start based on start day that is monday by default 2011-11-25 12:02:49 -08:00
José Valim
0a4035b12a Revert the serializers API as other alternatives are now also under discussion 2011-11-25 19:29:39 +00:00
José Valim
2dab493867 Merge pull request #3756 from johnmdonahue/update-gem-action-linebreaks-and-indentation
Updating newline fix to maintain existing linebreaks and indentation and...
2011-11-25 09:44:14 -08:00
John Donahue
95e9b5fbfd Updating newline fix to maintain existing linebreaks and indentation and test for b/eol on inserts 2011-11-25 09:06:14 -08:00
Brian Samson
0f5104d720 load has_many associations keyed off a custom primary key if that key is present but the record is unsaved 2011-11-25 08:24:54 -07:00
José Valim
6f5fdf8179 Merge pull request #3747 from lest/middleware-logger
middlewares should have configurable logger
2011-11-25 05:33:26 -08:00
Uģis Ozols
a607a9d978 what's -> that's 2011-11-25 14:24:14 +02:00
Uģis Ozols
9a45867b09 Remove unnecessary comment. 2011-11-25 14:22:36 +02:00
Piotr Sarnacki
8ff8fa5e5f I suck, forgot to also change rake's task description 2011-11-25 12:54:39 +01:00
Piotr Sarnacki
c9bb099318 Display mounted engines in rake routes by default 2011-11-25 12:45:58 +01:00
lest
cd9d28d6fd middlewares should use logger from env 2011-11-25 13:09:46 +03:00
José Valim
fcacc6986a Merge branch 'serializers'
This implements the ActiveModel::Serializer object. Includes code, tests, generators and guides.

From José and Yehuda with love.

Conflicts:
	railties/CHANGELOG.md
2011-11-25 09:59:35 +00:00
José Valim
4565c871a6 Merge pull request #3752 from ganeshkumar/gem_lending
Added tests for #3751
2011-11-25 01:51:56 -08:00
José Valim
696d01f7f4 Add docs to serializers. Update CHANGELOGs. 2011-11-25 09:49:54 +00:00
ganesh
c8d7291b6b Added tests for #3751 2011-11-25 14:55:28 +05:30
José Valim
6d9f9b3b05 Add a hook for serializers in the scaffold generator (off for now). 2011-11-25 09:17:32 +00:00
José Valim
ebb8ea22f3 Add generators for serializers. 2011-11-25 09:14:05 +00:00
Piotr Sarnacki
0cd3bf8406 Allow to display engine's routes when running rake routes ENGINES=true 2011-11-24 16:16:00 +01:00
Piotr Sarnacki
30cf3e16a0 Merge pull request #3746 from qoobaa/active-model-naming-with-anonymous-classes
make ActiveModel::Name fail gracefully with anonymous classes
2011-11-24 06:56:46 -08:00
Jakub Kuźma
dc39af0a9a make ActiveModel::Name fail gracefully with anonymous classes 2011-11-24 15:50:21 +01:00
Piotr Sarnacki
a478389b7d Forgot to add CHANGELOG entry for config.railties_order 2011-11-24 13:40:27 +01:00
rpq
510502ee3a comma 2011-11-23 23:26:17 -05:00
Michael Pearson
ef38c3089e Move JS runtime instructions to where the error would be encountered, remove gem install. 2011-11-24 10:59:29 +11:00
José Valim
28bcda4098 Rename UserSerializer to DefaultUserSerializer in tests. 2011-11-23 23:53:20 +00:00
José Valim
7fcc8c0a1f Rely solely on active_model_serializer and remove the fancy constant lookup. 2011-11-23 23:45:27 +00:00
Michael Pearson
0e7443060b Add step to getting_started to install JS Runtime.
abstrakt on #rubyonrails found that the guide, when followed step by step,
does fails at the 'rails server' command due to a lacking JS runtime.
2011-11-24 10:33:04 +11:00
José Valim
6da52c617e Remove listings from the serialization guide that won't make 3.2. 2011-11-23 23:22:46 +00:00
José Valim
8896b4fdc8 Implement ArraySerializer and move old serialization API to a new namespace.
The following constants were renamed:

  ActiveModel::Serialization     => ActiveModel::Serializable
  ActiveModel::Serializers::JSON => ActiveModel::Serializable::JSON
  ActiveModel::Serializers::Xml  => ActiveModel::Serializable::XML

The main motivation for such a change is that `ActiveModel::Serializers::JSON`
was not actually a serializer, but a module that when included allows the target to be serializable to JSON.

With such changes, we were able to clean up the namespace to add true serializers as the ArraySerializer.
2011-11-23 23:18:15 +00:00
José Valim
0536ea8c78 Add safe_constantize to ActiveSupport::Dependencies. 2011-11-23 21:43:03 +00:00
José Valim
e6cfd85361 Merge pull request #3739 from lest/config-always-write-cookie
configuration option to always write cookie
2011-11-23 12:58:56 -08:00
lest
98a1717e7c configuration option to always write cookie 2011-11-23 23:50:04 +03:00
José Valim
e62de52aa3 Merge branch 'master' into serializers 2011-11-23 20:43:06 +00:00
Piotr Sarnacki
40b19e0635 Allow to change engine's loading priority with config.railties_order= 2011-11-23 21:36:33 +01:00
Yehuda Katz
8549f7a4f0 Merge pull request #3731 from HeeL/master
code stats calculation
2011-11-23 11:11:40 -08:00
Yehuda Katz
e9f63c55f8 Merge pull request #3733 from kennyj/fix_warnings_for_show_exceptions_test
Warnings removed. (ambiguous first argument)
2011-11-23 11:10:27 -08:00
José Valim
fd86a1b6b0 Rely on a public contract between railties instead of accessing railtie methods directly. 2011-11-23 19:06:45 +00:00
José Valim
3ee0116c94 Optimize cache expansion by skipping rails cache id in nested keys. 2011-11-23 18:22:09 +00:00
José Valim
2c568f1e45 Merge pull request #3738 from exviva/issues/3737_AS_cache_expand_cache_key
Issues/3737 AS::Cache.expand_cache_key
2011-11-23 10:17:34 -08:00
José Valim
f62f545f7c Merge pull request #3735 from kennyj/fix_3728
Fix #3728 Remove unreachable code, and add additional testcases.
2011-11-23 09:55:31 -08:00
Olek Janiszewski
a650dd05f8 Fix #3737 AS::expand_cache_key generates wrong key in certain situations (part 2)
`nil` and `false` both expand to `""` (empty string), while `true` expands to
`"true"`; `false` should expand to `"false"`
2011-11-23 18:11:38 +01:00
Olek Janiszewski
d8e6dc9cf1 Fix #3737 AS::expand_cache_key generates wrong key in certain situations
`cache_key` method is never called when the argument is a 1-element array
with something that responds to `cache_key`
2011-11-23 18:06:16 +01:00
kennyj
ea70e027b6 Remove unreachable code, and add additional testcases. 2011-11-24 00:25:34 +09:00
kennyj
453f5534b4 Warnings removed. (ambiguous first argument) 2011-11-24 00:10:34 +09:00
Sergey Parizhskiy
d78a7026fc improved code stats calculation, check on multiline comments and rewrite regexps according to a class naming convention 2011-11-23 14:10:30 +02:00
Marc Chung
745b7a1437 - Avoid using .first since it will create an additional query.
- Handle scenario where @posts is empty.
2011-11-22 17:04:19 -07:00
Yehuda Katz
a93ee92da2 Merge pull request #3725 from marcandre/twz_eql
Fix inconsistencies with Time{WithZone}#{hash,eql?}
2011-11-22 13:01:37 -08:00
Yehuda Katz
9b7be78820 Merge pull request #3724 from marcandre/media_default
stylesheet_tag default's media is "screen"
2011-11-22 12:38:05 -08:00
Marc-Andre Lafortune
a4912078c7 Fix inconsistencies with Time{WithZone}#{hash,eql?} 2011-11-22 15:37:16 -05:00
Marc-Andre Lafortune
05e02deb68 Make explicit the default media when calling stylesheet_tag and change the default generators. 2011-11-22 15:16:23 -05:00
José Valim
b13b49ccc1 Merge pull request #3718 from lest/fix-javascript-include-tag
javascript_include_tag should add '.js' to sources that contain '.'
2011-11-22 09:45:11 -08:00
Vijay Dev
5c61b7230e Revert "Added links to the 'Rails Initialization Guide', marked as a work in progress"
This reverts commit 6b4939c3fd.

Reason: This guide is still incomplete and is not yet reviewed or ready
to go to the index.
2011-11-22 23:14:13 +05:30
José Valim
39ecbfdab9 Merge pull request #3717 from lest/show-exceptions-refactor
Show exceptions refactor: controller should be responsible for choice to show exceptions
2011-11-22 07:19:39 -08:00
lest
3a1d51959b deprecation warning, changelog entry 2011-11-22 17:36:58 +03:00
lest
aa491f6a9c javascript_include_tag should add '.js' to sources that contain '.' 2011-11-22 16:39:07 +03:00
Arun Agrawal
13847ccb43 Bump Mysql2! 2011-11-22 18:47:27 +05:30
Vijay Dev
8cae31c800 remove nodoc on OrderedHash 2011-11-22 17:12:37 +05:30
lest
5bcd119b8d move show_detailed_exceptions? to Rescue module 2011-11-22 13:34:13 +03:00
lest
c6d6b28bb4 refactor show exceptions tests 2011-11-22 11:38:55 +03:00
lest
a9e8cf78fd add ActionController::Metal#show_detailed_exceptions? 2011-11-22 11:38:24 +03:00
Robert Ross
9dc9db1c99 Fix missing single quote that was messing up syntax highlighting. 2011-11-21 17:06:00 -08:00
Xavier Noria
8f57bf207f tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false
Respecting Genuine assert_equal false Edition
2011-11-21 14:22:16 -08:00
José Valim
401393b656 Deprecate InstanceMethods namespace handling in ActiveSupport::Concern.
This avoids the unnecessary "yo dawg, I heard you like include, so I put a module that includes your module when it is included" approach when building extensions.
2011-11-21 22:17:35 +00:00
Xavier Noria
f312e2142b Revert "tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false"
Reason: there were some genuine tests for false when
reading values, going to revise those ones.

This reverts commit a539a5e3f3.
2011-11-21 14:14:11 -08:00
Xavier Noria
a539a5e3f3 tests predicates according to the boolean interpretation of their return value, not expecting specifically true or false 2011-11-21 14:11:40 -08:00
Xavier Noria
f3554777b2 cache entry: options[:compressed] is a regular flag, no need for !! 2011-11-21 14:01:53 -08:00
Xavier Noria
91678a5b29 adds a comment to clarify an edge case 2011-11-21 13:53:40 -08:00
Xavier Noria
60e3e218c2 a couple of spurious spaces I saw in passing 2011-11-21 22:11:31 +01:00
Vijay Dev
4c872c017b Remove the -h option to dbconsole which is the shorter form of --header
This is done since the -h option to dbconsole hides the conventional
-h for help and forces users to use --help to see the usage options for
dbconsole.
2011-11-22 00:05:46 +05:30
Aaron Patterson
5d704fa152 oops! I suck! 💣 2011-11-20 15:11:11 -08:00
Aaron Patterson
008abd17dc fixing tests on ruby 1.8 2011-11-20 15:09:03 -08:00
Aaron Patterson
26c542ba2c Merge pull request #3701 from arunagw/arel_bump
Bump Arel
2011-11-19 23:17:26 -08:00
Arun Agrawal
be9d3a2008 Bump Arel 2011-11-20 12:27:25 +05:30
Aaron Patterson
599d7c40a4 removing deprecated methods 2011-11-19 20:43:04 -08:00
Aaron Patterson
3d2bd69385 Revert "copy options keys to the right place so that undo will work correctly"
This reverts commit 3178cc9a80.
2011-11-19 20:35:54 -08:00
Aaron Patterson
24fa524cef adding visitors to the respective adapters 2011-11-19 20:28:41 -08:00
Aaron Patterson
bd2f5c062d pushing caching and visitors down to the connection 2011-11-19 20:19:53 -08:00
James Dean Shepherd
5660a16d56 Minor grammar, typo & readability fixes for beginning of Rails Initialization guide 2011-11-20 02:36:50 +00:00
James Dean Shepherd
6b4939c3fd Added links to the 'Rails Initialization Guide', marked as a work in progress 2011-11-20 02:34:55 +00:00
Santiago Pastorino
4cdd44e3e0 Merge pull request #3668 from gregolsen/api_docstring_fix
updating API docstring so that user can infer default value
2011-11-19 11:52:44 -08:00
José Valim
43158e58b2 Merge pull request #3696 from lest/fix-plugin-generator
fix rails plugin new CamelCasedName bug
2011-11-19 11:04:39 -08:00
lest
c220b4d833 fix warning about instance variable in plugin generator 2011-11-19 21:58:30 +03:00
lest
39d2251d8a fix rails plugin new CamelCasedName bug
refs #3684
2011-11-19 19:09:09 +02:00
Yehuda Katz
bc04455f10 Merge pull request #3695 from tobiassvn/partial_path_error
Meaningful errors for unexpected partial arguments. Fixes #3573
2011-11-19 07:38:22 -08:00
Jon Leighton
fec85cf10d Perf fix
If we're deleting all records in an association, don't add a IN(..)
clause to the query.

Fixes #3672.
2011-11-19 14:11:29 +00:00
Jon Leighton
2ef4947ab0 Add missing CHANGELOG entry for #3678. Closes #3678. 2011-11-19 13:34:50 +00:00
Jon Leighton
603a679e87 Don't html-escape the :count option to translate if it's a Numeric. Fixes #3685. 2011-11-19 13:28:07 +00:00
Jon Leighton
86b5e81e8a Bump sprockets to 2.1.1 2011-11-19 13:08:34 +00:00
Tobias Svensson
771635e858 Meaningful errors for unexpected partial arguments. Fixes #3573 2011-11-19 13:05:57 +00:00
Jon Leighton
11afb74089 Merge pull request #3687 from kennyj/fix_3678-2
Use `show index from`. We could fix `pk_and_sequence_for` method's performance problem (GH #3678)
2011-11-19 05:00:37 -08:00
Jon Leighton
9c37416a3e Verify that #3690 has been closed by previous changes to the mysql
adapters.

These tests fail on the v3.1.2 tag.

Closes #3690.
2011-11-19 12:34:15 +00:00
Yehuda Katz
89bbb6ce21 Merge pull request #3689 from arunagw/warning_removed_actionpack
Warning removed for shadowing variable
2011-11-18 22:42:14 -08:00
Alexey Vakhov
efbb73562d Small docs fix in Active Model callbacks module 2011-11-19 12:19:59 +06:00
Arun Agrawal
d806ea2050 Warning removed for shadowing variable 2011-11-19 11:29:29 +05:30
Hendy Tanata
6fc2e12ec5 Some fixes on RELEASING_RAILS.rdoc. 2011-11-18 11:27:39 -08:00
kennyj
f9b9179016 Use show index from. We could fix pk_and_sequence_for method's performance problem (GH #3678) 2011-11-19 04:19:31 +09:00
Matt Burke
ed5586fa9e Add config.active_record.identity_map to the configuration guide. 2011-11-18 14:10:17 -05:00
Aaron Patterson
396ef44be4 Revert "make sure to require the right deprecation warning file"
This reverts commit 9d725e3df502a07222f35576108eb2df2bd88259.
2011-11-18 10:51:12 -08:00
Aaron Patterson
99d94f126d Refactoring the redirect method for the router api. 2011-11-18 10:51:12 -08:00
Aaron Patterson
d34efdd260 moving redirection to objects 2011-11-18 10:51:12 -08:00
Aaron Patterson
0809c675ef remove the :path feature to redirects, since it cannot work 2011-11-18 10:51:11 -08:00
Aaron Patterson
a8a4264858 make sure to require the right deprecation warning file 2011-11-18 10:51:11 -08:00
Aaron Patterson
163b645472 arity check has been pushed up, so no need for proc wrapping 2011-11-18 10:51:11 -08:00
Aaron Patterson
4589b2419b require that all blocks have arity of 2 2011-11-18 10:51:11 -08:00
Aaron Patterson
3178cc9a80 copy options keys to the right place so that undo will work correctly 2011-11-18 10:51:11 -08:00
Aaron Patterson
ecbae99478 no need for type checking 2011-11-18 10:51:11 -08:00
Aaron Patterson
636405d2a6 cleaning up variable names to match method parameter names 2011-11-18 10:51:10 -08:00
Aaron Patterson
33543ac871 stop doing is_a? checks on the resource type 2011-11-18 10:51:10 -08:00
Aaron Patterson
648f6113d1 move constants to methods since nothing else is using them 2011-11-18 10:51:10 -08:00
Aaron Patterson
7459ba4f6c pushing hash validation up 2011-11-18 10:51:10 -08:00
Aaron Patterson
494ab25772 breaking match down to smaller methods 2011-11-18 10:51:10 -08:00
Aaron Patterson
76780c34f5 some refactoring of the match method 2011-11-18 10:51:09 -08:00
Vijay Dev
dda6787f44 mailer guide - update info about using default host. Fixes #3642 2011-11-19 00:07:50 +05:30
Vijay Dev
48b580a03b Merge branch 'master' of github.com:lifo/docrails 2011-11-18 23:11:46 +05:30
Vijay Dev
9d035292ba remove unneeded params from issue tracker url 2011-11-18 23:10:12 +05:30
Vijay Dev
5a2db4c7c3 put back the removed eg 2011-11-18 23:09:30 +05:30
Aaron Patterson
2debbe1581 Merge pull request #3683 from christos/schema_introspection_speedup
Only used detailed schema introspection when doing a schema dump.
2011-11-18 09:37:29 -08:00
Vijay Dev
581ba1d946 Merge pull request #3681 from sikachu/fix_test_variable
Update variable's name in the test case to reflect the class we're testing
2011-11-18 09:33:26 -08:00
Christos Zisopoulos
280b2b725b Only used detailed schema introspection when doing a schema dump.
Fixes #3678
2011-11-18 18:29:47 +01:00
Prem Sichanugrist
0e2156d334 Update variable's name in the test case to reflect the class we're testing 2011-11-18 11:51:05 -05:00
Jon Leighton
d4119e144a Merge pull request #3680 from rubys/master
This fix causes the AWDwR test to go back to being green on Rails master.
2011-11-18 07:21:57 -08:00
Sam Ruby
42954c426b Stop db:seed from performing a reload of the db
Fix regression introduced by 38d26b0cb5
2011-11-18 10:05:06 -05:00
Vijay Dev
1c4564b620 Merge pull request #3666 from oscardelben/databases_rake_cleanup
Cleanup of databases.rake psql env variables
2011-11-18 04:21:56 -08:00
Xavier Noria
307fc122f6 release instructions: new section about docs generation 2011-11-18 13:05:25 +01:00
Philip Arndt
bc9b1e0a10 Fixed typo: expect -> expected 2011-11-18 23:50:14 +13:00
Vijay Dev
96792d2756 Merge pull request #3669 from parndt/patch-1
Fixed typo: expect -> expected
2011-11-17 23:40:33 -08:00
Edward Anderson
fe88745d5f Fix a number_with_delimiter :separator example 2011-11-17 20:10:49 -05:00
lest
e8d57f361a _html translation should escape interpolated arguments 2011-11-17 23:07:39 +00:00
Xavier Noria
1079724fe6 Revert "warn the user values are directly interpolated into _html translation strings"
Reason: After another round of discussion, it has been
decided to let interpolation deal with unsafe strings
as it should do.

This reverts commit d57d8098fc.
2011-11-17 23:59:19 +01:00
Aaron Patterson
a437986f43 allow people to set a local .Gemfile so that things like ruby-debug are not required for regular development 2011-11-17 14:41:53 -08:00
Xavier Noria
d57d8098fc warn the user values are directly interpolated into _html translation strings 2011-11-17 23:07:06 +01:00
Philip Arndt
e375970725 Fixed typo: expect -> expected 2011-11-18 10:17:16 +13:00
gregolsen
8d83e339fc updating API docstring so that user can infer default value 2011-11-17 22:17:33 +02:00
Vijay Dev
9b534060bf update guide: db:structure:dump produces structure.sql now 2011-11-18 01:17:21 +05:30
Aaron Patterson
a2f14e2344 Revert "Merge pull request #1163 from amatsuda/sexier_migration_31"
This reverts commit 0e407a9041, reversing
changes made to 533a9f84b0.

Conflicts:

	activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
	activerecord/test/cases/migration_test.rb
2011-11-17 10:29:28 -08:00
Aaron Patterson
649f2513a4 Revert "Merge pull request #3603 from vijaydev/change_table_without_block_arg"
This reverts commit 81fad6a270, reversing
changes made to 23101de283.

Conflicts:

	activerecord/test/cases/migration_test.rb
2011-11-17 10:29:28 -08:00
Oscar Del Ben
a89fabbb02 Cleanup of databases.rake psql env variables 2011-11-17 18:49:47 +01:00
Sunny Ripert
8d17af23ef Guides: better example to find the last sent email 2011-11-17 17:05:53 +01:00
José Valim
d8b2b6a183 Merge pull request #3663 from atambo/master
Move schema_format :sql config setting from test.rb to application.rb
2011-11-17 07:10:11 -08:00
Alex Tambellini
0af93089de Move schema_format :sql config setting from test.rb to application.rb
I've moved the schema_format :sql config setting to application.rb because you would
never enable this only for the test environment. If you use database constraints
or database specific data types you would want all of your environments to use them.
2011-11-17 09:44:17 -05:00
José Valim
e2d3060a68 Merge pull request #3654 from wildchild/label_i18n
Fix impractical I18n lookup in nested fields_for
2011-11-17 00:02:49 -08:00
Vijay Dev
e6f3299158 Merge pull request #3658 from arunagw/fix_initialize_var_name
It should be @calculated_ip not @calculate_ip
2011-11-16 23:30:45 -08:00
Arun Agrawal
c3ae1d2aec It should be @calculated_ip not @calculate_ip
We are using @calculated_ip. 
@calculate_ip is no where used
2011-11-17 12:50:19 +05:30
Vijay Dev
4148a7ca7d Merge pull request #3656 from arunagw/readline_to_read
No need to `readlines` then `join`, just use `read` ❤️
2011-11-16 23:00:40 -08:00
Arun Agrawal
5ccd9bcc1a No need to readlines then join, just use read ❤️
same as 4c1a1933cb
2011-11-17 12:24:40 +05:30
Alexander Uvarov
c2b6f63bbe Fix impractical I18n lookup in nested fields_for 2011-11-17 12:37:00 +06:00
Aaron Patterson
e367142255 Initialize our instance variables. 2011-11-16 16:55:11 -08:00
Aaron Patterson
70f9b74a49 Merge pull request #3649 from indirect/remote_ip
Fixes for Request#remote_ip (no middleware, all proxies)
2011-11-16 16:44:09 -08:00
Aaron Patterson
4c1a1933cb No need to readlines then join, just use read ❤️ 2011-11-16 16:18:00 -08:00
capps
64a3175eea "denoted" instead of "donated"
"parentheses" instead of "use brackets"
2011-11-16 15:57:54 -08:00
Aaron Patterson
bb95e81538 Adding a deprecation warning for use of the schema_info table. 2011-11-16 15:51:25 -08:00
Aaron Patterson
97ca6358c5 Join method uses empty string by default, so remove it 2011-11-16 15:40:20 -08:00
Aaron Patterson
b96aaf8ccb dbfile isn't supported anymore, so remove 2011-11-16 15:31:37 -08:00
Aaron Patterson
ca69408b49 Reduce schema format tests 2011-11-16 15:31:37 -08:00
Aaron Patterson
38d26b0cb5 Move conditionals to separate tasks so they can be reused. 2011-11-16 15:31:37 -08:00
Jon Leighton
272f2b778f Merge pull request #3500 from olivierlacan/error-whitespace
CSS fix to prevent error output from being breaking out of body element.
2011-11-16 15:26:31 -08:00
Jon Leighton
540e929d75 Merge pull request #3438 from lazyatom/becomes-includes-errors
Becomes includes errors
2011-11-16 15:23:44 -08:00
James Adam
73cb0f9828 ActiveRecord::Base#becomes should retain the errors of the original object.
This commit contains a simple failing test that demonstrates the behaviour we expect, and a fix. When using `becomes` to transform the type of an object, it should retain any error information that was present on the original instance.
2011-11-16 23:19:58 +00:00
Andre Arko
a9044d0117 the object itself isn't the IP, #to_s is the IP 2011-11-16 13:13:22 -10:00
Jon Leighton
a152fd34d3 Merge pull request #3608 from arunagw/unused_var_remove
Unused variable removed
2011-11-16 14:57:48 -08:00
Andre Arko
5621abd569 🤦 Request#remote_ip has to work without the middleware 2011-11-16 12:54:18 -10:00
Andre Arko
f05ccf805a Revert "Revert "Merge pull request #3640 from indirect/remote_ip""
This reverts commit 8d1a2b3ecd, because I have fixed the issues this commit caused in the next commit.
2011-11-16 12:53:43 -10:00
Aaron Patterson
cef1e14e09 removing some useless conditionals 2011-11-16 14:46:20 -08:00
Aaron Patterson
43821bf351 Merge pull request #2948 from atambo/master
schema_format :sql should behave like schema_format :ruby
2011-11-16 14:37:24 -08:00
Jon Leighton
3a6a10a36d Switch from marshal format to plain text for the encoding conversions dump. This is for windows compatibility. Fixes #3644. 2011-11-16 21:38:06 +00:00
Aaron Patterson
61228e9a0c fixing tests on PG 2011-11-16 13:25:55 -08:00
Aaron Patterson
df5ec41b89 bundler treats trunk ruby as ruby 1.9, hack around that for now 2011-11-16 10:42:56 -08:00
Daniel Dyba
325abe9fba Substituted RailsCommands for Rails::Commands 2011-11-16 10:26:28 -08:00
Daniel Dyba
21c5a0a104 Changed Commands module to RailsCommands.
This is to avoid a conflict that occurs when you add Rake to
your Gemfile. There is a Commands Object in Rake that conflicts
with the Commands module in plugin.rb. See rails issue #1866.
2011-11-16 10:23:00 -08:00
Aaron Patterson
936404399d Merge pull request #3634 from RyanNaughton/fixes_3483
Fixes 3483
2011-11-16 09:26:02 -08:00
Josh Susser
9cdf33af0b add test for super-ing to association methods 2011-11-15 23:32:58 -08:00
Josh Susser
7cba6a3784 association methods are now generated in modules
Instead of generating association methods directly in the model
class, they are generated in an anonymous module which
is then included in the model class. There is one such module
for each association. The only subtlety is that the
generated_attributes_methods module (from ActiveModel) must
be forced to be included before association methods are created
so that attribute methods will not shadow association methods.
2011-11-15 23:32:58 -08:00
rpq
bc00514b62 added comma 2011-11-15 23:20:21 -05:00
Jon Leighton
8d1a2b3ecd Revert "Merge pull request #3640 from indirect/remote_ip"
This reverts commit 6491aadc52, reversing
changes made to 83bf0b626c.

See https://github.com/rails/rails/pull/3640#issuecomment-2752761 for
explanation.
2011-11-15 22:47:18 +00:00
Yehuda Katz
6491aadc52 Merge pull request #3640 from indirect/remote_ip
GetIp#to_s should never return nil. That's icky.
2011-11-15 13:59:31 -08:00
Vijay Dev
83bf0b626c refactor test_multiple_of 2011-11-16 02:36:36 +05:30
Sergey Parizhskiy
df08273d14 made url to a github issues a bit shorter - no need in a page param when it's a first page 2011-11-15 13:09:41 +02:00
Arun Agrawal
76b6027cd8 Unused variable removed 2011-11-15 13:23:27 +05:30
Ryan Naughton
63a22ca616 Fixes issue #3483, regarding using a mixture of ranges and discrete values in find conditions. Paired with Joey Schoblaska. 2011-11-14 21:43:27 -06:00
Gabriel Sobrinho
e1b79c56be Failing test case for issue #3483 2011-11-14 21:39:03 -06:00
Andre Arko
d743954792 GetIp#to_s should never return nil. That's icky. 2011-11-14 16:43:21 -10:00
Jon Leighton
c7ab43ff06 Merge pull request #3632 from indirect/b8c85de
unit test for fix from a few minutes ago
2011-11-14 15:06:41 -08:00
Andre Arko
b8c85de620 add test for bug fixed in 4f2bf64 2011-11-14 12:29:51 -10:00
José Valim
25c9e44a21 Merge pull request #3631 from indirect/remote_ip
Force calculation of remote IP before using || operator
2011-11-14 13:27:36 -08:00
Andre Arko
4f2bf6491c Return the calculated remote_ip or ip
This was an especially nasty bug introduced in 317f4e2, by the way that an instance of GetIp is not nil, but GetIp#to_s could sometimes return nil. Gross, huh?
2011-11-14 11:23:33 -10:00
Andre Arko
cda1a5d5fe memoize the relatively expensive remote IP code 2011-11-14 11:20:57 -10:00
Andre Arko
00a0a4ddeb cleaner names 2011-11-14 11:20:20 -10:00
José Valim
9fa329b754 Speed up attribute invocation by checking if both name and calls are compilable. 2011-11-14 20:12:17 +01:00
José Valim
2088f1b3b4 Merge pull request #3626 from guilleiguaran/include-therubyrhino-gemfile
Added therubyrhino to default Gemfile under JRuby
2011-11-14 09:53:57 -08:00
Yehuda Katz
1df22bbb0f Merge pull request #3628 from oscardelben/refactoring
use any? instead of !empty?
2011-11-14 09:52:12 -08:00
Jon Leighton
be777b30d5 Add a note to REALEASING_RAILS about testing the gem locally before releasing 2011-11-14 17:08:24 +00:00
Jon Leighton
156784fef1 rake release should push the tag 2011-11-14 16:55:31 +00:00
Oscar Del Ben
af64ac4e5c use any? instead of !empty? 2011-11-14 16:56:05 +01:00
Aaron Patterson
11c9fc9364 Merge pull request #3371 from yahonda/fix_ora_00932_error
Fix ORA-00932 error when trying to insert 0 to DATE type columns.
2011-11-14 04:36:55 -08:00
Jon Leighton
ca3b468937 Sync changelog entry 2011-11-14 12:23:43 +00:00
Jon Leighton
4d8081b6e7 Add note about checking postgres tests before release 2011-11-14 12:17:13 +00:00
Guillermo Iguaran
49cd6a0ff7 Added therubyrhino to default Gemfile under JRuby 2011-11-14 07:07:38 -05:00
Jon Leighton
d023078b95 Merge pull request #3625 from guilleiguaran/sprockets-2.1.0
Upgrade Sprockets to 2.1.0
2011-11-14 03:40:17 -08:00
Jon Leighton
c7b84689a4 Add note about syncing CHANGELOGs 2011-11-14 11:29:57 +00:00
Jon Leighton
da02f792fe Sync CHANGELOGs from 3-1-stable 2011-11-14 11:28:12 +00:00
Guillermo Iguaran
e0eb2292bb Upgrade Sprockets to 2.1.0
This version brings bug fixes for performance and caching.
2011-11-14 06:25:03 -05:00
Yehuda Katz
2ec8d52b0c Merge pull request #3622 from noefroidevaux/issue_3595
Fix pull request #3609
2011-11-13 13:38:45 -08:00
José Valim
d37e169856 Merge pull request #3623 from indirect/remote_ip
Remote IP fixes/cleanup
2011-11-13 12:34:23 -08:00
Andre Arko
9c4532bf74 remove ignored flag, fixes warnings 2011-11-13 10:22:12 -10:00
Andre Arko
2d063c6269 turns out the tests expect remote_addrs.first 2011-11-13 10:20:55 -10:00
Andre Arko
2189bff732 correctly raise IpSpoofAttackError message 2011-11-13 10:20:29 -10:00
Andre Arko
8f0085a483 change tests to expect X-F-F over REMOTE_ADDR 2011-11-13 10:19:54 -10:00
Jason Noble
8971cca7d0 Move tooltip on re-running rails new with a different --database option 2011-11-13 10:20:03 -07:00
Vijay Dev
e0efe48c45 Merge branch 'master' of github.com:lifo/docrails 2011-11-13 22:29:26 +05:30
Vijay Dev
30122307a1 copy edits in getting started guide 2011-11-13 22:27:44 +05:30
Vijay Dev
af51409de4 Revert "Move Tip up higher so users who are fine with SQLite can skip to the next section"
This reverts commit 4bf057b866.

Reason: Prefer to keep the configuration of all databases at the same
level
2011-11-13 22:07:54 +05:30
Vijay Dev
c8c08bd000 Revert "Use rails help new instead of rails new -h"
This reverts commit 6ac65c9202.
2011-11-13 21:57:39 +05:30
Vijay Dev
e1099eb4fd Revert "Update guide to use Ruby 1.9 hash syntax"
This reverts commit 50a9de514f.

Reason: Let's keep the guides at 1.8 syntax
2011-11-13 21:50:18 +05:30
José Valim
2591cc6692 Merge pull request #3617 from indirect/remote_ip
refactor RemoteIp middleware
2011-11-13 04:53:51 -08:00
Jason Noble
50a9de514f Update guide to use Ruby 1.9 hash syntax 2011-11-13 03:15:56 -07:00
Jason Noble
a3156ac0f2 Add output for add_index command 2011-11-13 03:15:22 -07:00
Jason Noble
0774f22941 Convert tables to table format 2011-11-13 03:13:58 -07:00
Jason Noble
c0ee497436 Grammar change 2011-11-13 03:12:13 -07:00
Noé Froidevaux
bf6efa8d9c Fix pull request #3609 2011-11-13 11:03:22 +01:00
Jason Noble
5e83491e97 Be explicit on where the show.html.erb is located 2011-11-13 01:40:28 -07:00
Jason Noble
3e3872b598 Make the guide more friendly
- Changed Rails 3.0 to 3.0+
2011-11-13 01:35:08 -07:00
Jason Noble
9b96f7414e Be explicit about changing code 2011-11-13 01:33:29 -07:00
Jason Noble
cb552f807e p.errors.full_messages is a little more human readable 2011-11-13 01:32:26 -07:00
Jason Noble
fc8f0a85b5 Add link to AR Validations and Callbacks to further explain validations 2011-11-13 01:31:33 -07:00
Jason Noble
1394c5447a Update wording to read better 2011-11-13 01:31:07 -07:00
Jason Noble
06a8d16c8e Update wording to be more explicit on what the timestamp fields track 2011-11-13 01:29:11 -07:00
Jason Noble
094bb8e50c Update order so they show up in the order they do in the scaffolding output 2011-11-13 01:28:09 -07:00
Jason Noble
434fbe454c Update wording to flow better 2011-11-13 01:27:14 -07:00
Jason Noble
703d5c2033 Fix typo 2011-11-13 01:26:23 -07:00
Jason Noble
4bf057b866 Move Tip up higher so users who are fine with SQLite can skip to the next section 2011-11-13 01:25:45 -07:00
Jason Noble
194a42e7aa Updated wording to read better 2011-11-13 01:24:44 -07:00
Jason Noble
b778a7eefb Updated wording on what 'rails new blog' did for the user
- Alphabetized the files/folders created
- Added link to Configuring Rails Applications
2011-11-13 01:21:40 -07:00
Jason Noble
6ac65c9202 Use rails help new instead of rails new -h 2011-11-13 01:19:21 -07:00
Jason Noble
ee100128c3 Move paragraphs to flow better
- Give the user a way to know they are fully installed and ready to continue
2011-11-13 01:19:01 -07:00
Jason Noble
962c55de0d Add Tip about skipping to Section 3 if they want to come back to the philosophy later 2011-11-13 01:16:58 -07:00
Cheah Chu Yeow
f323b425f2 Fix bad English. 2011-11-13 13:35:32 +08:00
Cheah Chu Yeow
d9703fe92e Clearing cache in action caching is not "the exact same way" as with page caching. 2011-11-13 13:34:16 +08:00
Cheah Chu Yeow
650ec898e5 Suggest a workaround for page caching and parameters instead of an unhelpful warning. 2011-11-13 13:25:39 +08:00
Cheah Chu Yeow
a02b40a3d2 Fix "in memory" where it should be "in-memory". 2011-11-13 13:18:55 +08:00
Santiago Pastorino
df300a754b Allow to use ruby-debug in 1.9.3 2011-11-12 15:16:53 -02:00
Jon Leighton
8f20d59e6e Merge pull request #3618 from amatsuda/ad_headers_unmemoizable
Unneeded require 'active_support/memoizable'
2011-11-12 06:49:47 -08:00
Akira Matsuda
b74aedff3c Unneeded require memoizable 2011-11-12 23:15:54 +09:00
Andre Arko
317f4e2236 defer calculating the remote IP until requested 2011-11-12 00:45:31 -10:00
Andre Arko
9432163c60 refactor RemoteIp middleware
- return the last forwarded IP before REMOTE_ADDR to handle proxies
- remove completely superfluous RemoteIpGetter class
- remove duplication of trusted proxies regexp
- remove unused constant from Request
- move comments from Request to where they are actually relevant
- edit comments for clarity of purpose

The original code (confusingly) tried to return REMOTE_ADDR both at the beginning and the end of the chain of options. Since REMOTE_ADDR is _always_ set, this is kind of silly. This change leaves REMOTE_ADDR as the last option, so that proxied requests will be assigned the correct remote IP address.
2011-11-11 21:25:08 -10:00
Prem Sichanugrist
84908fa382 For what it's worth; Update memcache-client gem name 2011-11-11 13:34:55 -05:00
Xavier Noria
c3035e1800 Merge pull request #3613 from mitio/fix-actionpack-responder-docs
Fix wording and minor typos in the Responder RDoc
2011-11-11 10:03:29 -08:00
Dimitar Dimitrov
a766d834a7 Fix wording and minor typos in the Responder RDoc 2011-11-11 19:52:38 +02:00
José Valim
b7052a0c22 Merge pull request #3611 from bogdan/compile_options
AS::Callbacks::Callback#_compile_option refactored
2011-11-11 08:03:02 -08:00
Bogdan Gusiev
8483c7c0a6 AS::Callbacks::Callback#_compile_option refactored 2011-11-11 14:27:40 +02:00
Vijay Dev
9fd0cd3a12 Revert "Fix "in memory" where it should be "in-memory"."
This reverts commit e34e4d4330.

Reason: code changes are not allowed in docrails.
2011-11-11 17:12:42 +05:30
Aaron Patterson
1c6d6b637e Merge pull request #3609 from noefroidevaux/issue_3595
Prevent multiple SHOW TABLES calls when a table don't exists in database...
2011-11-11 03:38:49 -08:00
Noé Froidevaux
27c5800c9c Prevent multiple SHOW TABLES calls when a table don't exists in database. 2011-11-11 12:09:51 +01:00
José Valim
7352efa6f8 Merge pull request #3607 from bogdan/callbacks
AS::Callbacks.__run_keyed_callback: remove unused cache
2011-11-11 02:02:59 -08:00
Cheah Chu Yeow
df5c9fd9f4 Update Memcached website to its new one at http://memcached.org/. 2011-11-11 17:07:02 +08:00
Cheah Chu Yeow
e34e4d4330 Fix "in memory" where it should be "in-memory". 2011-11-11 17:04:50 +08:00
Vijay Dev
2e5c4717ba change_table bulk test case should check if the connection supports bulk alter 2011-11-11 12:47:03 +05:30
José Valim
81fad6a270 Merge pull request #3603 from vijaydev/change_table_without_block_arg
Modify change_table to remove the need for the block argument
2011-11-10 14:39:00 -08:00
Vijay Dev
6e112e4217 Modify change_table to remove the need for the block argument. 2011-11-11 02:47:27 +05:30
Vijay Dev
b9aaa317cf update ci file name in contributing guide 2011-11-11 01:50:42 +05:30
Wojciech Wnętrzak
9ce5d5155b fixed example code indentation 2011-11-10 18:52:39 +01:00
Jean Boussier
fd17ffc7a2 Fix a tiny typo in custom validators documentation 2011-11-10 18:49:37 +01:00
José Valim
23101de283 Merge pull request #3600 from vijaydev/migration_arity
Checking the arity of the block passed to create_table
2011-11-10 09:37:58 -08:00
Vijay Dev
b805c71655 Checking the arity of the block passed to create_table
A recent change made to create_table does away with the
need for the block argument. Checking the arity will prevent the
mixing up of the two syntaxes.
2011-11-10 22:55:13 +05:30
Vijay Dev
74233d48e6 Fixes deprecation warning about passing a template handler
in the template name while generating guide related pages
like index, layout and credits
2011-11-10 22:36:20 +05:30
Bogdan Gusiev
08cc49b919 AS::Callbacks.__run_keyed_callback: remove unused cache 2011-11-10 16:42:27 +02:00
José Valim
80f96ebcf5 self.class.name -> self.name (we are already inside a class). 2011-11-10 08:57:09 -02:00
José Valim
bdd76fb5e3 Merge pull request #3592 from avakhov/av-highlight-regexp
Fix and simplify highlight regexp
2011-11-10 02:53:43 -08:00
José Valim
909e5cc32d Merge pull request #3591 from tylercoville/fix-plugin-new
Fixed error with 'rails generate new plugin' where the .gitignore was not
2011-11-10 02:53:19 -08:00
José Valim
c778f4e84b Merge pull request #3593 from bogdan/callbacks
AS::Callbacks._define_runner better abstraction
2011-11-10 02:50:46 -08:00
José Valim
d2cfa982fd Merge pull request #3581 from amatsuda/metal_response_body_19
AC::Metal#response_body= stores different value in Ruby 1.8 and 1.9
2011-11-10 00:49:14 -08:00
Bogdan Gusiev
bf6e29e007 AS::Callbacks#_define_runner refactored
Incapsulate the logic of keyed callback method definition and execution
in the separated method.
2011-11-10 10:25:27 +02:00
Alexey Vakhov
b5c3987294 Fix and simplify highlight regexp 2011-11-10 11:26:42 +04:00
Tyler Coville
49349089ad Fixed error with 'rails generate new plugin' where the .gitignore was not properly generated if --dummy-path was used and added test case 2011-11-09 23:22:26 -08:00
Alexey Vakhov
983a2dccaa Cosmetic fix in number_to_currency docs 2011-11-10 09:45:57 +04:00
Akira Matsuda
be7ab83b64 A test case to ensure that AC::Metal#response_body= always wraps the given value in an Array in both Ruby 1.8 and 1.9 (refs #3581) 2011-11-10 10:54:56 +09:00
José Valim
a625523e75 Don't marshal dump twice when using encryptor. 2011-11-09 20:21:52 -02:00
José Valim
71e84a3b51 Deprecated ActiveSupport::MessageEncryptor#encrypt and decrypt. 2011-11-09 20:04:42 -02:00
José Valim
4c59170bb3 Merge pull request #3589 from amatsuda/console_extend_command_bundle_fix
Extend IRB right before starting IRB to remove dependency on IRB from Rails::Application
2011-11-09 14:04:04 -08:00
Akira Matsuda
a658fd2ffa Extend IRB right before starting IRB to remove dependency on IRB from Rails::Application 2011-11-10 06:59:55 +09:00
José Valim
f686d9429f Use head :no_content on the guides as well. 2011-11-09 19:06:02 -02:00
José Valim
4857339aab Merge pull request #3509 from amatsuda/console_extend_command_bundle
move Rails console top level methods to IRB context
2011-11-09 02:14:50 -08:00
Akira Matsuda
6d09f275c6 Modulize Rails console methods so that other console libraries such as Pry can include these methods 2011-11-09 15:42:19 +09:00
Vijay Dev
fba28ece7e Merge pull request #3579 from arunagw/missing_md_in_changelog
CHANGELOG => CHANGELOG.md
2011-11-08 22:26:31 -08:00
Arun Agrawal
f642724f27 CHANGELOG => CHANGELOG.md
I missed these in previous commit
2011-11-09 11:54:07 +05:30
Vijay Dev
2843d3b277 Merge pull request #3574 from arunagw/refactor_testing_uncommitted_task
Refactor test:uncommitted task.
2011-11-08 22:15:29 -08:00
Arun Agrawal
5f826ea26f Refactor test:uncommitted task.
Thanks to @sobrinho (Gabriel Sobrinho)
2011-11-09 09:46:51 +05:30
Aaron Patterson
6e87281b5f Merge pull request #3572 from amatsuda/ar_exists_uniq_order
exclude ORDER BY clause when querying Relation#exists?
2011-11-08 12:39:50 -08:00
Akira Matsuda
74c6e80cab exclude ORDER BY clause when querying Relation#exists? 2011-11-09 04:51:11 +09:00
Vijay Dev
5b21bfa848 Merge pull request #3562 from rahul100885/rahul100885_work
Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md
2011-11-08 10:04:41 -08:00
Rahul Chaudhari
8e5686658e Updated Rakefile as CHANGELOG has been renamed to CHANGELOG.md 2011-11-08 23:20:38 +05:30
Vijay Dev
cff1d751d0 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	railties/guides/source/active_record_querying.textile
2011-11-08 21:35:17 +05:30
Joost Baaij
1ffd5ec910 Replace example with SQL placeholder syntax.
This works just fine, is less code, and reduces the risk of someone implementing a SQL injection vulnerability.
2011-11-08 16:27:15 +01:00
Alexey Vakhov
979f3f894b Fix small typo in link_to_function doc 2011-11-08 18:01:19 +04:00
José Valim
34f61f8b1d Merge pull request #3568 from bfolkens/master-url_subdomain_with_numeric_host
Fix trouble using :subdomain in development environment when using numeric addresses.
2011-11-08 06:00:22 -08:00
Bradford Folkens
bd559b0068 Fix trouble using :subdomain in development environment when using numeric addresses.
See-also pull request #3561 from 3-1-stable

    Otherwise the following occurs:

    TypeError: can't convert nil into String
        /Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:75:in host_or_subdomain_and_domain'
        /Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/http/url.rb:37:in url_for'
        /Users/bfolkens/dev/bfolkens-rails-core/actionpack/lib/action_dispatch/routing/url_for.rb:147:in test_subdomain_may_be_accepted_with_numeric_host'
        /Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/testing/setup_and_teardown.rb:67:in run'
        /Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:426:in send'
        /Users/bfolkens/dev/bfolkens-rails-core/activesupport/lib/active_support/callbacks.rb:81:in run'
2011-11-08 07:52:35 -06:00
José Valim
1347665d89 Merge pull request #3564 from arunagw/uncommitted_rake_fix
Should be checking if file exists or not.
2011-11-08 02:28:41 -08:00
Arun Agrawal
fe67501e62 Should be checking if file exists or not.
I found this bug when running rake test:uncommitted 
on a newly generated rails app which don't have
test file for application_controller.
Can see detail here #3461
2011-11-08 15:51:47 +05:30
Xavier Noria
805e39b025 Merge pull request #3565 from arunagw/warning_remove_release_file
Warnings removed.
2011-11-08 01:24:58 -08:00
Arun Agrawal
b3175f6cb9 Warnings removed. 2011-11-08 14:28:28 +05:30
Vijay Dev
588faedaf4 Merge pull request #3563 from arunagw/changelog_to_md
CHANGELOG to CHANGELOG.md
2011-11-07 23:54:28 -08:00
Arun Agrawal
b53f77ec99 CHANGELOG to CHANGELOG.md 2011-11-08 12:56:51 +05:30
Vijay Dev
f5ca190bd3 fix typo again (Thanks Phillip Oertel) 2011-11-08 10:37:06 +05:30
José Valim
396638c3fd Merge pull request #3552 from evtuhovich/master
Doc patch, DrbStore no more exists in rails
2011-11-07 07:09:06 -08:00
Ivan Evtukhovich
cf0a96bc6a DrbStore removed from cache backends 2011-11-07 18:57:55 +04:00
Vijay Dev
6ac56ac93b fix incorrect code example 2011-11-07 17:58:03 +05:30
Aaron Patterson
6a29ea04ae Merge pull request #3549 from luckydev/rmethod
remove_method tests and changes
2011-11-07 03:02:26 -08:00
Anand
aabd61af8e added remove_method core_ext tests 2011-11-07 16:22:52 +05:30
Anand
4cef581fcf replaced remove and define method calls to :redefine 2011-11-07 16:22:30 +05:30
Xavier Noria
17ecdd388c adds trailing +s to the output of EXPLAIN for MySQL 2011-11-07 02:01:56 -08:00
José Valim
1a8df8aa88 Merge pull request #3542 from amatsuda/controller_generator_remove_blank_line
Remove redundant blank line at the bottom of generated controller code
2011-11-07 01:56:03 -08:00
Akira Matsuda
cc3e738d89 Fix AC::Metal#response_body= to store same value on Ruby 1.8 and 1.9
This was because String#respond_to?(:each) differs in 1.8 and 1.9
2011-11-07 16:24:54 +09:00
Xavier Noria
b454601be4 revises EXPLAIN tests for SQLite3
The output in Travis is a bit different. The SQLite
documentation (http://www.sqlite.org/eqp.html) warns
output may change dramatically between releases. I
do not want to mock the result set because I want a
real EXPLAIN to happen. I prefer a test that may fail
in future releases than a test that may give false
positives in future releases.
2011-11-06 22:21:05 -08:00
Akira Matsuda
42cf5eba26 Remove redundant blank line at the bottom 2011-11-07 14:31:12 +09:00
Akira Matsuda
aff9e68cb5 document fix: remove_column takes multiple column_names 2011-11-07 14:03:33 +09:00
Aaron Patterson
bcdc2c00d3 Merge pull request #3541 from dvyjones/fix-datetime-warnings
Removed argument throwing warnings when running tests
2011-11-06 19:00:07 -08:00
Akira Matsuda
55b203dac1 self.up, self.down => up, down 2011-11-07 11:56:50 +09:00
Henrik Hodne
9a7d916ceb Removed argument throwing warnings when running tests.
The last argument to DateTime.new/civil is the Julian day number for
when the calendar reform occured. DateTime ignores it if it's 0, and
sets it to the default of DateTime::ITALY instead, so we could just
leave it out. This also removes the warnings while running the
ActiveSupport tests (there still are some for the setup though).
2011-11-06 17:35:02 +01:00
Vijay Dev
4db1bd37cb fix typo 2011-11-06 22:03:30 +05:30
Aaron Patterson
9b46613780 Merge pull request #3521 from nulogy/fix_postgres_adapter_to_handle_spaces_between_schemas
Fix postgres adapter to handle spaces between schemas
2011-11-06 13:16:07 -03:00
José Valim
6950639998 Merge pull request #3536 from pkumar/master
Make pluralize follow singularize's logic of uncountability check
2011-11-06 05:59:31 -08:00
Pavan Kumar Sunkara
1934b77406 Added the test case for #3537 2011-11-06 19:22:46 +05:30
Dalibor Nasevic
759906d512 Fixed stale doc in AbstractController::Layouts 2011-11-06 14:43:11 +01:00
Vijay Dev
8750c9a1cf fix markups for plus in AR guide 2011-11-06 18:59:29 +05:30
Vijay Dev
17947cebc0 Merge branch 'master' of github.com:lifo/docrails 2011-11-06 17:27:44 +05:30
Jon Leighton
8a2f0a9623 RUBY_ENGINE is not defined on 1.8 2011-11-06 10:54:59 +00:00
Jon Leighton
fc988115f7 Implement a workaround for a bug in ruby-1.9.3p0.
The bug is that an error would be raised while attempting to convert a
template from one encoding to another.

Please see http://redmine.ruby-lang.org/issues/5564 for more details.

The workaround is to load all conversions into memory ahead of time,
and will only happen if the ruby version is *exactly* 1.9.3p0. The
hope is obviously that the underlying problem will be resolved in
the next patchlevel release of 1.9.3.
2011-11-06 10:40:00 +00:00
Jon Leighton
7776055e2d Revert "Skip test_default_external_works on the CI for Ruby 1.9.3."
This reverts commit 10773f94ea.
2011-11-06 10:39:59 +00:00
José Valim
a02bb72cf7 Merge pull request #3537 from dvyjones/refactor-pluralize-singularize
Refactored pluralize and singularize into a common method
2011-11-06 02:20:06 -08:00
Henrik Hodne
52fa34faee Refactored pluralize and singularize into a common method.
See diff discussion on rails/#3536.
2011-11-06 11:13:51 +01:00
Jon Leighton
62512b9fb9 Merge pull request #3535 from jmazzi/master
Update ActiveRecord#attribute_present? to work as documented
2011-11-06 01:27:29 -08:00
Alexey Vakhov
949b3e743f Docs cosmetic fixes in Action View form_helper.rb 2011-11-06 11:46:28 +04:00
Justin Mazzi
c7d2078596 Update ActiveRecord#attribute_present? to work as documented
"Returns true if the specified attribute has been set by the user or by
a database load and is neither nil nor empty?"

Fixes #1613
2011-11-05 22:36:19 -04:00
Xavier Noria
e7b7b44123 implements AR::Relation#explain
This is a first implementation, EXPLAIN is highly
dependent on the database and I have made some
compromises.

On one hand, the method allows you to run the most
common EXPLAIN and that's it. If you want EXPLAIN
ANALYZE in PostgreSQL you need to do it by hand.

On the other hand, I've tried to construct a string
as close as possible to the ones built by the
respective shells. The rationale is that IMO the
user should feel at home with the output and
recognize it at first sight. Per database.

I don't know whether this implementation is going
to work well. Let's see whether people like it.
2011-11-05 18:30:19 -07:00
Xavier Noria
89d7372dac Merge pull request #3534 from guilleiguaran/arel-git-gemfile
Add arel to Gemfile on apps generated in edge Rails
2011-11-05 17:28:52 -07:00
Guillermo Iguaran
44e751fdd4 Add arel to Gemfile on apps generated in edge Rails 2011-11-05 19:26:23 -05:00
Xavier Noria
4d9f779b54 bumps up sprockets 2011-11-05 15:33:36 -07:00
Xavier Noria
56f16e25e9 fixes typo 2011-11-05 12:09:18 -07:00
Xavier Noria
d287e90870 implements AS::Notifications.subscribed, which provides subscriptions to events while a block runs 2011-11-05 12:02:54 -07:00
Xavier Noria
b33232f1b2 expands the documentation of AS::Notifications 2011-11-05 10:29:41 -07:00
Jon Leighton
f575e21025 Merge pull request #3525 from kennyj/fix_3440-1
Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440)
2011-11-05 10:29:18 -07:00
Jon Leighton
f140445b1d Revert "Merge pull request #2378 from cesario/remove_warnings_activemodel"
This reverts commit 6aaae3de27, reversing
changes made to fdbc4e5f4e.

Reason: build failure.
2011-11-05 17:21:58 +00:00
kennyj
fb0bf3c984 Fixed an issue id false option is ignored on mysql/mysql2 (fix #3440) 2011-11-06 02:15:47 +09:00
Vijay Dev
55621504b0 make class name consistent with the filename 2011-11-05 22:31:39 +05:30
Jon Leighton
10773f94ea Skip test_default_external_works on the CI for Ruby 1.9.3.
This test is affected by a bug in Ruby 1.9.3p0 and trunk:
http://redmine.ruby-lang.org/issues/5564

Given we cannot fix it for ourselves, it is better to skip for now so
that we will easily see if further failures are introduced.

Jon Leighton is monitoring the bug report and will revert this when a
suitable solution is found (either a new Ruby release or a generic
workaround).

If you are using 1.9.3 in your app and have templates that are not in
UTF-8, you should add a workaround early on in the boot process. For
example, if your templates are Shift_JIS encoded, then add the
following in an initializer:

Encoding::Converter.new('Shift_JIS', 'UTF-8')
2011-11-05 16:42:53 +00:00
Jon Leighton
9a111c7cf9 Use uniq instead of manually putting a DISTINCT in the query 2011-11-05 16:22:18 +00:00
Jon Leighton
562583c766 Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL query 2011-11-05 16:22:18 +00:00
Vijay Dev
6aaae3de27 Merge pull request #2378 from cesario/remove_warnings_activemodel
Remove warnings by calling remove_method
2011-11-05 08:44:16 -07:00
Vijay Dev
fdbc4e5f4e Merge branch 'master' of github.com:lifo/docrails 2011-11-05 20:45:11 +05:30
Vijay Dev
09298e4257 Revert "outline two ways to invoke a custom active model validator"
This reverts commit d163d3bf7e.

Reason: The alternate approach can be documented in the guide and
not disrupt the existing flow in the readme.
2011-11-05 20:43:04 +05:30
Vijay Dev
53f61acdca Revert "make the inline text a comment in the code block"
This reverts commit 36a5f48f93.

Reason: Editing .gitignore in docrails is not allowed. Docrails is meant
only for documentation.
2011-11-05 20:38:07 +05:30
Jon Leighton
2751e213d8 Merge pull request #3529 from vjebelev/ar_ordered_indexes2
AR changes to support creating ordered (asc, desc) indexes
2011-11-05 08:03:19 -07:00
Florian Walch
bcd25e7576 Fixed after_initialize/after_find guide
Defining after_initialize and after_find as ordinary methods like documented
in the guide doesn't work with Rails 3.1.1; now macro-style is used here, too.
2011-11-05 13:34:01 +01:00
Alex Tambellini
15fb4302b6 schema_format :sql should behave like schema_format :ruby
This commit adds a db:structure:load task that is run instead of
db:schema:load when schema_format is set to :sql. This patch also removes
the prefixing of the structure.sql files to mimic the use of a single
schema.rb file. The patch originates from github issue #715.
2011-11-04 17:34:08 -04:00
Vlad Jebelev
69dcd45aea AR changes to support creating ordered (asc, desc) indexes 2011-11-04 15:45:24 -05:00
Vijay Dev
cb06727b6c add tests for the case where size is explicitly passed to number_field helper 2011-11-04 22:32:40 +05:30
Jon Leighton
76dedf0232 Merge pull request #3517 from arunagw/test_fix_activerecord
Fix test as one more has_many added
2011-11-04 07:04:43 -07:00
Arun Agrawal
6da558660c Fix test as one more has_many added 2011-11-04 19:30:59 +05:30
Jon Leighton
0fcf8bfbe9 Merge pull request #3516 from cesario/fix_gemspec
Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md
2011-11-04 06:54:32 -07:00
Franck Verrot
1679aa56f3 Synchronize the gemspecs since CHANGELOG has been renamed to CHANGELOG.md 2011-11-04 14:46:39 +01:00
Jon Leighton
281272ad36 Convert CHANGELOGs to Markdown format.
Reasons:

 * Markdown reads well as plain text, but can also be formatted.
 * It will make it easier for people to read on the web as Github
   formats the Markdown nicely.
 * It will encourage a level of consistency when people are writing
   CHANGELOG entries.

The script used to perform the conversion is at
https://gist.github.com/1339263
2011-11-04 12:55:17 +00:00
Jon Leighton
e6cc2ea201 Allow the :class_name option for associations to take a symbol.
This is to avoid confusing newbies, and to be consistent with the fact
that other options like :foreign_key already allow a symbol or a string.
2011-11-04 11:17:56 +00:00
José Valim
2c67845271 Merge pull request #3514 from waseem/remove_size_attribute_from_number_field
Remove 'size' attribute from number_field form helper fixes #3454
2011-11-04 03:31:39 -07:00
Aaron Patterson
0e407a9041 Merge pull request #1163 from amatsuda/sexier_migration_31
Sexier migrations
2011-11-04 03:29:59 -07:00
Karthik Muthupalaniappan
36a5f48f93 make the inline text a comment in the code block 2011-11-04 15:22:50 +05:30
Karthik Muthupalaniappan
d163d3bf7e outline two ways to invoke a custom active model validator 2011-11-04 15:18:37 +05:30
Waseem Ahmad
56207a3f01 Remove 'size' attribute from number_field form helper fixes #3454
f.number_field generates <input type="number", size="30"../> which is
invalid HTML5. See: http://dev.w3.org/html5/spec/Overview.html#number-state
2011-11-04 15:03:02 +05:30
Jeremy Kemper
533a9f84b0 Merge pull request #3507 from jmazzi/issue-3503
Preserve SELECT columns on the COUNT for finder_sql when possible
2011-11-03 21:17:15 -07:00
Henrik Hodne
8611f14caf Added bundle exec to rake test.
This is in response to rails/rails#3504.
2011-11-03 22:19:49 +01:00
Akira Matsuda
7102a3d7fc move Rails console top level methods to IRB context 2011-11-04 05:31:47 +09:00
Jon Leighton
b5f908a7ad Stub find_template so that when handle_render_error is called in ActionView::Template, we get to see the actual underlying error rather than a NoMethodError.
This shows an encoding bug on Ruby 1.9.3.
2011-11-03 19:08:09 +00:00
Jon Leighton
d486103570 Fix #3271.
Building the conditions of a nested through association could
potentially modify the conditions of the through and/or source
association.

This is a Bad Thing.
2011-11-03 15:12:08 +00:00
Olivier Lacan
a50f659e08 CSS fix to prevent error output from being breaking out of body element.
Using the white-space: pre-wrap adds extra line breaks to prevent the text from breaking out of the element's box. In this case single line output can be extremely long, breaking out the <body> element.

See for reference: http://www.quirksmode.org/css/whitespace.html

Before: http://link.olivierlacan.com/BVU4
After: http://link.olivierlacan.com/BUfM
2011-11-03 10:01:32 -04:00
Jon Leighton
567d454d99 Memoize through association 2011-11-03 13:24:39 +00:00
Jon Leighton
19b2a5f2bd Remove all revelant through records.
If a record is removed from a has_many :through, all of the join records
relating to that record should also be removed from the through
association's target.

(Previously the records were removed in the database, but only one was
removed from the in-memory target array.)
2011-11-03 13:13:13 +00:00
Jon Leighton
71bc921ec8 Fix adding multiple instances of the same record to a has_many :through.
Fixes #3425.
2011-11-03 12:39:05 +00:00
Jon Leighton
b4b178f7e9 Fix #3247.
Fixes creating records in a through association with a polymorphic source
type.
2011-11-03 10:23:42 +00:00
Alexey Vakhov
a8468731f7 Fix javascript_include_tag examples in documentation 2011-11-03 09:02:11 +04:00
Alexey Vakhov
7463317115 Fix small typos in routing docs 2011-11-03 08:43:28 +04:00
Vijay Dev
bc09a11a66 minor edit 2011-11-02 23:34:27 +05:30
Vijay Dev
b3c1cfa277 minor edits in AR validations guide 2011-11-02 23:01:30 +05:30
José Valim
982a0f37f5 Merge pull request #3494 from sinisterchipmunk/usage-erb
treat USAGE as an ERB template
2011-11-02 06:41:46 -07:00
Colin MacKenzie IV
5745a5e85e treat USAGE as an ERB template 2011-11-02 09:00:18 -04:00
Jeremy Kemper
836b620850 Revert "Disable 1.9.3 builds until upgraded from -preview1 to -rc1"
This reverts commit 8a6acc17bb.
2011-11-01 17:41:37 -07:00
Vijay Dev
9aa880f2e8 use relative urls for linking to sections in the guides 2011-11-02 00:37:18 +05:30
juandebravo
ed4bde5a09 Fix wrong link in initialization doc 2011-11-01 20:45:00 +02:00
Aviv Ben-Yosef
702aecb126 Fix typo in Dispatcher#controller documentation 2011-11-01 08:59:20 +02:00
Alexey Vakhov
5f4550889d Fix typo in constraints method documentation 2011-11-01 08:55:03 +04:00
Ryan Bigg
e28bd7b226 [config guide] mention that config methods are to be called on Railtie subclasses 2011-11-01 11:18:17 +11:00
Ryan Bigg
dfdbbe059f [engines guide] add 'General engine configuration' section 2011-11-01 11:15:14 +11:00
Aaron Patterson
62a86748ae this should never return nil, so no use for "try" 2011-10-31 15:17:16 -04:00
Christopher Meiklejohn
6cbe4223a7 Ensure that the format isn't applied twice to the cache key, else it becomes impossible to target with expire_action. 2011-10-31 15:10:07 -04:00
Vijay Dev
1afe269a4a assert_match takes a regexp and a string in that order 2011-10-31 19:01:03 +05:30
José Valim
2407a7ad8d Merge pull request #3477 from rud/stable-migrations-version-order-rebased
dump_schema_information: explicitly order inserts into schema_migrations
2011-10-31 03:01:02 -07:00
Laust Rud Jacobsen
ff9c2799c1 dump_schema_information: explicitly order inserts into schema_migrations table
This change reduces churn in the db/development_structure.sql file when using :sql as
active_record.schema_format, and makes comparing diffs much easier.

Test ensures the output SQL-statements are lexically ordered by version.
2011-10-31 10:36:13 +01:00
Alexey Vakhov
d106b34bd5 Update routing guides, root route should be at the top of the file 2011-10-31 10:36:38 +04:00
Gonçalo Silva
2d337ef080 Fix typo on the performance test guide 2011-10-30 18:34:49 -02:00
Santiago Pastorino
818bf1da0e Merge pull request #3469 from kennyj/dont_use_old_code
Refactor ActiveSupport::Cache::FileStore.
2011-10-30 09:42:39 -07:00
kennyj
7670a5187d Refactor ActiveSupport::Cache::FileStore. used method and deleted duplicate code. 2011-10-30 21:50:17 +09:00
Vijay Dev
3e6ecfb454 Merge pull request #3468 from kennyj/fix_a_document_for_compress_limit
fix a document for :compress_threshold. DEFAULT_COMPRESS_LIMIT is 16K.
2011-10-30 03:29:18 -07:00
kennyj
38da6249f0 fix a document for :compress_threshold. DEFAULT_COMPRESS_LIMIT is 16K. 2011-10-30 19:18:23 +09:00
Xavier Noria
c6b933faa9 prefer qualified constant "name" to "reference expression", much simpler 2011-10-30 02:25:25 -07:00
Vijay Dev
c809de8291 Merge branch 'master' of github.com:lifo/docrails 2011-10-30 14:47:23 +05:30
Xavier Noria
9d1ba3755e fixes a typo (thanks to Alexey Vakhov) 2011-10-30 02:08:59 -07:00
Santiago Pastorino
75ee4d97ef Merge pull request #3464 from kennyj/avoid_to_call_twice
avoided to call `Marshal.dump` twice
2011-10-29 19:18:46 -07:00
Xavier Noria
11f6795b23 defines Module#qualified_const_(defined?|get|set) and String#deconstantize
This commit also implements a faster version of #demodulize I was unable
to isolate with git add --patch.

Not a big fan of the name #deconstantize. It complements #demodulize
getting rid of the rightmost constant, hence the name, but it is
unrelated to the well-known #constantize. So unsure. Could not come
with anything better, please feel free to rename.
2011-10-29 18:10:45 -07:00
Santiago Pastorino
8ef1bd9b29 Merge pull request #3463 from kennyj/fix_document_for_cache
fix a document for race_condition_ttl. ActiveSupport::Cache::MemoryCache isn't exist.
2011-10-29 17:53:00 -07:00
Jeremy Kemper
eabda416b7 Removing db/seeds.rb is fine. Don't blow up. 2011-10-29 14:14:13 -07:00
kennyj
3b546afd04 avoided to call twice 2011-10-30 03:14:35 +09:00
kennyj
7b65d12db5 fix a document for race_condition_ttl. ActiveSupport::Cache::MemoryCache isn't exist 2011-10-30 01:55:09 +09:00
José Valim
e848bcacdd Merge pull request #3462 from kennyj/remove_deprecated_code
removed a reference to SynchronizedMemoryStore and CompressedMemCacheStore
2011-10-29 09:40:28 -07:00
kennyj
596d625c9b removed reference to SynchronizedMemoryStore and CompressedMemCacheStore (the remaining code from 9cafc28874) 2011-10-30 01:32:02 +09:00
José Valim
e886f97669 Merge pull request #3337 from htanata/fix_rake_routes_for_controller_only_route
Remove trailing "#" on rake routes for controller only routes
2011-10-29 09:03:45 -07:00
Xavier Noria
e22a4c6f28 Merge pull request #3460 from arunagw/method_redefine_warning_removed
method redefined warning removed!
2011-10-29 06:20:21 -07:00
Hendy Tanata
010622bb98 On inpsect routes, show :controller and :action to indicate dynamic. 2011-10-29 20:04:33 +08:00
Arun Agrawal
3fa8f362ad method redefined warning removed! 2011-10-29 16:09:50 +05:30
Vijay Dev
74f3f19a83 Merge pull request #3459 from arunagw/running_test_doc_fix
ActiveRecord is no more in controller directory.
2011-10-29 01:53:06 -07:00
Xavier Noria
0fc531392d let demodulize do less work, and add tests
This is also faster on 1.9.
2011-10-29 01:07:54 -07:00
Arun Agrawal
0c7c1dbc41 ActiveRecord is no more in controller directory. 2011-10-29 12:34:08 +05:30
Joost Baaij
f936996f69 Updated links to authentication plugins.
Removed mention of restful_authentication.
Added devise and authlogic.
Also mention Rails 3.1 built-in logic.
2011-10-28 13:24:14 +02:00
José Valim
2e74334abd Merge pull request #3456 from pwim/documentation-fix
Add missing type to number_field_tag documentation
2011-10-27 23:42:22 -07:00
Paul McMahon
07c4297282 Add missing type to number_field_tag documentation 2011-10-28 15:37:45 +09:00
Aaron Patterson
4a065d56ed clear statement cache when tables are altered 2011-10-27 10:55:52 -07:00
Joe Van Dyk
420f7fd507 Added failing test case for changing schema in migration not clearing the prepared statement cache 2011-10-27 10:50:38 -07:00
José Valim
1ad9138c00 Merge pull request #3449 from arunagw/checks_for_instance_writers
More checks for instance writers.
2011-10-27 04:05:06 -07:00
Arun Agrawal
95d9c120d3 More checks for instance writers. 2011-10-27 16:25:50 +05:30
José Valim
a9863d672b Merge pull request #3448 from arunagw/instance_disable_fix
Test fix Allow instances to disable record_timestamps
2011-10-27 03:26:47 -07:00
Arun Agrawal
80fc29f36f Adding more checks for instance_writer false 2011-10-27 15:47:56 +05:30
Arun Agrawal
485b99611b Test fix Allow instances to disable record_timestamps
Removed here 0d0176c4ff
2011-10-27 15:41:15 +05:30
José Valim
30c0a0023b Merge pull request #3445 from odorcicd/fix_railtie_wrap_parameter_test
Fix railtie configuration test calling PostsController#create which didn'
2011-10-26 23:57:13 -07:00
Denis Odorcic
177f893a28 Fix railtie configuration test calling PostsController#create which didn't exist 2011-10-27 02:16:59 -04:00
Aaron Patterson
9027643798 scumbag 1.8: strings are enumerable :'( 2011-10-26 10:30:52 -07:00
Pratik Naik
0d0176c4ff Allow instances to disable record_timestamps 2011-10-26 18:20:12 +01:00
Vijay Dev
a89d16b39b Merge pull request #3439 from bradrobertson/master
ActiveModel::Validator only takes one parameter, documentation had two params listed.
2011-10-26 07:27:15 -07:00
bradrobertson
2e62af310d correct documentation on initialize method to accept a single parameter 2011-10-26 09:31:37 -04:00
Santiago Pastorino
408bbfe6bd Merge pull request #3435 from MDaubs/action_pack_deprecations
Fix deprecation warnings in action pack render tests
2011-10-26 00:36:36 -07:00
José Valim
80768b739e Responders now return 204 No Content for API requests without a response body (as in the new scaffold) 2011-10-26 09:31:56 +02:00
José Valim
aef62c4b4e Scaffold returns 204 No Content for API requests without content. This makes scaffold work with jQuery out of the box. 2011-10-26 09:29:38 +02:00
José Valim
20c59dd214 Fix failing tests. 2011-10-26 09:20:24 +02:00
Henare Degan
df5f88c7c0 Fix a little typo 2011-10-26 19:03:53 +12:00
Aaron Patterson
450257c95b properly handle lists of lists. Thanks @adrianpike for reporting! 2011-10-25 17:44:17 -07:00
David Heinemeier Hansson
1d9ab88ee6 Merge branch 'master' of github.com:rails/rails 2011-10-25 17:22:55 -05:00
David Heinemeier Hansson
5daf07704a Fix that changing a store should mark the store attribute as changed 2011-10-25 17:22:52 -05:00
Vijay Dev
8aabdc69b7 Merge pull request #3357 from rahul100885/rahul100885_ws
Added test case for postgresql database
2011-10-25 13:43:47 -07:00
Jeremy Kemper
139562f241 Clean up .gitignore and make a note about using global ignores 2011-10-25 13:30:50 -07:00
José Valim
057a268d45 Revert "Ignore .rbx directories (rbx compiled bytecode files)"
This should go in your ~/.gitignore.

This reverts commit e75c18bff8.
2011-10-25 22:23:55 +02:00
José Valim
771ca79f74 Revert "Merge pull request #3395 from bdurand/fix_file_store_cleanup"
Tests were failing on Travis-CI.

This reverts commit 79d01a8f16, reversing
changes made to b838570bd6.
2011-10-25 22:23:25 +02:00
Vijay Dev
2856d74db7 Merge pull request #3422 from arunagw/unused_var_warning
Unused variable removed
2011-10-25 12:18:54 -07:00
Matthew Daubert
f7e56a3ab6 Fix deprecation warnings in action pack test suite due to passing template formats in the template name. 2011-10-25 15:11:45 -04:00
Vijay Dev
ddce29bfa1 safeguard against configs missing environment or the database key 2011-10-26 00:41:41 +05:30
mjy
e368583ba7 Adds missing closing regex slashes. 2011-10-25 15:08:28 -04:00
Nick Howard
a7641054d8 add namespacing when referring to ActionController::RedirectBackError 2011-10-25 10:39:20 -06:00
Joost Baaij
80bcfb00f7 Added a note that optimistic locking also needs a hidden field to function across web workers. 2011-10-25 13:57:24 +03:00
Bruce Adams
7c6d4377b8 note that after_initialize is run for rake tasks 2011-10-24 16:18:42 -04:00
José Valim
7eaa2ee07b Merge pull request #3424 from avakhov/av-scaffold-func-test-remove-to_param
Remove needless to_param in scaffold functional test
2011-10-24 11:57:06 -07:00
Alexey Vakhov
98fbb50ebf Remove needless to_param in scaffold functional test 2011-10-24 22:38:10 +04:00
Arun Agrawal
b6fc41275c Unused variable removed 2011-10-24 21:56:27 +05:30
Xavier Noria
9dd168c402 minor revision to some new code in databases.rake 2011-10-24 14:46:28 +02:00
Xavier Noria
17bf04ff0d registers PR #2419 in the CHANGELOG 2011-10-24 14:43:46 +02:00
Xavier Noria
b064614ffb Merge pull request #2419 from dmitriy-kiriyenko/drop_test_database_in_development_when_running_rake_db_drop
When running "rake db:drop" also drop test database in development environment
2011-10-24 05:35:06 -07:00
José Valim
0e8a4b3e57 Merge pull request #3416 from arunagw/rbx_test_fixes
ActionPack test fix for RBX
2011-10-24 01:48:32 -07:00
Arun Agrawal
244dcfea47 ActionPack test fix for RBX 2011-10-24 14:11:20 +05:30
Jon Leighton
e75c18bff8 Ignore .rbx directories (rbx compiled bytecode files) 2011-10-23 18:07:17 +03:00
Vijay Dev
8698debcc2 Merge branch 'master' of github.com:lifo/docrails 2011-10-23 01:38:37 +05:30
Vijay Dev
227c31f7b6 edge doesnt provide turn gem in the gemfile anymore 2011-10-23 01:34:02 +05:30
Vijay Dev
337ff13be9 Merge pull request #3352 from arunagw/bump_sprockets
Bump sprockets
2011-10-22 13:01:24 -07:00
José Valim
dabf6cf1be Merge pull request #3408 from guilleiguaran/remove-turn
Remove Turn from default Gemfile.
2011-10-22 12:56:21 -07:00
Guillermo Iguaran
a458833705 Remove Turn from default Gemfile.
We still looking for a best presentation for tests output.
2011-10-22 14:34:05 -05:00
Aaron Patterson
259741ae73 Revert "Merge pull request #3405 from arunagw/middleware_name"
This reverts commit c33090523c, reversing
changes made to 1c1c3fc2c0.
2011-10-22 12:28:06 -07:00
Aaron Patterson
c33090523c Merge pull request #3405 from arunagw/middleware_name
Using middleware name to show proper name in the info
2011-10-22 11:45:38 -07:00
Vijay Dev
1c1c3fc2c0 minor fixes in the composed_of doc 2011-10-22 23:53:52 +05:30
Xavier Noria
f0a9411ede Merge pull request #3407 from arunagw/rake_upgrade
No need to check ruby version here as rake 9.2.2 is out with the same fix
2011-10-22 11:04:40 -07:00
Arun Agrawal
c930170581 No need to check ruby version here
As rake 0.9.2.2 is out with the same 
fix as 0.9.3.beta having
2011-10-22 22:29:38 +05:30
Arun Agrawal
bc5d334c7a Using middleware name to show proper name in the info 2011-10-22 19:16:43 +05:30
José Valim
de17426980 Merge pull request #3404 from arunagw/warning_removed_request_id
Warnings removed from RequestIdTest
2011-10-22 04:06:52 -07:00
Arun Agrawal
50dfd58fdb Warnings removed from RequestIdTest 2011-10-22 16:30:48 +05:30
Arun Agrawal
4ea21b6de2 Updated rack version in docs for 3.2 2011-10-22 15:54:55 +05:30
Arun Agrawal
6d5b92c735 Rails version to 3.2.0.beta in docs 2011-10-22 15:53:11 +05:30
Arun Agrawal
50be4231e9 Middleware details updated for 3.2 2011-10-22 15:51:55 +05:30
José Valim
3c3129993a Merge pull request #3396 from bdurand/session_cache_store
Add ActionDispatch::Session::CacheStore as a generic way of storing sessions in a cache
2011-10-21 23:41:15 -07:00
Aaron Patterson
d8b09f3866 Merge pull request #3400 from greinacker/sqlite-decimal
sqlite3 adapter drops :decimal columns precision & scale when migration tries to alter them
2011-10-21 16:49:21 -07:00
Greg Reinacker
f092be821d preserve decimal column attributes after migration 2011-10-21 17:30:39 -06:00
José Valim
79d01a8f16 Merge pull request #3395 from bdurand/fix_file_store_cleanup
Fix ActiveSupport::Cache::FileStore.cleanup to actually work.
2011-10-21 12:42:06 -07:00
José Valim
b838570bd6 Merge pull request #3394 from bdurand/buffered_logger_threads
Fix threading issues with BufferedLogger.
2011-10-21 12:29:14 -07:00
Brian Durand
ec93f363ca Fix ActiveSupport::Cache::FileStore.cleanup to actually work. 2011-10-21 13:28:24 -05:00
Brian Durand
2b04c2f66e Add ActionDispatch::Session::CacheStore as a generic way of storing sessions in a cache. 2011-10-21 13:13:29 -05:00
Brian Durand
d565fda5f2 Fix threading issues with BufferedLogger. 2011-10-21 12:43:52 -05:00
José Valim
e2aaae1629 Merge pull request #3387 from arunagw/tagged_log_nil
Checking blank if tag might coming nil or blank
2011-10-21 03:46:13 -07:00
Arun Agrawal
c495cbcda9 Checking blank if tag might coming nil or blank
In log it should not show the empty array.
2011-10-21 16:11:09 +05:30
Prem Sichanugrist
f0be2cb192 Add some note on adding index to HABTM table 2011-10-20 17:15:28 -04:00
Prem Sichanugrist
d64e0955d0 Use new migration style in HABTM join table
Yes, we're on Rails 3.1 now.
2011-10-20 17:13:01 -04:00
Pepe Hipolito
0cd93a6e2b Fixed typo.
Ruby will know to look for this file at => Ruby will know how to look for this file at
2011-10-20 15:58:51 -04:00
Pepe Hipolito
48e1f8ba4c Fixed typo.
a long the way => along the way
2011-10-20 15:37:35 -04:00
Vijay Dev
af1b5c54cf Merge branch 'master' of github.com:lifo/docrails 2011-10-20 23:20:44 +05:30
Aaron Patterson
ee9d9fb5fa Merge pull request #3258 from ileitch/3-1-stable
Postgres: Do not attempt to deallocate a statement if the connection is no longer active.
2011-10-20 08:45:22 -07:00
Martin Svalin
274c3fad50 Fixed misleading docs for String#to_formatted_s(:db) 2011-10-20 16:31:23 +02:00
Andrew France
66880cfe41 Correct ActionMailer subject i18n lookup scope.
The :actionmailer i18n scope part is not used and according to https://github.com/rails/rails/pull/2542 the implementation is correct.
2011-10-20 12:32:11 +02:00
José Valim
ef3e149db3 Merge pull request #3375 from arunagw/middleware_test_fix
Adding ActionDispatch::RequestId in middleware test
2011-10-20 00:35:07 -07:00
Ryan Bigg
ee1223c1ee [engines guide] explanation of overriding views + referencing routes from an engine within an application 2011-10-20 18:30:50 +11:00
Arun Agrawal
5c5d5b3d25 Adding ActionDispatch::RequestId in middleware test 2011-10-20 12:59:27 +05:30
José Valim
00eb67e01f Merge pull request #3374 from marcbowes/master
Regexp fixup
2011-10-20 00:11:06 -07:00
Marc Bowes
951a325c99 Remove the unneeded \d when sanitizing X-Request-Id. 2011-10-20 10:00:42 +03:00
Ryan Bigg
13e6f0cea8 [engines guide] some fixes for the author id migration including proof of not copying over other migrations again 2011-10-20 17:32:48 +11:00
Ryan Bigg
3e2d35b050 [engines guide] add missing end for to_s method 2011-10-20 17:10:46 +11:00
José Valim
4e9729df3f Don't use :path in Gemfile for --dev except for Rails. 2011-10-20 00:38:58 +02:00
Ryan Bigg
1cc6105d4d [engines guide] wrap up 'Configuring an Engine' section 2011-10-20 08:48:06 +11:00
Ryan Bigg
8ede74e73a [engines guide] Rather than calling name, require a to_s method to be defined on the 'User' class 2011-10-20 08:48:06 +11:00
Ryan Bigg
9694ca1a3b [engines guide] mention that we cover similar ground to the Getting Started Guide 2011-10-20 08:48:05 +11:00
David Heinemeier Hansson
be27bf17e3 Fix the proper production.rb 2011-10-19 16:24:00 -05:00
David Heinemeier Hansson
1359152345 Encourage use of tagged logging even when using a different logger 2011-10-19 16:17:06 -05:00
Martin Svalin
930dc335d7 Removed mention of deprecated ActiveModel::Errors#on 2011-10-19 23:13:15 +02:00
José Valim
c83d9a11c0 Unify logger and taggedlogging middleware as both address logging concerns. 2011-10-19 22:39:11 +02:00
José Valim
6c126015a6 Ensure TaggegLogging is thread safe. 2011-10-19 22:26:56 +02:00
José Valim
4ef7453694 Load object/blank and make use of presence. 2011-10-19 22:10:43 +02:00
José Valim
f1fecd9b4e Make tests run on 1.8.x, add integration setup. 2011-10-19 22:09:36 +02:00
Yasuo Honda
5bc23e4fb5 Fix ORA-00932 error when trying to insert 0 to DATE type columns. 2011-10-19 15:56:25 -04:00
David Heinemeier Hansson
18dbfcb363 Programatically define the log level methods and use the Logger constants instead (SyslogLogger didnt define them as I expected) 2011-10-19 14:54:00 -05:00
José Valim
533451a5b6 Merge pull request #3369 from martinsvalin/am_errors_added
New #added? method on ActiveModel::Errors
2011-10-19 12:52:48 -07:00
David Heinemeier Hansson
ada78066fd Blah, SecureRandom#uuid is not supported in 1.8.7 -- cant wait for Rails 4.0 to drop compatibility with 1.8.x 2011-10-19 14:45:42 -05:00
Martin Svalin
c9ca86c29d New #added? method on ActiveModel::Errors
The #added? method makes it possible to check if a specific error has been added, using the same parameters as for #add.
2011-10-19 21:29:20 +02:00
José Valim
1b50207ed3 Require missing string access dependency. 2011-10-19 22:17:54 +03:00
José Valim
ddbb2cae31 Require securerandom as it is the proper dependency. 2011-10-19 22:15:25 +03:00
David Heinemeier Hansson
4a4927f753 Simplify TaggedLogging symbol shortcuts (thanks Jose!) 2011-10-19 13:24:28 -05:00
David Heinemeier Hansson
afde6fdd5e Added X-Request-Id tracking and TaggedLogging to easily log that and other production concerns 2011-10-19 12:59:33 -05:00
Jeremy Kemper
3a746f7c48 Use toplevel Rack::ContentLength 2011-10-19 12:31:06 -05:00
Vijay Dev
89a164ab9b Merge pull request #3362 from avakhov/p-superfluous-assign-cookies
Remove superfluous assignment in cookies
2011-10-19 00:28:33 -07:00
Andy Lindeman
044e6ac245 Fixes the defaults for config.cache_classes 2011-10-18 23:45:56 -03:00
Aaron Patterson
c2f3c9bf56 only use now() on pg! 2011-10-18 13:30:01 -07:00
Alexey Vakhov
bed5825f77 Remove superfluous assignment in cookies 2011-10-18 22:57:55 +04:00
Aaron Patterson
6a28c512e3 reset prepared statement when schema changes imapact statement results. fixes #3335 2011-10-18 11:20:13 -07:00
Santiago Pastorino
d44702c830 Use again Rack's ContentLength middleware part 2 2011-10-18 16:14:38 -02:00
Santiago Pastorino
7f184aaf43 Use again Rack's ContentLength middleware 2011-10-18 16:04:15 -02:00
José Valim
71325bb308 Merge pull request #3350 from whilefalse/rake_environment_in_engines
Added environment rake task to engines
2011-10-18 10:09:13 -07:00
Aaron Patterson
76af2818a6 use now() for dates in pg 2011-10-18 10:07:40 -07:00
steve
40d1555091 Added test for rake environment in an engine 2011-10-18 17:11:50 +01:00
Steven Anderson
c547e968f5 Added environment rake task to engines 2011-10-18 15:46:39 +01:00
Rahul P. Chaudhari
d21405a07c Added test case for postgresql database 2011-10-18 11:37:33 +05:30
José Valim
5e1b912f3b Merge pull request #3356 from arunagw/bunp_rack
Bump Rack to 1.3.5
2011-10-17 23:04:24 -07:00
Arun Agrawal
124bb17638 Bump Rack to 1.3.5 2011-10-18 11:09:59 +05:30
José Valim
7511f9794d Merge pull request #3340 from surfacedamage/exclude_destroy_in_all_blank_check
Exclude _destroy parameter in :all_blank check (issue #2937)
2011-10-17 11:15:58 -07:00
Arun Agrawal
91be318120 Bump sprockets 2011-10-17 23:13:42 +05:30
Aaron Christy
8510a0bb5a Exclude _destroy parameter in :all_blank check (issue #2937) 2011-10-17 13:29:11 -04:00
José Valim
59d6df5c69 Merge pull request #3151 from zenprogrammer/pluralize_without_count
Added include_count parameter to pluralize.
2011-10-17 07:02:39 -07:00
Vijay Dev
8dffc62a9b use variables from test setup 2011-10-17 19:15:24 +05:30
Vijay Dev
826a850696 fix a typo and slightly reword has_secure_password comment 2011-10-17 19:14:29 +05:30
Pascal Lindelauf
86919a6da1 Clarified that the config.assets.initialize_on_precompile directive needs to be set in application.rb 2011-10-17 14:45:45 +02:00
Ryan Bigg
cb95cca026 [engines guide] missed a spot in the 'Using a class section' + further text for 'Configuring an engine' section 2011-10-17 20:26:37 +11:00
Ryan Bigg
518b30cf48 [engines guide] Point out that we need to run rake db:migrate after creating user model 2011-10-17 20:25:45 +11:00
José Valim
2f87b724d2 Merge pull request #3319 from martinsvalin/active_model_errors_fixes
ActiveModel::Errors#generate_message without i18n_scope, and more test cases for #add
2011-10-17 00:34:35 -07:00
Martin Svalin
180d4137ca ActiveModel::Errors#generate_message without i18n_scope, and more test cases for #add 2011-10-17 09:22:08 +02:00
Ryan Bigg
7d8c650e86 [engines guide] [reviewing] remove excessive 'Now' 2011-10-17 17:12:31 +11:00
Aaron Patterson
8919a68b96 Merge pull request #3334 from mperham/master
Default timestamps to non-null
2011-10-16 16:14:56 -07:00
Ryan Bigg
5bf0ea6830 [engines guide] Complete section about using an application's class 2011-10-17 08:55:32 +11:00
Vijay Dev
f10d62c4bf Merge pull request #3343 from vatrai/fix_warning
fix to remove warning in test cases
2011-10-16 07:43:54 -07:00
Ryan Bigg
434148024d [engines guide] beginning to cover using application's classes 2011-10-16 20:17:53 +11:00
Ryan Bigg
0f87cc1486 [engines guide] Add 'Engine setup' section in 'Hooking into an application' section 2011-10-16 20:17:53 +11:00
Ryan Bigg
bb8ee9264f [engines guide] improve intro to 'Hooking into an application' section 2011-10-16 20:17:53 +11:00
Vishnu Atrai
9210458547 fix to remove warning in test cases 2011-10-16 14:29:06 +05:30
mhutchin
abf4f096e5 [layouts and rendering] Copy editing 2011-10-15 15:59:26 -07:00
Jose and Yehuda
afd7140b66 Remove 1.9 Hash syntax - tests passing on 1.8.7 2011-10-15 22:33:58 +02:00
Alexey Vakhov
8f473dc9ae HTMl -> HTML: html scanner comment fix 2011-10-15 23:54:26 +04:00
Karunakar (Ruby)
4867bfabaa more doc changes on railties README 2011-10-16 01:12:00 +05:30
Karunakar (Ruby)
018e84af20 railties README change to make consistent like others eg:activerecord 2011-10-16 01:00:57 +05:30
Jose and Yehuda
2abb2e617a Add initial support for embed API 2011-10-15 19:22:16 +02:00
Jose and Yehuda
a230f040ff Add support for the root attribute 2011-10-15 18:56:47 +02:00
Jose and Yehuda
7a28498b55 Fix nil has_one association 2011-10-15 18:40:38 +02:00
Jose and Yehuda
322f47898e Add association_ids 2011-10-15 18:40:38 +02:00
Jose and Yehuda
22c322f056 Add support for overriding associations, mostly used for authorization 2011-10-15 18:40:38 +02:00
Jose and Yehuda
776da539d7 Add support for implicit serializers 2011-10-15 18:40:38 +02:00
Jose and Yehuda
2a4aaae72a Added has_one and has_many 2011-10-15 18:40:37 +02:00
Jose and Yehuda
598fc578fb Don't unnecessarily use String eval. 2011-10-15 18:40:37 +02:00
Jose and Yehuda
e407dfb9bf Don't require serializable_hash to take options. 2011-10-15 18:40:37 +02:00
Vijay Dev
f5836543c3 minor edits in serializers guide 2011-10-15 18:40:37 +02:00
Jose and Yehuda
c3de52d7ed Initial implementation of ActiveModel::Serializer 2011-10-15 18:40:37 +02:00
Jose and Yehuda
a4c04a43cc Refactor to make renderers a Set 2011-10-15 18:40:37 +02:00
Jose and Yehuda
8ff7693a8d Initial commit of serializer support 2011-10-15 18:40:37 +02:00
mhutchin
26204def8f [layouts and rendering] Copy editing to improve readability 2011-10-15 05:32:13 -07:00
José Valim
098c95abcb Merge pull request #3320 from sunaku/space-align
fix inconsistent alignment in Gemfile generator
2011-10-15 01:56:30 -07:00
Alexey Vakhov
f247c5f811 Update AC::RecordIdentifier example 2011-10-15 11:34:33 +04:00
Mike Perham
3dbedd2823 Default timestamps to non-null 2011-10-14 21:09:53 -07:00
Vijay Dev
e759c8882a Merge branch 'master' of github.com:lifo/docrails 2011-10-14 22:21:40 +05:30
José Valim
521a089166 Merge pull request #3331 from fabrik42/master
Include affected record when raising an ActiveRecord::StaleObjectError
2011-10-14 09:42:03 -07:00
Christian Bäuerlein
c6f0461e89 Consider attempted action in exception message of ActiveRecord::StaleObjectError 2011-10-14 18:20:41 +02:00
Christian Bäuerlein
410fa4cf7c Includes stale record in StaleObjectError 2011-10-14 16:28:02 +02:00
Vijay Dev
e2a3952428 Merge pull request #72 from pote/master
small fix
2011-10-14 03:08:08 -07:00
Ryan Bigg
6df79bf580 [engines guide] WIP for explaining how to hook engine into application 2011-10-14 18:44:39 +11:00
Ryan Bigg
aae77d2839 [engines guide] complete comments resource generation 2011-10-14 18:44:39 +11:00
Ryan Bigg
3d192c7385 [engines guide] Add heading for comments 2011-10-14 18:44:39 +11:00
Ryan Bigg
2c8b8ce9ee [engines guide] make clear that the comment generator command is just one line 2011-10-14 18:44:39 +11:00
Ryan Bigg
2101bc9fd0 [engines guide] make it clear that the scaffold generator output isn't part of the actual command 2011-10-14 18:44:39 +11:00
Ryan Bigg
690dd2f64c [engines guide] correct render line is blorgh/comments/form 2011-10-14 18:44:39 +11:00
Ryan Bigg
411613ab20 [engines guide] improve wording for sentence describing comments/form partial 2011-10-14 18:44:38 +11:00
Jeremy Kemper
401d00d296 Symbol captures may generate multiple path segments, so don't escape / -> %2F. Test splat escaping. 2011-10-13 21:42:15 -07:00
Jeremy Kemper
bceec4c3c3 / is allowed in URI fragments 2011-10-13 21:41:30 -07:00
Jeremy Kemper
ec37160664 Leave escaping up to Journey 2011-10-13 21:40:42 -07:00
Jeremy Kemper
45ced7e1be Failing tests for path parameter escaping 2011-10-13 19:02:58 -07:00
PoTe
dadfa1e34f security reasonS should be plural 2011-10-13 22:31:32 -02:00
Santiago Pastorino
a5b0f914f1 Merge pull request #3314 from macmartine/master
Remove user-specified delimiter from start when no area code is present (in number_to_phone)
2011-10-13 16:26:55 -07:00
Jeremy Kemper
8cbe826958 Rails 4 is just around the corner. Stuck with 1.8 until then. 2011-10-13 16:11:00 -07:00
Jeremy Kemper
0a9b6de4d2 Tests gotta run in 1.8 too 2011-10-13 15:54:53 -07:00
Santiago Pastorino
df5ea6b8b1 Merge pull request #2224 from kommen/fix_fragment_caching_for_master
Fix fragment cache helper regression on cache miss introduced with 03d01e
2011-10-13 15:48:49 -07:00
Suraj N. Kurapati
d32a90b9b7 fix inconsistent alignment in Gemfile generator 2011-10-13 15:36:50 -07:00
David Heinemeier Hansson
85b64f98d1 Added ActiveRecord::Base.store for declaring simple single-column key/value stores [DHH] 2011-10-13 16:24:22 -05:00
Santiago Pastorino
8f11d53506 Merge pull request #2219 from kommen/fix_fragment_caching_squashed
Fix fragment caching (squashed commits)
2011-10-13 13:36:20 -07:00
Diego Carrion
b7cccae71e improved ActiveResource's .element_path and .new_element_path methods documentation by specifing how .site should be declared in order to use prefix_options 2011-10-13 16:27:10 -03:00
José Valim
74fbbf1ea0 Merge pull request #3315 from rahul100885/rahul100885_workspace
Added test to check that the vendor/assets/stylesheets directory is creat
2011-10-13 01:04:42 -07:00
Ryan Bigg
66b2dc059f [engines guide] don't show actual timestamp in migration generation 2011-10-13 18:06:00 +11:00
Ryan Bigg
e537a3fcb1 [engines guide] change comments resource generation
Totally didn't like where this section was going, so scrapped it.

Scaffold is great for some things (lol) but nested resources is definitely not one of them.

Best to walk people through how to do it right, as they would in the real world
2011-10-13 18:06:00 +11:00
Rahul Chaudhari
dc3f33eb60 Added test to check that the vendor/assets/stylesheets directory is created 2011-10-13 12:17:19 +05:30
Mac Martine
20728f551c remove user-specified delimiter from start when no area code is present (in number_to_phone) 2011-10-12 17:06:44 -07:00
Vijay Dev
e6b2e7fbea refactor guide example 2011-10-13 02:17:01 +05:30
José Valim
f6c9349565 Merge pull request #3287 from sgerrand/vendor_assets_javascripts_should_be_created
Ensure that the directory 'vendor/assets/javascripts' is created by AppGenerator
2011-10-12 11:37:09 -07:00
Steve Bourne
e552fe16d4 change activerecord query conditions example to avoid 'type' as column name
'Type' is a reserved column for STI.  Changed conditions example to
avoid using that column name as an example.  The example isn't
STI-related (and mentioning STI here is needless clutter), so changing
to avoid accidentally encouraging users to use 'type' as a column name
for other purposes.
2011-10-12 10:46:08 -07:00
Craig Monson
532e6d59b5 quoting 'and' to make it more distinct. 2011-10-12 10:34:27 -04:00
José Valim
2cb2ca68b1 Add some implementation docs. closes #3298. closes #2509. 2011-10-12 09:29:40 +02:00
Akira Matsuda
4a025f0080 status is a number in Rails 3 2011-10-12 15:44:19 +09:00
Jeremy Kemper
e5d0bb22ef Fix version number in CHANGELOG 2011-10-11 21:03:08 -07:00
Jeremy Kemper
b8bb5f44c8 Treat 303 See Other as a redirect response, too 2011-10-11 21:01:11 -07:00
Jeremy Kemper
027ecd3afb Merge remote-tracking branch 'jimherz/activeresource_redirection_patch'
Closes #3302
2011-10-11 20:54:06 -07:00
Jim Herzberg
a78a75d67a activeresource should treat HTTP status 307 as redirection, same as 301 and 302; added missing test cases for statii 301 and 302. 2011-10-11 17:46:24 -07:00
José Valim
fa79408a55 Merge pull request #3295 from zhengjia/master
Fix multiple includes with options
2011-10-11 09:50:53 -07:00
zhengjia
1adf5662b5 Fixed serialization issues with multiple includes with options 2011-10-11 11:09:43 -05:00
Stephen Pike
c4e2954172 Runtime conditions for associations should use procs
The association guide previously recommended using a trick with single
quote delaying of string interpolation in order to handle setting association
conditions that would be evaluated at runtime. Using a proc is the new way as
this no longer works.
2011-10-11 09:32:23 -04:00
mhutchin
3ca269674f Heavy copy editing of the find_each and find_in_batches section 2011-10-11 06:27:01 -07:00
Evgeniy Dolzhenko
c317419359 Use .add instead of << to add errors 2011-10-11 14:13:08 +01:00
Rahul P. Chaudhari
c568a9ba11 Merge pull request #71 from rahul100885/rahul100885_workspace
Fixed typos in active_support_core_extensions.textile
2011-10-11 04:54:58 -07:00
RAHUL CHAUDHARI
1f62c6d09f Fixed typos in active_support_core_extensions.textile 2011-10-11 17:17:20 +05:30
José Valim
7b84e36cd6 Merge pull request #3289 from avakhov/p-respond_to-conditions
Support symbol and string actions in AC#respond_to options
2011-10-11 02:06:22 -07:00
Alexey Vakhov
50d262f52a Support symbol and string actions in AC#respond_to options 2011-10-11 12:48:03 +04:00
Alexey Vakhov
419d4c09df Add ActionController#head example 2011-10-11 12:31:27 +04:00
Sasha Gerrand
84672b0c9d Added test to check that the vendor/assets/javascripts directory is created 2011-10-11 18:48:51 +11:00
José Valim
1735868c61 Merge pull request #3285 from dcrec1/master
Fixes #3280: Shorthand route nested in scope produces missing controller error
2011-10-10 23:57:03 -07:00
Vijay Dev
b5f66cf7eb Merge pull request #3286 from rahul100885/rahul100885_workspace
Corrected typo
2011-10-10 23:28:53 -07:00
Sasha Gerrand
43c01ef8b1 Added method to create vendor/assets/javascripts, added it to methods called within vendor method 2011-10-11 17:04:24 +11:00
RAHUL CHAUDHARI
16a0013d96 Corrected typo 2011-10-11 10:26:22 +05:30
Diego Carrion
8f863742e3 allow shorthand routes with nested optional parameters 2011-10-10 19:53:42 -03:00
Vijay Dev
fcb70f364c Merge branch 'master' of github.com:lifo/docrails 2011-10-10 19:41:25 +05:30
Vijay Dev
e9413b5de3 Merge pull request #3274 from arunagw/warning_removed_mysql2
ambiguous first argument; put parentheses or even spaces Warning removed!
2011-10-10 04:39:18 -07:00
Vijay Dev
b27ca99b7b Merge pull request #3265 from arunagw/warning_uri_parser
URI.escape is obsolete : warning removed
2011-10-10 04:34:22 -07:00
José Valim
c3c157141c Merge pull request #3275 from simi/patch-1
Improve ActiveRecord changelog
2011-10-10 03:45:27 -07:00
Ryan Bigg
9c9583fa9b [engines guide] add TODO for RedCarpet example 2011-10-10 21:04:27 +11:00
Ryan Bigg
59c9825be5 [engines guide] cover generating the comment resource 2011-10-10 21:04:27 +11:00
Ryan Bigg
44fc397c80 Fix rails/generators/base.rb documentation for generator lookup 2011-10-10 21:04:26 +11:00
Ryan Bigg
be01aa6c9b [engines guide] amend two TODOs for further things in this guide 2011-10-10 21:04:26 +11:00
Ryan Bigg
9e6d43f9c9 [engines guide] finish covering what the scaffold generator does within an engine 2011-10-10 21:04:26 +11:00
Ryan Bigg
da030cf9cb [engines guide] final line change 2011-10-10 21:04:26 +11:00
Ryan Bigg
765d3e955f [engines guide] Add TODO for mentioning rails s and rails c 2011-10-10 21:04:26 +11:00
Ryan Bigg
b02bd74c13 [engines guide] begin explaining what the scaffold generator outputs within an engine 2011-10-10 21:04:25 +11:00
Ryan Bigg
685c24d730 [engines guide] reword first two dot points in prologue 2011-10-10 21:04:25 +11:00
Ryan Bigg
c580812a55 [engines guide] Credit where credit is due + explaning directory structure 2011-10-10 21:04:25 +11:00
Ryan Bigg
454492dfd7 [engines guide] Credit where credit is due 2011-10-10 21:04:25 +11:00
Josef Šimánek
ceb65a639c Active Record changelog mistakes 2011-10-10 12:19:31 +03:00
Arun Agrawal
af7eeaafdb ambiguous first argument; put parentheses or even spaces Warning removed! 2011-10-10 14:16:45 +05:30
José Valim
84c8b2feee Merge pull request #3272 from odorcicd/fix_json_error_root
JSON responder should return errors with :errors root
2011-10-10 00:06:56 -07:00
Denis Odorcic
a0a68ecbb2 JSON responder should return errors with :error root 2011-10-10 01:42:12 -04:00
Jon Leighton
3456ef1119 Use broken YAML that will fail with Syck as well as Psych. Fixes test_broken_yaml_exception in fixtures_test.rb on Ruby 1.8.7.
Cherry-pick from 3-1-stable: b8d46924e7
2011-10-09 16:47:53 -07:00
mhutchin
11b183eb92 Copy editing to improve readability, consistency, and tone 2011-10-09 16:07:30 -07:00
mhutchin
5f632a88a6 Minor copy editing 2011-10-09 15:56:01 -07:00
Jeremy Kemper
8dba127188 Remove stray whitespace 2011-10-09 14:21:12 -07:00
Joseph Palermo
c90e5ce779 Only use LOWER for mysql case insensitive uniqueness check when column has a case sensitive collation. 2011-10-09 13:14:07 -07:00
Santiago Pastorino
8f8fd4f3aa Merge pull request #3270 from kennyj/fix_invalid_regex
(small patch) fix invalid regex in testcase
2011-10-09 10:42:21 -07:00
Guillermo Iguaran
c2f03d19c2 Merge pull request #70 from mcdd/master
Update security guide ActiveRecordStore/SessionStore
2011-10-09 10:01:09 -07:00
kennyj
6d05597d0f fix invalid regex 2011-10-10 01:54:54 +09:00
mhutchin
74b9441c0d Copy editing: s/Rails guesses/Rails assumes/g 2011-10-09 09:36:19 -07:00
Dan McDonald
b9b4cfcebc ActiveRecordStore is now called SessionStore. 2011-10-09 09:31:11 -06:00
Vijay Dev
a2edc884f3 Merge branch 'master' of github.com:lifo/docrails 2011-10-09 20:10:53 +05:30
Santiago Pastorino
1774ec7464 Merge pull request #3266 from arunagw/warnings_removed
Warnings removed when running with 1.9.3
2011-10-09 07:34:56 -07:00
Vijay Dev
3a72c01be2 Corrections to the ajax guide recent changes. This guide is very
outdated and will need a lot of changes to make it useful for Rails 3+
2011-10-09 19:58:14 +05:30
Arun Agrawal
ca219a21b6 Warnings removed when running with 1.9.3 2011-10-09 17:15:55 +05:30
Roy Tomeij
d214e54e7a Fix a typo that was mysteriously entered in previous commit 2011-10-09 13:45:54 +02:00
Roy Tomeij
da773a24be Add note about how Sass & Sprockets don't match 2011-10-09 13:38:47 +02:00
Arun Agrawal
2886513aea URI.escape is obsolete : warning removed 2011-10-09 15:38:14 +05:30
José Valim
2ed66feae0 Merge pull request #3262 from subdigital/master
Add optional host option to force_ssl
2011-10-09 02:52:42 -07:00
José Valim
501e5b0d7f Merge pull request #3196 from avakhov/patch-am-av-tests-2
Improve tests method for ActionView::TestCase and ActionMailer::TestCase
2011-10-09 02:15:19 -07:00
mhutchin
9de9f6b4d0 Copy editing to improve readability and remove any potential ambiguity 2011-10-09 01:50:53 -07:00
Karunakar (Ruby)
43baad78f7 improving the docs for ajax_on_rails 2011-10-09 12:49:38 +05:30
mhutchin
ac8555b5a0 copy editing 2011-10-08 23:02:33 -07:00
mhutchin
3deb35ea5c copy editing 2011-10-08 22:45:31 -07:00
Jeremy Kemper
bedd6dcd43 Merge pull request #500 from cyril/patch-1
Use quotes for command substitution
2011-10-08 20:29:56 -07:00
Liborio Cannici
114218e4da Fixes an issue when creating a date select with too many options.
Inspired by dlt 9e61563474

Closes #239.

Conflicts:

	actionpack/CHANGELOG
2011-10-08 18:02:15 -07:00
Ben Scheirman
d68f27e9b1 accept optional :host parameter to force_ssl 2011-10-08 18:38:02 -05:00
Guillermo Iguaran
f655895e87 Isolate rake action tests that should be run under default env 2011-10-08 16:44:40 -05:00
Jeremy Kemper
2274c9212e Merge remote-tracking branch 'guilleiguaran/test-utf8-assets-filename'
Closes #3261
2011-10-08 13:29:19 -07:00
Guillermo Iguaran
b111b41d13 Test utf8 assets filenames with request instead of manifest lookup 2011-10-08 15:24:52 -05:00
Jeremy Kemper
4888aba15f The generator invokes rake with either the :env option, ENV['RAILS_ENV'], or development. So if Travis has exported RAILS_ENV=test, it'll be used instead of development, breaking these brittle expectations. 2011-10-08 13:09:28 -07:00
Jeremy Kemper
9ce03d1542 Skip broken asset precompilation test on Macs. Issues with NFD vs NFC normalization on the asset filename. Major red flag with asset lookups! 2011-10-08 12:56:06 -07:00
Karunakar (Ruby)
6a5eeab3cd Revert "Revert "updated the ajax_on_rails.textile for rails3" because of invalid git user"
This reverts commit 5d2ffbb992b4ab875a121761fc0cf14dcaa12033.
2011-10-09 00:18:16 +05:30
mhutchin
62c03816e8 copy editing
"updated the ajax_on_rails.textile for rails3"
2011-10-09 00:17:21 +05:30
Jeremy Kemper
0d0ded39ef Don't notify IRC on every single build, just failures and first success after a string of failures 2011-10-08 11:13:48 -07:00
Jeremy Kemper
8a6acc17bb Disable 1.9.3 builds until upgraded from -preview1 to -rc1 2011-10-08 11:13:12 -07:00
Jeremy Kemper
1851791803 Add comments to our generated .gitignore, including a note about when to use a global gitignore. Remove .sass-cache since we use /tmp/sass-cache, which is already ignored. 2011-10-08 08:04:05 -07:00
Santiago Pastorino
96e1dc3440 Revert "Merge pull request #3254 from arunagw/app_gitignore_sqlnet_log"
This reverts commit bb8e067329, reversing
changes made to 11687382db.
2011-10-08 12:54:24 -02:00
Santiago Pastorino
bb8e067329 Merge pull request #3254 from arunagw/app_gitignore_sqlnet_log
Sqlnet should also be ignored into the app gitignore
2011-10-08 05:47:33 -07:00
Arun Agrawal
6c9090d192 Sqlnet should also be ignored into the app gitignore 2011-10-08 14:39:19 +05:30
mhutchin
b2deeabffb Correct stylesheet filename and remove reference to old stylesheet compilation location 2011-10-08 01:58:57 -07:00
José Valim
11687382db Merge pull request #3249 from arunagw/query_cache_test_fix
Fixed BodyProxy.new for tests! for wrong argument
2011-10-08 01:17:57 -07:00
José Valim
135a97af76 Merge pull request #3250 from arunagw/adding_sqlnet_to_gitignore
sqlnet.log file to gitignore. Generates when running with oracle!
2011-10-08 01:17:28 -07:00
José Valim
cf92e41513 Merge pull request #3252 from avakhov/p-remove-expire_page-dup
Remove unnecessary dup in expire_page
2011-10-08 01:15:21 -07:00
Alexey Vakhov
a4515b60e3 Remove unnecessary dup in expire_page 2011-10-08 11:01:31 +04:00
Alexey Vakhov
22b6e829dc Fix params hash example in AC::Base comment 2011-10-08 10:12:58 +04:00
Arun Agrawal
1e8feb8440 sqlnet.log file to gitignore. Generates when running with oracle! 2011-10-08 10:06:19 +05:30
Arun Agrawal
34d950b066 Fixed BodyProxy.new for tests! for wrong argument 2011-10-08 10:01:58 +05:30
Aaron Patterson
7f64e47277 just check to see that the first item in the list is an array 2011-10-07 16:56:18 -07:00
Vijay Dev
d2db917841 fix bad formatting in the assets guide 2011-10-08 02:22:49 +05:30
José Valim
8a4239fc7e testing.rake should set the default task, closes #2564 2011-10-07 22:25:10 +02:00
Vijay Dev
0d3d9a150a closes #3241 - partial doc fix 2011-10-07 23:53:12 +05:30
Vijay Dev
bec61bd1ea Merge pull request #3244 from ugisozols/master
One of the activemodel naming tests wasn't asserting anything.
2011-10-07 10:26:45 -07:00
Vijay Dev
4930f9d2a7 Merge branch 'master' of github.com:lifo/docrails 2011-10-07 22:20:29 +05:30
Vijay Dev
cb244f4f70 use https for github url 2011-10-07 22:19:55 +05:30
mhutchin
fca2613ec4 Correct formatting 2011-10-07 08:26:05 -07:00
mhutchin
d4ea804e21 Replace the reference to the annotate_models plugin (unchanged since 2008) with more current annotate_models gem 2011-10-07 08:16:33 -07:00
Uģis Ozols
4015080efd One of the activemodel naming tests wasn't asserting anything. 2011-10-07 16:42:44 +03:00
Xavier Noria
9312d217d6 Merge branch 'master' of github.com:rails/rails 2011-10-07 15:07:14 +02:00
Xavier Noria
b1c20e37ec asset pipeline guide: removes Apache config for serving pre-compressed assets, and expands the information about nginx support for this
A robust Apache configuration for this feature seems to be tricky,
one that takes into account Accept-Encoding, sets Vary, ensures
Content-Type is right, etc.
2011-10-07 15:05:14 +02:00
Santiago Pastorino
ea341b8e04 Merge pull request #3243 from mjtko/connection-pool-thread-fix
QueryCache/ConnectionPool thread fix (was #1670)
2011-10-07 05:25:31 -07:00
Mark J. Titorenko
f41b58d3b2 use thread locals and an instance variable within QueryCache#BodyProxy to maintain appropriate linkage with AR database connection across threads 2011-10-07 10:05:51 +01:00
Aaron Patterson
3088d23647 Merge pull request #3232 from Juanmcuello/pg_prepared_statements
Use the schema_search_path in prepared statements.
2011-10-06 20:08:05 -07:00
Dimitar Dimitrov
ddee206dfb More understandable warning in the local_constant_names section
Rewrite the warning about local_constant_names in Ruby 1.8 to make it more understandable. Word ordering fixes in the same section.
2011-10-07 03:14:59 +03:00
clay shentrup
0549ba10b3 Clarifying ambiguous description of require_self in the asset pipeline 2011-10-06 16:09:36 -07:00
Aaron Patterson
99888487b6 fix require 2011-10-06 15:31:56 -07:00
Manuel Menezes de Sequeira
a17e5e2462 Merge branch 'master' of github.com:lifo/docrails 2011-10-06 21:31:26 +01:00
Manuel Menezes de Sequeira
29bf193cad Undid previous change which violated the convention regarding output (use "# =>") used in these guides. Corrected typo in previous correction. (Thanks for pointing this out, vijaydev.) 2011-10-06 21:29:58 +01:00
Vijay Dev
545ddbdbc5 fix an example 2011-10-06 23:50:16 +05:30
Vijay Dev
2224a06b72 fix a space in the assets guide 2011-10-06 20:04:09 +05:30
Xavier Noria
9d091c038d revises the precompilation section of the asset pipeline guide (web server configuration for gzipped assets pending) 2011-10-06 16:23:56 +02:00
José Valim
89623e9946 Merge pull request #3236 from yahonda/fix_test_nonexisting_method_with_arguments
Fixed test_nonexisting_method_with_arguments to revert commit 29a5aea
2011-10-06 04:52:25 -07:00
Yasuo Honda
281b8caf80 Fixed test_nonexisting_method_with_arguments to revert commit 29a5aea 2011-10-06 07:44:48 -04:00
Vijay Dev
33799c8fc3 Merge pull request #3203 from jrmehle/fix_clone_structure
db:test:clone_structure if path to .sql file contains spaces or dashes
2011-10-06 02:13:36 -07:00
Alexey Vakhov
d42d97d2e3 Fix comment in AbstractController callbacks 2011-10-06 10:39:37 +04:00
Hendy Tanata
79a719a6d2 Grammar fixes for the routing guide. 2011-10-06 14:03:46 +08:00
Ryan Bigg
4f5878a4a9 Merge branch 'master' of github.com:lifo/docrails
* 'master' of github.com:lifo/docrails:
  use Rails.root.join for assets guide
2011-10-06 13:33:55 +11:00
Ryan Bigg
02eac2db94 [config guide] Show example of defining initialization hooks 2011-10-06 13:32:39 +11:00
Ryan Bigg
00751f0257 [config guide] mention that to_prepare hooks are called upon every request in dev, but only once in production 2011-10-06 13:32:21 +11:00
Jeremy Kemper
0adab7c29b Merge branch 'multiple-transactional-fixture-connections' 2011-10-05 19:31:47 -07:00
Nick Quaranto
3d595c5eae use Rails.root.join for assets guide 2011-10-05 22:27:33 -04:00
Jeremy Kemper
999b7ed94d Transactional fixtures enlist all active database connections.
You can use multiple databases in your tests without disabling transactional fixtures.
2011-10-05 19:10:18 -07:00
José Valim
82d41c9698 Revert "don't raise NoMethodError the tried method doesn't exists"
This reverts commit 29a5aeaae9.
2011-10-06 00:37:15 +02:00
Ryan Bigg
876d3f23d2 [engines guide] More explanation for 'Generating an engine' 2011-10-06 09:18:21 +11:00
Ryan Bigg
1ba6b40698 [engines] Expanded 'What are engines?' and 'Generating an engine' sections 2011-10-06 09:18:21 +11:00
Manuel Menezes de Sequeira
cde529448b Some small corrections and improvements to the text. 2011-10-05 22:52:50 +01:00
Manuel Menezes de Sequeira
07343d2974 Merge branch 'master' of github.com:lifo/docrails 2011-10-05 22:14:49 +01:00
Manuel Menezes de Sequeira
8d775d5f1d Correction of code snippet tag from shell to ruby. 2011-10-05 22:14:41 +01:00
Jon Leighton
2e9e647fee Raise an exception on unknown primary key inside AssociationReflection.
An association between two models cannot be made if a relevant key is
unknown, so fail fast rather than generating invalid SQL. Fixes #3207.
2011-10-05 20:21:21 +01:00
Jon Leighton
64747654ca Revert "Raise error on unknown primary key."
This reverts commit ee2be435b1.
2011-10-05 20:21:21 +01:00
Prem Sichanugrist
d6c7185d77 Update Rails routing guide to mention that redirect() is a 301 permanent redirect
I had to try out myself to realize that it's 301, so this should be helpful to everyone.
2011-10-05 15:31:14 -03:00
Juan M. Cuello
ac659b8ed3 refs #3232. Prepared statements and postgreSQL schemas.
Add tests for prepared statements with multiple schemas in
postgreSQL.
2011-10-05 14:44:50 -03:00
Santiago Pastorino
fd8f0b2978 stylesheet_link_tag('/stylesheets/application') and similar helpers doesn't throw Sprockets::FileOutsidePaths exception anymore 2011-10-05 15:41:28 -02:00
Juan M. Cuello
cfc95d89ae Use the schema_search_path in prepared statements.
To allow the use of prepared statements when changing schemas in
postgres, the schema search path is added to the sql key.
2011-10-05 11:43:03 -03:00
José Valim
c495bfc127 Do not require railtie as it messes up Rails.application setup. 2011-10-05 15:31:38 +02:00
Vijay Dev
46ce7f1f77 Merge branch 'master' of github.com:lifo/docrails 2011-10-05 18:42:18 +05:30
Vijay Dev
ea49935a6e copy editing 2011-10-05 18:40:45 +05:30
Manuel Menezes de Sequeira
34ed93931d Merge branch 'master' of github.com:lifo/docrails 2011-10-05 11:59:47 +01:00
Manuel Menezes de Sequeira
4406bbe147 s/help/helper/ 2011-10-05 11:59:03 +01:00
Hendy Tanata
a44bbfc1c7 Corrections to Active Record Validations and Callbacks guide. 2011-10-05 17:35:58 +08:00
José Valim
ae4febdf84 Merge pull request #3229 from amatsuda/string_prepend
ruby193: String#prepend
2011-10-05 00:38:57 -07:00
José Valim
4cea4ee6b5 Fix regression when calling helpers inside sprockets. 2011-10-05 09:37:58 +02:00
Robert Ross
463223c324 Merge branch 'master' of github.com:lifo/docrails 2011-10-04 23:42:50 -07:00
Robert Ross
ac49fb1aa9 Change one more place for JSON string to Hash 2011-10-04 23:42:37 -07:00
Akira Matsuda
87eab595d8 ruby193: String#prepend is also unsafe 2011-10-05 15:26:29 +09:00
Akira Matsuda
9c4fe308b6 override unsafe methods only if defined on String 2011-10-05 15:26:28 +09:00
José Valim
87c57bb88f Fix the lame config.action_controller.present? check scattered throughout assets_path.
Conflicts:

	actionpack/test/template/sprockets_helper_test.rb
2011-10-05 02:35:43 +02:00
Jon Leighton
ee2be435b1 Raise error on unknown primary key.
If we don't have a primary key when we ask for it, it's better to fail
fast. Fixes GH #2307.
2011-10-05 01:11:40 +01:00
José Valim
5711a35ad8 Ensure default_asset_host_protocol is respected, closes #2980. 2011-10-05 02:08:02 +02:00
José Valim
ac2f6bd643 Encapsulate common rake invocation logic in a method.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:25:55 +02:00
Mark J. Titorenko
110ce85482 added comment about why nondigest assets requires a reinvocation
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:25:47 +02:00
Mark J. Titorenko
26a62a6552 only reinvoke if necessary
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:25:39 +02:00
Mark J. Titorenko
42eda8f8a1 only execute the nondigest task if needed
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:25:05 +02:00
Mark J. Titorenko
ee51cc30ff don't munge the environment, let rake do that for us
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:25:01 +02:00
Mark J. Titorenko
b41bd968c6 assets compilation task refactoring
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-05 01:24:58 +02:00
Ryan Bigg
2c4e08d872 [engines guide] initial layout 2011-10-05 08:38:04 +11:00
José Valim
dc85fc546f Fix failing test added in previous commit.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-04 22:04:56 +02:00
Mark J. Titorenko
9c69ef3167 correct path used in "digested assets are not mistakenly removed" test
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-04 22:04:49 +02:00
Mark J. Titorenko
1f0b78e045 add failing test: "digested assets are removed from configured path"
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-04 22:04:45 +02:00
Robert Ross
eef176dc7d Fix as_json doc to say what it actually returns. 2011-10-04 09:37:54 -07:00
Santiago Pastorino
db262211c9 Bump sprockets to 2.0.2 2011-10-04 14:14:36 -02:00
Manuel Menezes de Sequeira
bb4edc8edf More corrections and clarifications to the Active Record Validations and Callbacks guide. 2011-10-04 16:13:16 +01:00
Santiago Pastorino
997efed103 Merge pull request #3212 from ayrton/master
incorrect to_formatted_s example
2011-10-04 05:34:25 -07:00
Ayrton De Craene
02b0f8d9ff to_formatted_s is an instance method for a Range not an Array 2011-10-04 15:21:23 +03:00
José Valim
96aa3bd0ea Clean up subdomain code a bit. 2011-10-04 11:31:47 +02:00
José Valim
b039069756 Merge pull request #3209 from ksob/subdomain_false_strips_subdomains
:subdomain => false will remove all subdomains now. Closes #2025
2011-10-04 02:26:40 -07:00
José Valim
7f1a666db5 Fix failing tests and refactor assets.rake 2011-10-04 11:25:36 +02:00
Ben Woosley
88f60fd1a7 Changing rake db:schema:dump to run :environment as well as :load_config, as running :load_config alone will lead to the dumper being run without including extensions such as those included in foreigner and spatial_adapter.
This reverses a change made here: 5df72a238e (L0L324)

I'm assuming here that :load_config needs to be invoked separately from :environment, as it is elsewhere in the file for db operations, if not the alternative is to go back to "task :dump => :environment do".

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-04 11:25:20 +02:00
Kamil Sobieraj
de942e5534 :subdomain can now be specified with a value of false in url_for, allowing for subdomain(s) removal from the host during link generation. Closes #2025 2011-10-04 09:16:34 +01:00
Jared Mehle
80e0cd3290 Quoted path to <Rails.env>_structure.sql file in db:test:clone_structure task.
Leaving the path unquoted causes errors in paths containing spaces or dashes.
2011-10-03 14:50:40 -05:00
José Valim
1eac911962 Merge pull request #3202 from abscondment/3053-missing-headers
Use rack-cache 1.1
2011-10-03 12:28:31 -07:00
Brendan Ribera
b05a56f47d Require rack-cache 1.1.
Versions prior to 1.1 delete the If-Modified-Since and If-Not-Modified headers when
config.action_controller.perform_caching is true. This has two problems:
 * unexpected inconsistent behaviour between development & production environments
 * breaks applications that use of these headers
2011-10-03 11:32:24 -07:00
Brendan Ribera
57d9737f2f Test demonstrating #3053: If-Modified-Since gets swallowed up by rack-cache. 2011-10-03 11:32:24 -07:00
Jeremy Kemper
c10fcd2637 Merge pull request #2801 from jeremyevans/patch-1
Fix obviously breakage of Time.=== for Time subclasses
2011-10-03 10:53:09 -07:00
Manuel Menezes de Sequeira
547f4af2ca Several small corrections and clarifications to the Active Record Validations and Callbacks guide. 2011-10-03 18:03:35 +01:00
Aaron Patterson
e141cbdff5 Merge pull request #3191 from yahonda/activerecord_unittest_db2
To support ActiveRecord unit tests for IBM DB2
2011-10-03 09:04:46 -07:00
Yasuo Honda
8cc70cf32a Fix typo in Rakefile 2011-10-03 11:56:11 -04:00
José Valim
2120d7b838 Fix #3198. 2011-10-03 13:38:02 -02:00
Mark J. Titorenko
a7648c213d add failing test for #3198
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-03 13:36:26 -02:00
Santiago Pastorino
177ccbf773 Merge pull request #3200 from docwhat/spelling-booboo
Rescuable spelling error
2011-10-03 08:24:35 -07:00
Christian Höltje
bb5e295d94 Rescuable spelling error 2011-10-03 10:15:31 -04:00
Manuel Menezes de Sequeira
e3d4603151 Several small corrections and improvements to the Migrations and Active Record Basics guides. 2011-10-03 14:47:24 +01:00
Alexey Vakhov
8df7fe3f63 normalize arg for ActionView::TestCase tests method 2011-10-03 14:27:42 +04:00
Alexey Vakhov
0defbc6bfe normalize arg for ActionMailer::TestCase tests method 2011-10-03 14:27:41 +04:00
Sam Pohlenz
6f429f375e Ensure that enhancements to assets:precompile task are only run once
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-03 11:18:49 +02:00
Sam Pohlenz
0e1f7e0058 Replace calls to capture(:stdout) with quietly in assets tests
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-10-03 11:18:44 +02:00
José Valim
9c6d4801d1 Merge pull request #3193 from avakhov/patch-ac-test-case-safe-constantize
use safe_constantize instead constantize in AC::TestCase
2011-10-03 02:10:40 -07:00
José Valim
daca35c394 Merge pull request #3194 from avakhov/patch-ac-test-case-tests
normalize arg for AC::TestCase tests class method
2011-10-03 02:10:29 -07:00
Alexey Vakhov
8e946daf69 normalize arg for AC::TestCase tests class method 2011-10-03 12:12:07 +04:00
Alexey Vakhov
f51cb36fe9 missed underscore in AV::TestCase helper_method documentation 2011-10-03 10:36:13 +04:00
Alexey Vakhov
0eb80fabdd use safe_constantize instead constantize in AC::TestCase 2011-10-03 10:04:14 +04:00
Yasuo Honda
b564ffcad4 To support ActiveRecord unit tests for IBM DB2 2011-10-02 22:51:01 -04:00
José Valim
d68884f4fd :group => :assets should only run in the assets environment. 2011-10-02 22:08:33 +02:00
Xavier Noria
ac1fc5c594 rewords the docs of config.assets.initialize_on_precompile in the asset pipeline guide 2011-10-02 12:33:14 -07:00
Xavier Noria
6e00c05607 documents config.assets.initialize_on_precompile in the asset pipeline guide 2011-10-02 11:35:58 -07:00
Santiago Pastorino
c1547fcf6d Precompile properly refers files referenced with asset_path test 2011-10-02 13:57:29 -02:00
Santiago Pastorino
9b34e31155 capture was commented out 2011-10-02 13:52:29 -02:00
José Valim
753424079e Provide initialize_on_precompile which, when set to false, does not initialize the app for precompilation. Defaults to true. 2011-10-02 12:15:21 +02:00
José Valim
1efe41dc36 Merge pull request #3174 from phuibonhoa/master
Fixed file store to handle delete_matched being called before cache dir is created.
2011-10-02 02:30:44 -07:00
José Valim
6e8fe1bf02 TestCase should respect the view_assigns API instead of pulling variables on its own. 2011-10-02 11:29:13 +02:00
José Valim
63f6da050a Update CHANGELOG. 2011-10-02 11:17:06 +02:00
José Valim
5af5e77895 Merge pull request #2583 from guilleiguaran/railsrc
Read extra args for 'rails new' from ~/.railsrc
2011-10-02 02:13:30 -07:00
Philippe Huibonhoa
119a484e80 Improved testing so that it tests the real functionality and not the private method. 2011-10-02 01:39:52 -07:00
Guillermo Iguaran
101fb42106 Print information about .railsrc to users 2011-10-02 01:06:39 -05:00
Guillermo Iguaran
7039def6e1 Read extra args for 'rails new' from ~/.railsrc 2011-10-02 00:12:40 -05:00
José Valim
ec53b802da Merge pull request #3185 from arunagw/void_context_warnings_removed
Use of :: in void context Warning removed
2011-10-01 04:59:23 -07:00
Manuel Menezes de Sequeira
a917c2ba8b Several other small corrections. 2011-10-01 12:48:34 +01:00
Manuel Menezes de Sequeira
059c04d4dd Several small corrections and clarifications. 2011-10-01 11:39:00 +01:00
Arun Agrawal
b30ffbbfd6 Use of :: in void context Warning removed 2011-10-01 14:27:12 +05:30
Manuel Menezes de Sequeira
409268edfc Small typo corrected. 2011-09-30 23:28:51 +01:00
José Valim
926e97ca66 Merge pull request #3181 from yahonda/fix_uninitialized_constant_testfixtures
Modified how to handle if ActiveRecord is defined.
2011-09-30 09:44:26 -07:00
Yasuo Honda
44791a2bc6 Modified how to handle if ActiveRecord is defined. 2011-09-30 12:05:53 -04:00
José Valim
d4457dc32b Provide read_attribute_for_serialization as the API to serialize attributes. 2011-09-30 14:20:41 +02:00
José Valim
37b9594a8e Set the default options value for as_json in the encoder object. 2011-09-30 12:45:36 +02:00
José Valim
afeb8976a3 Merge pull request #3175 from nhocki/as-json-patch
Allow default options for `as_json` method on models
2011-09-30 03:42:53 -07:00
José Valim
fe157a7475 Merge pull request #3177 from arunagw/void_warnings_removed
possibly useless use of :: in void context Warning removed
2011-09-30 03:35:16 -07:00
José Valim
47a14a045e Merge pull request #3178 from arunagw/argument_warning_removed
warning removed : '&' interpreted as argument prefix
2011-09-30 03:34:38 -07:00
Arun Agrawal
b0b436ebce warning removed : '&' interpreted as argument prefix 2011-09-30 15:56:38 +05:30
Arun Agrawal
e81c427fe8 possibly useless use of :: in void context Warning removed 2011-09-30 14:13:58 +05:30
Nicolás Hock Isaza
da914fa35c Fixing as_json method for ActiveRecord models.
When you've got an AR Model and you override the `as_json` method,
you should be able to add default options to the renderer, like this:

    class User < ActiveRecord::Base
      def as_json(options = {})
        super(options.merge(:except => [:password_digest]))
      end
    end

This was not possible before this commit. See the added test case.
2011-09-29 21:44:23 -05:00
Philippe Huibonhoa
0baa8f8604 Added fix so that file store does not raise an exception when cache dir does not exist yet. This can happen if a delete_matched is called before anything is saved in the cache. 2011-09-29 18:59:40 -07:00
Santiago Pastorino
d2888de598 Add CHANGELOG entries 2011-09-29 16:49:31 -03:00
Jon Leighton
adb8ac153f Don't call self.class unless necessary. Closes #3171. 2011-09-29 18:00:30 +01:00
José Valim
4284e137ab Merge pull request #3167 from dmitriy-kiriyenko/honour_rails_env_environment_variable_when_running_rake
RAILS_ENV environment variable is ignored when running rake from thor script using Rails::Generators::Actions
2011-09-29 06:19:26 -07:00
Dmitriy Kiriyenko
148e4a5413 Honour RAILS_ENV environment variable when running rake. 2011-09-29 15:35:25 +03:00
Dmitriy Kiriyenko
78de4fcd05 When running "rake db:drop" also drop test database in development environment. 2011-09-29 15:07:09 +03:00
Uģis Ozols
62a9e5a960 Class name specified in example is Person, not AttributePerson. 2011-09-29 14:33:32 +03:00
Santiago Pastorino
64b0c8888b javascript_path and stylesheet_path should honor the asset pipelining 2011-09-28 20:13:24 -03:00
José Valim
ad304e9f7e Merge pull request #3159 from elliterate/digest_auth_with_query_string
Fixed digest authentication for requests with a query string [#3158]
2011-09-28 15:49:35 -07:00
Santiago Pastorino
a5e731856b Merge pull request #3156 from ihower/enhance_button_to_helper_v2
Make button_to helper support "form" option
2011-09-28 15:39:05 -07:00
Colin Shield & Ian Lesperance
41365a8275 Fixed digest authentication for requests with a query string [#3158] 2011-09-28 15:23:47 -07:00
Xavier Noria
cba3c00831 partial pass over the assets guide 2011-09-28 13:48:48 -07:00
Ryan Oblak
4535191c61 Modified String#pluralize to take an optional count parameter. 2011-09-28 12:24:06 -07:00
Wen-Tien Chang
3058d13a06 Make button_to helper support "form" option which is the form attributes. 2011-09-29 01:40:15 +08:00
Vijay Dev
f3b8cd9d36 fixing typo in assets guide 2011-09-28 13:35:46 +05:30
Jon Leighton
ddfa00c266 Merge pull request #3152 from rocky-jaiswal/fix-failed-ar-test
Fixed failed test under 1.8.7 as map.keys order in indeterminable
2011-09-28 00:57:21 -07:00
Rocky Jaiswal
aefc40324d Fixed failed test under 1.8.7 as map.keys order in indeterminable 2011-09-28 11:57:34 +05:30
Santiago Pastorino
771b76a3dc Merge pull request #3150 from avakhov/patch-html-sanitizer-cqi-require
add missing require to html sanitizer
2011-09-27 19:31:24 -07:00
Michael Hutchinson
0678a5bb18 Corrected a typo. 2011-09-27 18:11:01 -07:00
Justin Leitgeb
9f74ce2924 Make case in configuration document consistent 2011-09-27 18:45:27 -04:00
Xavier Noria
41c8277a9b the infamous detail only spotted in GitHub diffs no matter how careful you were before pushing 2011-09-27 13:55:41 -07:00
Xavier Noria
c612183ad1 partial pass over the asset pipeline 2011-09-27 13:51:06 -07:00
Alexey Vakhov
1bd88fdafd add missing require to html sanitizer 2011-09-27 23:39:52 +04:00
Vijay Dev
33b55cfbdb Merge branch 'master' of github.com:lifo/docrails 2011-09-28 00:04:45 +05:30
Vijay Dev
a775853d6a copy edit d47c2c4 2011-09-28 00:00:50 +05:30
José Valim
9a7e2b8d44 Merge pull request #3141 from jsl/make_ssl_configurable
Make the Rack::SSL middleware configurable
2011-09-27 00:44:18 -07:00
Justin Leitgeb
cb5c39f8a0 Make the Rack::SSL middleware configurable 2011-09-26 22:22:52 -04:00
Xavier Noria
01e5e2faeb partial pass over the asset pipeline guide 2011-09-26 18:19:25 -07:00
Diego Plentz
aafd4c0452 fixing docs for delete_sql where quotes should be used in this example. 2011-09-26 20:06:17 -03:00
Nicolás Hock Isaza
94ed1e2495 Alert about the new Bundler require for asset gems
If you are coming from a Rails 3.0 application, you won't have
the correct Bundler require statement.

This will cause the gems under the `assets` group not to be available
in the development and production environment.

I think this is related to the issue #39 in rails-sass
https://github.com/rails/sass-rails/issues/39
2011-09-26 16:34:42 -05:00
Alexey Vakhov
80f1d402e5 update ActionMailer example using last truncate helper method signature 2011-09-26 21:52:16 +04:00
Alexey Vakhov
893ee7f71d fix ActionMailer readme example 2011-09-26 21:46:25 +04:00
Jon Leighton
b3407c86cf Don't require a DB connection when setting primary key.
Closes #2807.
2011-09-26 18:15:09 +01:00
Santiago Pastorino
e97b6f2ef7 Merge pull request #3138 from christos/correct_image_path_with_pipeline
Correctly override image_path in sprockets rails_helper
2011-09-26 10:02:02 -07:00
Santiago Pastorino
cf90181d84 Merge pull request #3136 from guilleiguaran/clear-digests-on-precompile
Avoid use of existing precompiled assets during rake assets:precompile run
2011-09-26 13:57:07 -03:00
Christos Zisopoulos
1996e93eaa Refactor image_path to use asset_path directly 2011-09-26 18:56:30 +02:00
Santiago Pastorino
17882d2a9e Copy assets to nondigested filenames too 2011-09-26 13:54:06 -03:00
Christos Zisopoulos
b8ea31540a Correctly override image_path in sprockets rails_helper 2011-09-26 18:45:49 +02:00
Jon Leighton
89e98e278a Merge pull request #3030 from htanata/fix_habtm_select_query_method
Fix: habtm doesn't respect select query method
2011-09-26 16:52:23 +01:00
Santiago Pastorino
d6cff93152 Just assert_equal here 2011-09-26 12:20:52 -03:00
Santiago Pastorino
2c3a5075b6 Merge pull request #3135 from christos/respect_assets_digest_value
Give precedence to `config.digest = false` over the existence of manifest.yml asset digests
2011-09-26 08:16:02 -07:00
Jon Leighton
3b87c38d02 Fix belongs_to polymorphic with custom primary key on target.
Closes #3104.
2011-09-26 15:42:34 +01:00
José Valim
5c0e9333c0 Encapsulate assets initialization in its own rake task. 2011-09-26 16:31:30 +02:00
Santiago Pastorino
b855327443 image_tag should use /assets if asset pipelining is turned on. Closes #3126 2011-09-26 11:20:30 -03:00
Christos Zisopoulos
793e9da63d Give precedence to config.digest = false over manifest.yml asset digests 2011-09-26 14:27:04 +02:00
Jon Leighton
a15424b92c Make serializable_hash take attr values directly from attributes hash.
Previously, it would use send() to get the attribute. In Active
Resource, this would rely on hitting method missing. If a method with
the same name was defined further up the ancestor chain, that method
would wrongly be called.

This change fixes test_to_xml_with_private_method_name_as_attribute in
activeresource/test/cases/base_test.rb, which was broken after
51bef9d8fb, because that change made
to_xml use serializable_hash.
2011-09-26 12:40:03 +01:00
Jon Leighton
b838059817 CollectionProxy#replace should change the DB records rather than just mutating the array. Fixes #3020. 2011-09-26 10:41:58 +01:00
Chris Kimpton
51cc6e4f1c Fixed typo that I added - doh. 2011-09-26 09:21:12 +02:00
Chris Kimpton
d47c2c4620 Clarify that the Active Record config should just work automatically 2011-09-26 08:17:28 +02:00
Chris Kimpton
4b9b2f3d04 add some notes on setup for Active Record tests 2011-09-26 08:06:41 +02:00
Vijay Dev
541018a07b fix deprecation warning in cookie_store_test
The options argument to MessageVerifier#initialize should be a hash.
2011-09-25 23:21:37 +05:30
José Valim
6185929882 Merge pull request #3125 from dolzenko/master
Implement Mime::Type#respond_to? (consistently with #method_missing) Closes #3032
2011-09-25 05:26:18 -07:00
Evgeniy Dolzhenko
86cf3fb5fa Implement Mime::Type#respond_to? (consistently with #method_missing) 2011-09-25 13:03:01 +01:00
José Valim
933ba0cf6e Merge pull request #3124 from avakhov/patch-6-stylesheet-link
escape options for the stylesheet_link_tag method
2011-09-25 04:03:13 -07:00
José Valim
ef4d1cebbc Merge pull request #2246 from guilleiguaran/sprockets-compressors-api
Public API for add new compressors to Sprockets
2011-09-25 04:01:37 -07:00
Alexey Vakhov
5ffa69793f escape options for the stylesheet_link_tag method 2011-09-25 09:40:49 +04:00
Guillermo Iguaran
038808ba1a Add public API for register new js and css compressors for Sprockets 2011-09-24 19:22:13 -05:00
Santiago Pastorino
6eaa9f0dad Merge pull request #3123 from avakhov/patch-5-remove-superfluous-to-s
remove superfluous to_s in ERB::Util.html_escape
2011-09-24 14:22:44 -07:00
Santiago Pastorino
d54ff41f8e Merge pull request #3121 from cablegram/3-1-stable
Re-launch assets:precompile task using (Rake.)ruby instead of Kernel.exec so it works on Windows
2011-09-24 18:18:30 -03:00
Santiago Pastorino
3de95fd930 Revert "Make process reuse the env var passed as argument"
This reverts commit 0e4748cd41.
2011-09-24 17:19:42 -03:00
Alexey Vakhov
f916474962 remove superfluous to_s in ERB::Util.html_escape 2011-09-24 23:27:06 +04:00
José Valim
e69011521d Avoid using pathnames and automatically create the manifest directory if one does not exist yet. 2011-09-24 03:17:49 +02:00
José Valim
e9b02ae27a Add test for belongs_to? and group initializers. 2011-09-24 03:17:43 +02:00
José Valim
6795a9b309 Remove the ENV flag, yagni. 2011-09-24 03:17:37 +02:00
José Valim
eb367afeed rake assets:precompile loads the application but does not initialize it.
To the app developer, this means configuration add in
config/initializers/* will not be executed.

Plugins developers need to special case their initializers that are
meant to be run in the assets group by adding :group => :assets.

Conflicts:

	railties/CHANGELOG
	railties/test/application/assets_test.rb
2011-09-24 03:17:23 +02:00
Santiago Pastorino
096717e6f7 Merge pull request #3115 from guilleiguaran/refactor-rails-helpers
Remove Sprockets compute_public_path, AV compute_plubic_path can be used
2011-09-23 12:07:30 -07:00
Guillermo Iguaran
a29c2bfba3 Remove Sprockets compute_public_path, AV compute_public_path can be used directly 2011-09-23 14:00:53 -05:00
José Valim
8bde477e9d Merge pull request #3114 from zenprogrammer/fix_constantize_doc
Minor doc fix to String#constantize
2011-09-23 10:30:15 -07:00
Ryan Oblak
06634f44d0 Minor doc fix to String#constantize 2011-09-23 10:21:34 -07:00
Santiago Pastorino
5dcb269eb8 Merge pull request #3092 from asee/master
Sprockets to use config.assets.prefix, with tests
2011-09-23 09:34:04 -07:00
José Valim
36699977f2 Update CHANGELOG for safe_constantize. 2011-09-23 16:49:05 +02:00
José Valim
e8987c30d0 Use safe_constantize where possible. 2011-09-23 16:46:33 +02:00
José Valim
b2f34d1e35 Ensure that constantize just rescues NameError that applies to the constant being currently loaded. 2011-09-23 16:21:49 +02:00
Ryan Oblak
310565f537 Added ActiveSupport::Inflector.safe_constantize and String#safe_constantize; refactored common constantize tests into ConstantizeTestCases 2011-09-23 15:36:33 +02:00
Waynn Lue
17ba60a724 pluralize "locales" since that's what's used in other parts of the document, and add a missing "on" 2011-09-23 00:25:37 -07:00
José Valim
d62fc8e021 Update CHANGELOG. 2011-09-23 00:44:55 +02:00
José Valim
48d27363f2 Fix failing tests and add tests for :formats on partial. 2011-09-23 00:42:20 +02:00
Nick Sutterer
552df29cc8 Using #extract_details in PartialRenderer, too! 2011-09-23 00:36:17 +02:00
Nick Sutterer
2e3eb2560b Allow both sym and array for details options in #render. using LC#registered_details to extract options. 2011-09-23 00:36:14 +02:00
Nick Sutterer
f8e6664d86 added tests for render :file/:template and the :formats/:handlers/:locale options. 2011-09-23 00:36:10 +02:00
José Valim
4bfbdc133a Refactor AMo as_json. 2011-09-23 00:19:46 +02:00
José Valim
c19c55582b Merge pull request #3106 from mattetti/master
ActiveModel JSON serialization bug fix
2011-09-22 14:24:39 -07:00
Matt Aimonetti
6e78bbea90 fixed a bug with the json serialization when the class setting is set to not include the root, but an instance is serialized with the root option passed as true 2011-09-22 14:05:25 -07:00
Terence Lee
9d46823b5d set env to let rails know we're precompiling 2011-09-22 20:54:02 +02:00
Terence Lee
1de89e5e07 AR wants sqlite3 1.3.4 2011-09-22 20:01:57 +02:00
docunext
c070cc4ab4 Fixes #1489 again, with updated code and numerous tests to confirm 2011-09-22 13:43:08 -04:00
Santiago Pastorino
667ef57de6 No need to create a range object 2011-09-22 14:14:24 -03:00
Santiago Pastorino
855184c468 Merge pull request #3096 from phuibonhoa/master
FileStore key_file_path does not properly limit filenames to 255 characters
2011-09-22 10:03:54 -07:00
José Valim
43d27e9105 Deprecate passing the template handler in the template name.
For example, calling hello.erb is now deprecated. Since Rails 3.0
passing the handler had no effect whatsover. This commit simply
deprecates such cases so we can clean up the code in later releases.
2011-09-22 15:37:38 +02:00
José Valim
c3fa2e9bf8 Make handlers a registered detail. 2011-09-22 15:06:04 +02:00
José Valim
119e9e2daf Get rid of update_details in favor of passing details to find_template. 2011-09-22 15:03:05 +02:00
Nick Sutterer
cbaad674f1 it is now possible to pass details options (:formats, :details, :locales, ...) to #render, #find_template and friends. this doesn't change anything in global context. 2011-09-22 14:12:36 +02:00
Nick Sutterer
41bca5d466 Add rake test:template. 2011-09-22 14:00:53 +02:00
José Valim
1ca3fbfbf2 No need to recalculate the @details_key after update_details. 2011-09-22 12:26:37 +02:00
José Valim
8de0bbe0b4 Merge pull request #3099 from wrozka/master
Named routes are modifying passed options
2011-09-22 02:56:00 -07:00
Pawel Pierzchala
019eea4a38 Fix named routes modifying arguments 2011-09-22 09:57:00 +02:00
Philippe Huibonhoa
a0352a425f Updated existing test that fails with this fix (8d63678d14). Before the fix the test was giving a false positive, because file_store.key_file_path would return an empty filename (i.e. test/tmp_cache/4D0/F4D rather than test/tmp_cache/4D0/F4D/xxxx…).
Even though the fix referenced above divides the filename into directories to prevent it from being too long, it seems that 1000 characters will always raise an error, so reducing the key size to 900).
2011-09-21 21:03:59 -07:00
Philippe Huibonhoa
8d63678d14 Fixed issue in file store where it could create a filename that was too long for the file system. (https://github.com/rails/rails/issues/3072) 2011-09-21 21:00:46 -07:00
Santiago Pastorino
2bf33bd4bc Merge pull request #3027 from alex3/assets-precompile-regex-fix
Default precompile regex was erroneously matching files
2011-09-21 18:25:40 -07:00
Santiago Pastorino
676ddfcf71 Merge pull request #3081 from guilleiguaran/move-precompile-to-class
Move precompiling from task to Sprockets::StaticCompiler
2011-09-21 17:21:44 -07:00
Christopher Arrowsmith
efb8a7a7b9 Changed "en-UK" to "en-GB"
Signed-off-by: Christopher Arrowsmith <chris@agouti.co.uk>
2011-09-22 01:18:22 +01:00
Santiago Pastorino
007f567011 Add jquery-rails to Gemfile of plugins, test/dummy app uses it.
Closes #3091
2011-09-21 20:53:08 -03:00
José Valim
f373f296d0 Slightly reorganize lookup context modules in order to better isolate cache responsibilities. 2011-09-21 15:37:10 -07:00
Vijay Dev
8aa537c945 fix incorrect comment 2011-09-22 02:13:04 +05:30
Vijay Dev
caa95ab6d8 Merge branch 'master' of github.com:lifo/docrails 2011-09-21 19:35:09 +05:30
Vijay Dev
3e80462b95 Revert "add a missing "on" and remove the "endprologue" text"
This reverts commit 3c5340ec9c.

Reason: endprologue should not have been removed.
2011-09-21 19:28:36 +05:30
Vijay Dev
8d7aee7173 indentation fixes 2011-09-21 19:21:58 +05:30
Waynn Lue
3c5340ec9c add a missing "on" and remove the "endprologue" text 2011-09-21 02:10:07 -07:00
Waynn Lue
564d7edf69 add a '.' to etc 2011-09-21 01:28:59 -07:00
Waynn Lue
952bccd1ab add "the" to mirror the structure of the other two points 2011-09-21 01:23:58 -07:00
Santiago Pastorino
95646f44fd Merge pull request #3065 from brainopia/fix_to_param_test
Fix test to reflect use of to_param for keys
2011-09-20 20:57:41 -07:00
Guillermo Iguaran
857d20efda Move precompile task to Sprockets::StaticCompiler 2011-09-20 22:01:09 -05:00
Vijay Dev
5684ecf749 copy edits 302e5707 2011-09-20 19:47:33 +05:30
Vijay Dev
ed1ada84ac copy edits 908f2616 2011-09-20 19:46:59 +05:30
Vijay Dev
7ed97bc814 remove unnecessary markup 2011-09-20 19:33:01 +05:30
Santiago Pastorino
7dbf6960c0 Merge pull request #3064 from arunagw/jruby_test_fix_query_cache_test
fix test error when running with postgresql.
2011-09-19 12:35:18 -07:00
brainopia
8e3d26733b Fix test to reflect use of to_param for keys 2011-09-18 23:37:27 +04:00
Arun Agrawal
d589d9f160 fix test error when running with postgresql.
This Sqlite3 should be in if block.
Was giving error because sqlite3 is not loaded
2011-09-18 23:20:09 +05:30
José Valim
51bef9d8fb to_xml should also rely on serializable hash. 2011-09-18 09:09:01 -07:00
Jan Vlnas
ea29968bcf Locale code for Czech is ":cs" 2011-09-18 16:41:21 +03:00
Santiago Pastorino
cb0dbe35b8 Merge pull request #3049 from brainopia/fix_to_query_edge_case
Fix Hash#to_query edge case with html_safe string on 1.8 ruby
2011-09-17 17:15:33 -07:00
Santiago Pastorino
364879c61e Merge pull request #3057 from arunagw/arjdbc_bump_master
Bump AR-JDBC version.
2011-09-17 17:12:48 -07:00
Santiago Pastorino
03346dfae7 Merge pull request #3058 from arunagw/jruby_query_cache_test
Fixed test for JRuby.
2011-09-17 17:07:31 -07:00
Ryan Bigg
908f2616d5 Document ActiveRecord::QueryMethods#select 2011-09-17 16:08:58 -07:00
Arun Agrawal
afa78fe327 Fixed test for JRuby.
for Sqlite3 in AR-JDBC.It's Jdbc::SQLite3::VERSION
2011-09-18 00:23:48 +05:30
Arun Agrawal
b2bf725d79 Bump AR-JDBC version.
THis version is compatible with 3.1 and above
2011-09-17 18:39:30 +05:30
Uģis Ozols
663031801c sass-rails helpers - hyphenated in Sass, underscored in Ruby. 2011-09-17 10:00:53 +03:00
Alex Yakoubian
6e63e029b3 Default precompile regexp that properly matches application.js and application.css 2011-09-16 20:46:37 -07:00
Santiago Pastorino
18116791d0 Proper lines numbers for stack trace info 2011-09-16 17:28:52 -07:00
brainopia
3a04e370e4 Fix Hash#to_query edge case with html_safe string on 1.8 ruby 2011-09-16 22:59:16 +04:00
Vijay Dev
27f1320fde Fixing incorrect notextile tags 2011-09-16 23:22:50 +05:30
Vijay Dev
8411f631c4 minor edit 2011-09-16 23:22:50 +05:30
Vijay Dev
e314b3ff6d Merge pull request #3048 from masterkain/patch-2
Fix typo in deprecation notice
2011-09-16 10:41:18 -07:00
Claudio Poli
b0ae34ad72 Fix typo in deprecation notice 2011-09-16 19:54:48 +03:00
Kir Shatrov
9f0db93250 Merge pull request #68 from kirs/master
Paragraph about using variables in I18n translations was added to I18n Guide
2011-09-16 06:44:04 -07:00
Kir Shatrov
302e570777 "Passing variables into the translation" section added 2011-09-16 17:43:05 +04:00
Vijay Dev
d5bf12aca6 Merge pull request #3042 from splattael/patch-1
Fix typo in deprecation warning.
2011-09-16 06:17:15 -07:00
Peter Suschlik
c9aac2a215 Fix typo in deprecation warning. 2011-09-16 09:08:53 +03:00
José Valim
79c7f23376 Merge pull request #3040 from guilleiguaran/asset-host-should-not-be-nil-precompile
config.action_controller.asset_host shouldn't set to nil during precompile
2011-09-15 18:08:42 -07:00
Guillermo Iguaran
28677014a4 Add reference about --skip-sprockets to Asset Pipeline Guide 2011-09-15 20:07:01 -05:00
Guillermo Iguaran
b50394bf84 config.action_controller.asset_host shouldn't set to nil during precompile 2011-09-15 19:55:52 -05:00
José Valim
8a32a58f6f Merge pull request #3037 from wvanbergen/master
MessageVerifier: set serializer and crypto algorithm using an option hash
2011-09-15 13:22:05 -07:00
Willem van Bergen
6d520803ee Test deprecation warning when not using an options hash as second parameter. 2011-09-15 15:51:30 -04:00
Willem van Bergen
41fea03342 Use an options hash to specify digest/cipher algorithm and a serializer for MessageVerifier and MessageEncryptor. 2011-09-15 14:27:12 -04:00
José Valim
28300f4ea8 Merge pull request #3035 from wvanbergen/master
Make API for custom message serializers nicer.
2011-09-15 10:50:19 -07:00
Willem van Bergen
2d30d4cb88 Add some documentation for the new serializer property of MessageVerifier and MessageEncryptor. 2011-09-15 13:23:08 -04:00
Willem van Bergen
db040cdf8b Implement API suggestions of pull request. 2011-09-15 13:15:21 -04:00
José Valim
06c3ca8173 Merge pull request #3031 from wvanbergen/master
Custom serializers and deserializers in MessageVerifier and MessageEncryptor.
2011-09-15 09:14:16 -07:00
Willem van Bergen
a8aaef6762 Fixed tests so that they will also run properly in other timezones. 2011-09-15 09:50:39 -04:00
Willem van Bergen
bffaa888ac Custom serializers and deserializers in MessageVerifier and MessageEncryptor.
By default, these classes use Marshal for serializing and deserializing messages. Unfortunately, the Marshal format is closely associated with Ruby internals and even changes between different interpreters. This makes the resulting message very hard to impossible to unserialize messages generated by these classes in other environments like node.js.

This patch solves this by allowing you to set your own custom serializer and deserializer lambda functions. By default, it still uses Marshal to be backwards compatible.
2011-09-15 08:28:53 -04:00
Alexey Vakhov
7531aa7641 update guides, use html safe translations in i18n 2011-09-15 10:41:55 +04:00
Santiago Pastorino
da7f0426ec Allow asset tag helper methods to accept :digest => false option in order to completely avoid the digest generation. 2011-09-14 15:02:17 -07:00
Vijay Dev
49476eee78 Merge branch 'master' of github.com:lifo/docrails 2011-09-15 00:32:52 +05:30
Vijay Dev
9980f46ca2 No more changelogs inside guides 2011-09-15 00:13:29 +05:30
Vijay Dev
5f2a35604e Mention that old fixes are to be done on 3-0-stable 2011-09-14 23:39:55 +05:30
Vijay Dev
dcd70773fc minor edit 2011-09-14 23:15:18 +05:30
Vijay Dev
5e1285dfb3 change first_or_new to first_or_initialize as per 11870117, and some edits 2011-09-14 23:08:31 +05:30
Vijay Dev
823e16f57c update 3.1 release date in changelogs 2011-09-14 22:46:12 +05:30
Dallas Reedy
bc058509a8 forgot to sign my name to the Changelog 2011-09-14 09:32:27 -07:00
Dallas Reedy
c7835c5161 Removed mention of deprecated proxy methods in favor of using proxy_association. 2011-09-14 09:16:54 -07:00
Vijay Dev
7302e1cdf2 remove info about guides hackfest 2011-09-14 19:02:33 +05:30
José Valim
63f6fad644 Merge pull request #3015 from guilleiguaran/clear-tmp-cache-on-precompile
Clear cache before of each precompile to avoid inconsistencies. Fixes #3014
2011-09-14 05:26:53 -07:00
Santiago Pastorino
425362da31 Merge pull request #3012 from guilleiguaran/3-1-1-changelogs
Add missing changelog entries for actionpack
2011-09-14 00:58:44 -07:00
Santiago Pastorino
0d48b3afa9 Revert "Provide a way to access to assets without using the digest, useful for static files and emails"
This reverts commit 82afaa0686.
2011-09-14 00:29:03 -07:00
Santiago Pastorino
5f28c22722 Merge pull request #2964 from msgehard/silence_warnings
Silence Ruby warnings about uninitialized instance variable.
2011-09-14 00:27:45 -07:00
Ben Walding
b3ff720567 Add equivalent nginx configuration 2011-09-14 15:27:38 +10:00
Guillermo Iguaran
9c7e885007 Clear cache before of each precompile to avoid inconsistencies. Fixes #3014 2011-09-13 22:06:29 -05:00
Guillermo Iguaran
fae70cb6bc Add missing changelog entries for actionpack 2011-09-13 19:40:47 -05:00
Ryan Bigg
681c4dbb02 Add documentation for the extending method in ActiveRecord:QueryMethods 2011-09-14 09:43:31 +10:00
Santiago Pastorino
410b0ec1b7 Merge pull request #3011 from guilleiguaran/disable-sprockets-server
Don't mount Sprockets if config.assets.compile is disabled
2011-09-13 16:40:53 -07:00
Guillermo Iguaran
a89d39ec88 Fix broken asset test 2011-09-13 18:36:38 -05:00
Mark J. Titorenko
f22407dd34 Don't mount Sprockets at config.assets.prefix if config.assets.compile is false. 2011-09-13 18:16:52 -05:00
Jon Leighton
3b8a7cf2a7 Stop trying to be clever about when to define attribute methods.
There is no meaningful performance penalty in defining attribute
methods, since it only happens once.

There is also no reason *not* to define them, since they get thrown in
an included module, so they will not 'overwrite' anything. In fact, this
is desirable, since it allows us to call super.
2011-09-14 00:00:37 +01:00
Jon Leighton
778c82bea6 Generate attribute method unless it's already in the module.
There's no harm in generating a method name that's already defined on
the host class, since we're generating the attribute methods in a module
that gets included. In fact, this is desirable as it allows the host
class to call super.
2011-09-14 00:00:37 +01:00
Jon Leighton
55da28dd2f We don't need to build a set for DangerousAttributeError.
We can just use method_defined? and private_method_defined?
2011-09-14 00:00:37 +01:00
Santiago Pastorino
82afaa0686 Provide a way to access to assets without using the digest, useful for static files and emails 2011-09-13 15:18:21 -07:00
Jaime Iniesta
bde113a82e Fix typos and broken link on asset pipeline guide 2011-09-14 00:09:59 +02:00
Erik Behrends
3777d4217b [:class_name] option in belongs_to should mention belongs_to and not has_one 2011-09-13 22:42:39 +03:00
Jon Leighton
11870117c6 Rename first_or_new to first_or_initialize.
For consistency with find_or_initialize_by. Also remove first_or_build
alias.
2011-09-13 19:09:01 +01:00
Vijay Dev
d3baa92831 delete stray backup files from guides sample app 2011-09-13 18:46:34 +05:30
Vijay Dev
23fc5fe0e2 Merge branch 'master' of github.com:lifo/docrails 2011-09-13 18:39:36 +05:30
45north
7b22b01930 Fixed markup error. 2011-09-13 15:25:46 +03:00
Mike Gunderloy
317ad8cb62 Fix typo 2011-09-13 06:47:13 -05:00
Santiago Pastorino
ae04fbfee9 Fix asset_path relative_url_root method 2011-09-13 02:45:05 -07:00
Santiago Pastorino
60fd88d2f7 Merge pull request #3001 from guilleiguaran/fix-assets-precompile-host-test
Fix precompile asset_host test
2011-09-13 02:41:27 -07:00
Guillermo Iguaran
a65010fddb Fix precompile asset_host test 2011-09-13 04:35:12 -05:00
Santiago Pastorino
8a005ff504 Merge pull request #3000 from guilleiguaran/fix-relative-url-root
Fix for relative url root in assets
2011-09-13 02:29:33 -07:00
Guillermo Iguaran
f509b6988b Fix for relative url root in assets 2011-09-13 04:27:30 -05:00
Santiago Pastorino
536bb7b135 Merge pull request #2996 from guilleiguaran/move-assets-tests
Move asset tests to assets_test file
2011-09-13 01:27:58 -07:00
Guillermo Iguaran
e767cda6ea Move asset tests to assets_test file 2011-09-13 03:19:02 -05:00
Santiago Pastorino
5bad79d930 always rewrite_relative_url_root 2011-09-13 00:27:29 -07:00
Santiago Pastorino
f1c3903f5c Merge pull request #2993 from deepakprasanna/generator_test_fix
fixed the failing generators_test in railties.
2011-09-12 23:51:23 -07:00
Deepak Prasanna
73e8dd189b fixed the failing generators_test 2011-09-13 11:59:40 +05:30
Santiago Pastorino
b0cee70354 Merge pull request #2977 from guilleiguaran/fix-relative-root-in-assets
Set relative url root in assets when controller isn't available for Sprockets
2011-09-12 23:25:28 -07:00
Santiago Pastorino
038e45a2b6 Merge pull request #2987 from kennyj/master
fix https://github.com/rails/rails/issues/2947 (with testcase)
2011-09-12 23:04:14 -07:00
Guillermo Iguaran
9279d1102c Set relative url root in assets when controller isn't available for Sprockets. Fix #2435
See https://github.com/rails/sass-rails/issues/42 for details
2011-09-13 01:02:44 -05:00
Aaron Patterson
f65b2215cd removing backwards compatibility module 2011-09-12 16:50:49 -07:00
Aaron Patterson
68ec26c70c point rails at Journey for dev and edge 2011-09-12 16:50:49 -07:00
Aaron Patterson
ea7ef9597e partially expand the parameters to match 2011-09-12 16:50:49 -07:00
Aaron Patterson
ad1a891649 unfactor the Route class to private factory methods 2011-09-12 16:50:49 -07:00
Aaron Patterson
943aa826a4 reduce dependencies of external objects in the Route class 2011-09-12 16:50:49 -07:00
Aaron Patterson
f5ab6805ed delete unused code, pass path explicitly to journey 2011-09-12 16:50:49 -07:00
Aaron Patterson
d21e0e2af3 adjust route inspection to work with Journey 2011-09-12 16:50:48 -07:00
Aaron Patterson
a08bee7841 all routes can be stored in the Journey Routes object 2011-09-12 16:50:48 -07:00
Aaron Patterson
b7ccfa96d2 clear! does not need to be called from initialize 2011-09-12 16:50:48 -07:00
Aaron Patterson
59b9fe961d reuse the route collection and formatter by clearing them 2011-09-12 16:50:48 -07:00
Aaron Patterson
4ffe667ab7 Instantiate each part of our routing system:
* A collection of Routes
  * The Router, which consults the collection of routes
  * A formatter that consults the collection of routes
2011-09-12 16:50:48 -07:00
Aaron Patterson
537ed6eb2f stop freezing the routes 2011-09-12 16:50:47 -07:00
Aaron Patterson
a05a9ff1ca stop using a hash for parameterizing 2011-09-12 16:50:47 -07:00
Aaron Patterson
5f0b37c486 Switching rack-mount to journey. 2011-09-12 16:50:47 -07:00
Jon Leighton
1a421ceccb Deprecate using method_missing for attributes that are columns.
This shouldn't ever happen unless people are doing something
particularly weird, but adding a deprecation in case there are bugs not
caught by our tests.
2011-09-13 00:03:09 +01:00
Jon Leighton
c89e1c7bde Add an attribute_missing method to ActiveModel::AttributeMethods.
This can be overloaded by implementors if necessary.
2011-09-13 00:02:33 +01:00
Jon Leighton
6d8dbeca6b Avoid double super call in some cases.
If super was false earlier, it is still going to be false, so we don't
need to call it again at the end of the method.
2011-09-13 00:01:58 +01:00
Jon Leighton
ac687ed651 Let Ruby deal with method visibility.
Check respond_to_without_attributes? in method_missing. If there is any
method that responds (even private), let super handle it and raise
NoMethodError if necessary.
2011-09-13 00:01:58 +01:00
Jon Leighton
cf115d2f8e Reset column info when messing with columns.
We are subclassing Session here, but messing with the columns will
affect the attribute methods defined on the Session superclass, and
therefore other tests, unless we properly isolate it by resetting column
info before and after the test run.
2011-09-13 00:01:58 +01:00
Jon Leighton
eecfa84a90 Always generate attribute methods on the base class.
This fixes a situation I encountered where a subclass would cache the
name of a generated attribute method in @_defined_class_methods. Then,
when the superclass has it's attribute methods undefined, the subclass
would always have to dispatch through method_missing, because the
presence of the attribute in @_defined_class_methods would mean that it
is never generated again, even if undefine_attribute_methods is called
on the subclass.

There various other confusing edge cases like this. STI classes share
columns, so let's just keep all the attribute method generation state
isolated to the base class.
2011-09-13 00:01:58 +01:00
Jon Leighton
50d395f96e Raise error when using write_attribute with a non-existent attribute.
Previously we would just silently write the attribute. This can lead to
subtle bugs (for example, see the change in AutosaveAssociation where a
through association would wrongly gain an attribute.

Also, ensuring that we never gain any new attributes after
initialization will allow me to reduce our dependence on method_missing.
2011-09-13 00:01:58 +01:00
Jon Leighton
8667d3aeb6 Make protected method public so we avoid method_missing. 2011-09-13 00:01:58 +01:00
Jon Leighton
3386a089ef Fix warnings.
Make sure we don't redefine an already-defined attribute method.
2011-09-13 00:01:57 +01:00
Jon Leighton
99bd6b53da Add deprecation for doing attribute_method_suffix '' 2011-09-13 00:01:57 +01:00
Jon Leighton
93d574c962 refactoring 2011-09-13 00:01:57 +01:00
Jon Leighton
8b8b7143ef Use an empty AttributeMethodMatcher by default.
This means that attribute methods which don't exist will get generated
when define_attribute_methods is called, so we don't have to use hacks
like `attribute_method_suffix ''`.
2011-09-13 00:01:57 +01:00
Jon Leighton
8d59e0b263 Alias id= if necessary, rather than relying on method_missing 2011-09-13 00:01:57 +01:00
dharmatech
7d235b972b getting_started.textile: Fix typo and split up a sentence in section "Building a Multi-Model Form" 2011-09-12 15:55:01 -05:00
Santiago Pastorino
1a4ea1bc97 Merge pull request #2988 from guilleiguaran/remove-extra-line
Remove odd asignation
2011-09-12 11:49:43 -07:00
Guillermo Iguaran
f746927889 Remove odd asignation 2011-09-12 13:16:55 -05:00
Vijay Dev
c5c448221f Merge pull request #67 from alanzeino/master
'Getting Started' guide typo fix
2011-09-12 11:00:16 -07:00
kennyj
21eaba4c39 fix https://github.com/rails/rails/issues/2947 (with testcase) 2011-09-13 02:59:57 +09:00
Vijay Dev
acc6252cb0 Delete contribute.textile now that its contents are merged to the contributing_to_ruby_on_rails guide 2011-09-12 23:25:33 +05:30
Vijay Dev
c5118f29de change GH issue tracker url 2011-09-12 23:24:14 +05:30
José Valim
e9db21743b Use the proper executable on tests. 2011-09-12 10:53:20 -07:00
Santiago Pastorino
d762e22c04 Merge pull request #2985 from kennyj/master
fix https://github.com/rails/rails/issues/2582 (with testcase)
2011-09-12 10:18:19 -07:00
Jon Leighton
8397a564cb Merge pull request #2678 from jmileham/ares_content_length_bug
ActiveResource shouldn't rely on the presence of Content-Length
2011-09-12 10:11:39 -07:00
dharmatech
70198fdb36 getting_started.textile: Fix typos in section "Rendering a Partial Form" 2011-09-12 12:05:15 -05:00
Semyon Perepelitsa
21b4244d41 Fix a typo in date 2011-09-12 20:53:10 +04:00
kennyj
3ce830272e fix https://github.com/rails/rails/issues/2582 (with testcase) 2011-09-13 01:06:31 +09:00
José Valim
11fa70dd09 Just provide the executable for railtie. This should be fine since Rubygems now warns before overriding them. 2011-09-12 09:05:11 -07:00
Xavier Noria
63082af306 Merge pull request #2984 from jrgifford/master
Added getting_started application to railties/guides/code/getting_started
2011-09-12 07:49:36 -07:00
James Gifford
d7154d4832 Added getting_started code, updated guide with link to rails github repo and path to code 2011-09-12 10:30:45 -04:00
Alan Zeino
6e782f8944 Slight change to reflect current 'destroy' code generated by scaffold in 3.1 release. 2011-09-12 11:12:09 +10:00
Santiago Pastorino
4bcacc8066 Merge pull request #2936 from joelmoss/migration_status
db:migrate:status not looking at all migration paths
2011-09-11 17:06:21 -07:00
John Mileham
a06d17480f ActiveResource shouldn't rely on the presence of Content-Length 2011-09-11 14:46:50 -04:00
Vijay Dev
e47bb1cbe7 merged the contribution guides and changed the
link in the layout accordingly
2011-09-11 19:45:41 +05:30
Vijay Dev
95fdaf965a Merge branch 'master' of github.com:lifo/docrails 2011-09-11 17:41:39 +05:30
Emin Hasanov
715b0996ca Merge pull request #66 from hasanove/master
typo in asset pipeline guide
2011-09-11 03:36:24 -07:00
Emin Hasanov
22a4f7e8bd Fix typo in "must-revalidate" header name 2011-09-11 14:18:07 +06:00
Andy Lindeman
28e32598b9 Fix for :instance_reader => false code example 2011-09-10 21:49:13 -04:00
Santiago Pastorino
a9509284ca Merge pull request #2974 from md5/csrf_token_warning
Use ensure instead of rescue
2011-09-10 17:29:04 -07:00
Ray Baxter
41d179b7d6 Revert "Fixed syntax error in "block setting of attributes" example."
Code and CHANGELOGS can't be edited in docrails.
You'll need to make this change in rails/rails.

This reverts commit 465752ba6b.
2011-09-10 13:50:33 -07:00
Erik Ostrom
465752ba6b Fixed syntax error in "block setting of attributes" example. 2011-09-10 13:39:25 -05:00
Mike Dillon
dbef311819 Use ensure instead of rescue 2011-09-10 11:01:22 -07:00
Aaron Patterson
d0946fdd57 Merge pull request #2972 from md5/master
Use log.warn instead of debug for CSRF token warning
2011-09-10 10:45:47 -07:00
Xavier Noria
e8e1911738 clarify that documentation bugs have to be reported as Rails issues. [Closes #2858] 2011-09-10 19:29:50 +02:00
Mike Dillon
e7e6515146 Fix changelog entry 2011-09-10 09:54:57 -07:00
Mike Dillon
538fb18dea Add test for warning and CHANGELOG entry 2011-09-10 09:51:55 -07:00
Santiago Pastorino
0a6756802c Merge pull request #2970 from deepakprasanna/master
Added a case to check the status of the migration after a rollback and redo.
2011-09-10 09:20:02 -07:00
Vijay Dev
365aaeac35 Merge pull request #2968 from arunagw/form_helper_test
No need to use </form> here. It's already in whole_form block
2011-09-10 09:00:19 -07:00
Mike Dillon
7fb99e5743 Change log level for CSRF token verification warning 2011-09-10 08:31:04 -07:00
Michael P Laing
8a0876478d Update to conform to rails 3.1 generated caode 2011-09-10 16:38:50 +02:00
Deepak Prasanna
ab5f487184 added test for db migrate:redo 2011-09-10 12:55:37 +05:30
Arun Agrawal
abbd27fad8 No need to use </form> here. It's already in whole_form block 2011-09-10 12:22:29 +05:30
Santiago Pastorino
4d3a73e5dd Merge pull request #2957 from waseem/migration_status_tests
Tests for rake db:migrate:status.
2011-09-09 21:58:37 -07:00
Santiago Pastorino
be24be62b6 Merge pull request #2876 from alex3/patch-1
Fixed assets precompile regex
2011-09-09 21:56:28 -07:00
Santiago Pastorino
f43ffdcb96 Merge pull request #2966 from arunagw/no_use_warnings_removed
Not used variables removed. Warnings removed.
2011-09-09 21:50:10 -07:00
Arun Agrawal
fb73be8469 Not used variables removed. Warnings removed. 2011-09-10 09:38:57 +05:30
Aaron Patterson
0f04260c51 railties depends on actionpack, so put actionpack in the include path 2011-09-09 19:00:33 -07:00
Aaron Patterson
9736cb2bab rake already ships with a ruby command 2011-09-09 18:56:11 -07:00
Aaron Patterson
7bc6a0098b move route inspecting to an object so that we can more easily test it 2011-09-09 18:50:32 -07:00
John Mileham
f776661fd2 Failing test: ActiveResource shouldn't rely on the presence of Content-Length 2011-09-09 19:05:26 -04:00
Mike Gehard
6c43532cb6 Silence Ruby warnings about uninitialized instance variable. 2011-09-09 15:48:43 -06:00
Aaron Patterson
06e400eef2 Merge pull request #2960 from guilleiguaran/fix-isolated-ar-tests
Add missing require in base_test.rb, fixes isolated test
2011-09-09 10:49:05 -07:00
Guillermo Iguaran
b7f1735fea Add missing require in base_test.rb, fixes isolated test 2011-09-09 12:46:06 -05:00
Waseem Ahmad
bc7eddea20 Tests for rake db:migrate:status. 2011-09-09 15:39:53 +05:30
José Valim
b325a77410 Merge pull request #2956 from lawrencepit/full_messages
Ability to get single full error message
2011-09-09 01:49:17 -07:00
Lawrence Pit
8817796167 Added test for obj.errors.as_json 2011-09-09 18:34:13 +10:00
Lawrence Pit
f5a944f662 Add ability to get an individual full error message + test for full_messages. 2011-09-09 18:28:25 +10:00
Jeff Dutil
37f1cf0a8b Travis-ci build image should link to the rails travis ci build page rather than to the image. 2011-09-08 22:53:38 -04:00
Aaron Patterson
ac1a363c6e Pull up a method we only use once. 2011-09-08 16:04:57 -07:00
Aaron Patterson
41a085ebc9 Conditions must never be equal 2011-09-08 16:04:57 -07:00
Jon Leighton
cbf1dc7842 Merge pull request #2757 from andmej/first_or_create_pull_request
Add first_or_create family of methods to Active Record
2011-09-08 15:07:23 -07:00
Jon Leighton
04baa4b2ca Remove failing test which was wrongly introduced.
This test was introduced in pull request #2577. The author of the pull
request included the test, which was originally in #2230, at the same
time as fixing a separate (but related) bug. However, the author did not
include a fix for this test, so when #2577 was merged, a failing test
was introduced.

So I am removing the failing test for now. If anyone wants to fix the
bug, please do so and submit a complete pull request with a test and
a fix.
2011-09-08 22:28:43 +01:00
Alex Yakoubian
901c02d86a Fixed assets precompile regex, now accepts Procs 2011-09-08 13:44:08 -07:00
Vijay Dev
e05d4cea69 revert the changes from c60995f3 - related to marking sub,gsub as unavailable to use with safe strings 2011-09-09 01:05:07 +05:30
Xavier Noria
9987f1e34d delete the CHANGELOG entry re SafeBuffer and sub/gsub, since it has been reverted 2011-09-08 21:28:17 +02:00
José Valim
6b010c2690 Revert removing gsub and sub from safe buffer. 2011-09-08 20:54:30 +02:00
Vijay Dev
59198ecb65 some copy-edits 2011-09-08 18:25:43 +05:30
Vijay Dev
0d25491581 Merge branch 'master' of github.com:lifo/docrails 2011-09-08 18:06:43 +05:30
Xavier Noria
d1d51077d5 mention the issue number for future reference 2011-09-08 05:22:02 -07:00
Xavier Noria
fb84450209 registers removal of sub and friends for safe strings in the CHANGELOG 2011-09-08 05:13:56 -07:00
Xavier Noria
827fcf453e this should have gone with the previous commit 2011-09-08 05:02:47 -07:00
Xavier Noria
f7627de206 copy-edits a couple of exception messages
"Safe Buffer" should either be the constant with the class name,
or go in lower case. I've chosen to follow the same terminology
that is used in the AS core extensiong guide, "safe string",
though "safe buffer" is also used elsewhere, we should pick one.
2011-09-08 04:56:31 -07:00
Vijay Dev
06b218dd95 Merge pull request #2931 from dmathieu/safe_gsub_doc
better method documentation on disable safe string methods
2011-09-08 02:31:45 -07:00
Damien Mathieu
c60995f31d better method documentation on disable safe string methods 2011-09-08 11:27:31 +02:00
José Valim
b4a6e2f844 Merge pull request #2248 from dmathieu/safe_gsub
make gsub and sub unavailable in SafeBuffers - Closes #1555
2011-09-08 01:26:55 -07:00
Damien Mathieu
3718ccd2a6 remove support of symbols on classify and camelize 2011-09-08 10:22:21 +02:00
Damien Mathieu
e9f48cdcf4 make gsub and sub unavailable in SafeBuffers - Closes #1555 2011-09-08 10:22:21 +02:00
dharmatech
f50aeda2f7 getting_started.textile section 6: Correct file names in table 2011-09-07 20:23:28 -05:00
Aaron Patterson
e1b500ec96 LRU cache in mysql and sqlite are now per-process caches. 2011-09-07 15:26:47 -07:00
Aaron Patterson
e6adeaa2fa fixing file name 2011-09-07 15:26:47 -07:00
Aaron Patterson
834d429e84 LRU should cache per process in postgresql. fixes #1339 2011-09-07 15:26:47 -07:00
Aaron Patterson
8e79c52160 Merge pull request #2922 from wayneeseguin/master
Include ActiveRecord SQLServer Adapter by @metaskills in new application generator.
2011-09-07 13:41:49 -07:00
Wayne E. Seguin
8b635596b7 Thanks to the hard work of Ken Collins ( @metaskills ) on the ActiveRecord SQLServer Adapter ( https://github.com/rails-sqlserver/activerecord-sqlserver-adapter ), AR SQLServer Adapter works for Linux, OSX and Windows. Thus the sqlserver adapter should include so that users may use it with the new application generator:
rails new w00t -d sqlserver ...
2011-09-07 17:27:32 -03:00
Vijay Dev
82de8ad9c1 Use Travis https build status image in order to prevent GitHub from
caching the http version.

The syntax for including an https image url in RDoc taken from
http://about.travis-ci.org/docs/user/status-images. Having this in a
line of its own now to make regex replacement for the API simpler!
2011-09-08 01:27:24 +05:30
Aaron Patterson
b9f66f4db1 fixing view queries 2011-09-07 10:44:51 -07:00
Aaron Patterson
d9a20711da use the supplied bind values 2011-09-07 10:44:51 -07:00
Aaron Patterson
f5ea24b3db Merge commit 'refs/pull/2909/head' of https://github.com/rails/rails into rawr
* https://github.com/rails/rails:
  Postgresql adapter: added current_schema check for table_exists?
  Postgresql adapter: added current_schema check for table_exists?
2011-09-07 10:44:50 -07:00
Vijay Dev
190a2bf9c4 Revert "Rails.root is a Pathname, no need to use File.join first."
This reverts commit 760fd1eb42.

Reason: We need a fully qualified path string here, not a Pathname.
2011-09-07 22:54:49 +05:30
Vijay Dev
0fb3aa750f copy edit assets guide 2011-09-07 22:53:16 +05:30
Jon Leighton
9dd5c03919 Merge pull request #2914 from yahonda/add_rownum_to_test_first_and_last
Add ROWNUM to test first and last to support Oracle.
2011-09-07 10:22:39 -07:00
Jeremy Evans
da8f00a55c Add tests for fixes to Time.=== 2011-09-07 10:09:04 -07:00
dharmatech
98b55ee2e3 getting_started.textile: Fix another typo 2011-09-07 09:09:11 -05:00
Nicolás Hock Isaza
ea83a8da31 Fixing record_key_for_dom_id documentation.
The default implementation joins everything with '_' and not with '-'
2011-09-07 08:19:39 -05:00
Joost Baaij
760fd1eb42 Rails.root is a Pathname, no need to use File.join first. 2011-09-07 16:09:56 +03:00
Santiago Pastorino
f6709523da Merge pull request #2904 from guilleiguaran/refactor-assets-tests
Refactor assets tests to use add_to_config
2011-09-07 06:02:01 -07:00
Jon Leighton
16f1ce41d5 Merge pull request #2499 from akaspick/assert_select_email_fix
Fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors.
2011-09-07 05:51:31 -07:00
Jon Leighton
fb5dbe8c75 Merge pull request #2911 from toolmantim/patch-1
Make sure require_tzinfo only calls Kernel#require if TZInfo isn't alread
2011-09-07 05:20:52 -07:00
Yasuo Honda
3937d443d6 Add ROWNUM to test first and last to support Oracle. 2011-09-07 07:40:55 -04:00
Tim Lucas
2147f35df2 Make sure require_tzinfo only calls Kernel#require if TZInfo isn't already present.
This wasn't a problem when require_tzinfo was only called from TimeZone#initialize, but now it's being called for every lookup to TimeZone.[] (via lazy_zones_map)

TimeZone lookup can occur when unmarshalling TimeWithZone objects, which is where I first saw the big slowdown (500ms for each Rails action that loaded from Rails.cache)
2011-09-07 14:21:18 +03:00
Vijay Dev
2b354fed34 Merge pull request #2905 from nhocki/patch-1
Fixing small typo in the `record_key_for_dom_id` documentation.
2011-09-07 03:07:09 -07:00
Jon Leighton
143769051b Don't include any of includes, preload, joins, eager_load in the through association scope. 2011-09-07 09:27:41 +01:00
Jon Leighton
db8d54ebf5 Merge pull request #2485 from akaspick/exists_fix
fix exists? to return false if passed nil (which may come from a missing
2011-09-07 00:38:51 -07:00
Nicolás Hock Isaza
9821d982ff Fixing record_key_for_dom_id documentation.
The default implementation joins everything with '_' and not with '-'
2011-09-06 23:26:56 -05:00
Guillermo Iguaran
1db5836754 Refactor assets tests to use add_to_config instead of creating initializers with config values 2011-09-06 23:00:36 -05:00
Aaron Patterson
4edf6ea0ea Merge pull request #2897 from rsutphin/ar31-remove_connection
Patch for issue #2820
2011-09-06 17:43:58 -07:00
Aaron Patterson
f6ced69a11 Eliminate newlines in basic auth. fixes #2882 2011-09-06 17:25:20 -07:00
Aaron Patterson
54b7e783ef Database adapters use a statement pool.
Database adapters use a statement pool for limiting the number of open
prepared statments on the database.  The limit defaults to 1000, but can
be adjusted in your database config by changing 'statement_limit'.
2011-09-06 16:47:34 -07:00
Jeff Dutil
2cf0bb4e03 Revert "Use https for travis-ci build status image to prevent Github from caching the failed build image. [ci skip]"
This reverts commit a873ea8e9f.

rdoc doesn't generate the image over https.
2011-09-06 19:14:38 -04:00
Jeff Dutil
a873ea8e9f Use https for travis-ci build status image to prevent Github from caching the failed build image. [ci skip] 2011-09-06 19:11:04 -04:00
Aaron Patterson
a4fa6eab39 adding a statement pool for mysql and sqlite3 2011-09-06 16:06:27 -07:00
Ryan Walker
198092e2c0 Added note about adding a javascript runtime to Gemfile for production environment. 2011-09-06 14:06:34 -03:00
Aaron Patterson
51652a4773 Merge pull request #2893 from dmathieu/errors_has_key
add has_key? to ActiveModel::Errors
2011-09-06 09:41:06 -07:00
Damien Mathieu
e0335e2ccb add has_key? to ActiveModel::Errors 2011-09-06 18:36:18 +02:00
Santiago Pastorino
ef14a0ec86 Merge pull request #2577 from rails-noob/master
Fix double slash at start of paths when mounting an engine at the root.
2011-09-06 09:10:39 -07:00
Santiago Pastorino
1e61f2603c Merge pull request #2889 from guilleiguaran/perform-caching-assets
config.action_controller.perform_caching isn't used anymore in asset pipeline
2011-09-06 09:03:52 -07:00
Guillermo Iguaran
6fc518e2ec config.action_controller.perform_caching isn't used anymore in assets pipeline, instead we are using config.assets.digest now 2011-09-06 10:46:52 -05:00
Jon Leighton
9bde73ff72 Nested through associations: preloads from the default scope of a through model should not be included in the association scope. (We're already excluding includes.) Fixes #2834. 2011-09-06 16:34:32 +01:00
rails-noob
43fbb1e6b8 Fix bug #2579.
Avoids double slash at start of paths when mounting an engine at the root.
2011-09-06 15:26:19 +00:00
Jon Leighton
b24d668859 Ensure we are not comparing a string with a symbol in HasManyAssociation#inverse_updates_counter_cache?. Fixes #2755, where a counter cache could be decremented twice as far as it was supposed to be. 2011-09-06 15:58:07 +01:00
Marcus Ilgner
5e2bf4de62 Fixed Apache configuration for gzipped assets: FilesMatch and LocationMatch cannot be nested. 2011-09-06 16:27:26 +02:00
Uģis Ozols
9584e15d39 Change hyphen to underscore. 2011-09-06 17:13:30 +03:00
Jon Leighton
9f3e732e65 Make the logic easier to read 2011-09-06 12:59:11 +01:00
Jon Leighton
77ff1ce541 Disable active record marshalling tests on Ruby 1.8.7 on Travis CI, as they have been failing intermittently for a long while due to what appears to be a Ruby bug. If anyone has the skills/expertise/time to debug this, please speak to the Travis guys. 2011-09-06 11:45:08 +01:00
Jon Leighton
3c846c29d3 Merge pull request #2883 from dmathieu/fix_test
#first doesn't take an order in this test
2011-09-06 02:56:15 -07:00
Jon Leighton
1fdd95d084 Merge pull request #2851 from dasch/patch-6
No need to use a begin block there
2011-09-06 02:50:27 -07:00
Damien Mathieu
e8d5920b74 #first doesn't take an order in this test 2011-09-06 10:01:33 +02:00
Andrés Mejía
72317883ed Using more precise method signatures for AR::Relation#first_or_create family of methods. 2011-09-06 02:45:54 -05:00
Andrés Mejía
d03aff7f64 Adding first example with no arguments to AR::Relation#first_or_create and removing examples that create several users at the same time (this is confusing and not really helpful). 2011-09-06 02:02:28 -05:00
Santiago Pastorino
bd17c762ae Bump uglifier up 2011-09-05 20:33:26 -03:00
Santiago Pastorino
c0f3df3a2d Merge pull request #2870 from arunagw/uglifier_bump
Uglifier bump
2011-09-05 16:09:19 -07:00
Santiago Pastorino
164382003c Merge pull request #2877 from dmathieu/fix_tests_pg_18
Last orders the records by id
2011-09-05 15:41:59 -07:00
Damien Mathieu
51da1e5c65 first and last orders the records by id 2011-09-06 00:30:40 +02:00
Aaron Patterson
6d93f70c58 Merge pull request #2716 from jbbarth/fix_invert_rename_index
Fix bad options order in AR::Migration::CommandRecorder#invert_rename_index
2011-09-05 14:17:55 -07:00
Georg Friedrich
2175012230 Don't find belongs_to target when the foreign_key is NULL. Fixes #2828 2011-09-05 13:49:29 -07:00
Santiago Pastorino
7f7e362c14 Merge pull request #2873 from guilleiguaran/remove-unused-config
Remove unused config variable from test.rb template
2011-09-05 07:09:13 -07:00
Santiago Pastorino
a23e3855c5 Merge pull request #2872 from sikachu/content_tag_html_safe
Make sure that result from content_tag_for with collection is html_safe
2011-09-05 07:08:39 -07:00
Guillermo Iguaran
e8cb06a386 Remove unused config variable from test.rb template 2011-09-05 08:59:37 -05:00
Santiago Pastorino
f4a690dae7 Merge pull request #2815 from avakhov/current-page-non-get-requests
current_page? returns false for non-GET requests
2011-09-05 06:13:14 -07:00
Santiago Pastorino
c255e0eed5 Merge pull request #2799 from tomstuart/3-1-stable
Never return stored content from content_for when a block is given
2011-09-05 10:11:43 -03:00
Prem Sichanugrist
ffe56f3b8c Make sure that result from content_tag_for with collection is html_safe
Thank you @spastorino for catching the empty test in b84cee0, as I totally forgot that I still have to make it html_safe.
2011-09-05 20:04:37 +07:00
Jon Leighton
e221108c14 Merge pull request #2789 from dmathieu/limit_first_last
Use LIMIT SQL word in first - Closes #2783
2011-09-05 05:41:46 -07:00
Damien Mathieu
5f5527c726 Use LIMIT sql word in last when it's possible 2011-09-05 14:37:37 +02:00
Damien Mathieu
451cdd62ce use LIMIT SQL word in first - Closes #2783 2011-09-05 13:09:52 +02:00
Arun Agrawal
5e35d62cf5 Uglifier bump 2011-09-05 15:07:45 +05:30
dharmatech
a76c23e6be getting_started.textile: fix minor typo 2011-09-05 04:07:48 -05:00
Vijay Dev
24ee573d6c add blanks between methods 2011-09-05 13:41:25 +05:30
Jon Leighton
499ad11700 Merge pull request #2868 from arunagw/batches_test_pg_master
Sort here to make sure the order is ok.
2011-09-05 00:23:10 -07:00
Arun Agrawal
76e94016a4 Sort here to make sure the order is ok. 2011-09-05 12:49:34 +05:30
José Valim
7e16394b92 Merge pull request #2713 from FLOChip/500-fixed
remove misleading line on 500 error page. #2648
2011-09-05 00:16:41 -07:00
Santiago Pastorino
4f8777333d Remove empty test 2011-09-05 00:43:51 -03:00
Santiago Pastorino
8bffd6c6ae Merge pull request #2863 from raybaxter/silence_unitialized_instance_variable_warnings
Silence unitialized instance variable warnings
2011-09-04 20:37:02 -07:00
Ray Baxter
fa0ebf4c98 Tests shouldn't produce warnings 2011-09-04 20:27:53 -07:00
Guillermo Iguaran
8df4fb1bb4 Add reference about "bundle install --without assets" in Precompiling Assets section. 2011-09-04 21:17:23 -05:00
Santiago Pastorino
1e13fac0cc Merge pull request #2861 from guilleiguaran/assets-fix-changelog
Add entry about Asset behaviour fix to ActionPack ChangeLog
2011-09-04 19:01:46 -07:00
Guillermo Iguaran
a1dbd94b60 Add CoffeeScript example to JavaScript and ERB section 2011-09-04 21:01:04 -05:00
Guillermo Iguaran
3e62235c6c Add JavaScript and ERB section to Asset Guide 2011-09-04 20:56:47 -05:00
Guillermo Iguaran
81d715742a Add entry about Asset behaviour fix to ActionPack ChangeLog 2011-09-04 20:35:40 -05:00
Hendy Tanata
0a2ea92efa Fix grammar for content_tag_for and div_for docs. 2011-09-05 08:08:38 +08:00
Santiago Pastorino
6521cf3316 Merge pull request #2860 from guilleiguaran/fix-assets-behavior
Fix AssetNotPrecompiledError behavior
2011-09-04 15:41:13 -07:00
Guillermo Iguaran
9bc0082f29 AssetNotPrecompiledError should be raise when config.assets.digest = false, config.assets.compile = false and manifest file isn't present 2011-09-04 17:24:01 -05:00
Santiago Pastorino
a1fa756e17 * is not allowed in windows file names. Closes #2574 #2847 2011-09-04 17:44:48 -03:00
Jon Leighton
6c46506067 Merge pull request #2855 from arunagw/fix_find_in_batches_master
We need to recorder here. Need to drop the order from default scope.
2011-09-04 13:39:28 -07:00
Ray Baxter
14157b779b clarify where the branch name will exist 2011-09-04 13:34:07 -07:00
Arun Agrawal
9066e34025 We need to recorder here. Need to drop the order from default scope.
Fixes #2832
2011-09-05 00:12:57 +05:30
Jon Leighton
e865d12543 Merge pull request #2852 from milandobrota/remove_unneeded_explicit_nil_checks
if ... nil? is more expensive than unless
2011-09-04 09:05:45 -07:00
Daniel Schierbeck
a76fbee9c9 No need to use a begin block there 2011-09-04 18:48:50 +03:00
Milan Dobrota
9b08afd2f4 if ... nil? is more expensive than unless 2011-09-04 10:44:08 -05:00
Vijay Dev
abb0905404 Merge docrails, resolving conflicts in the assets guide 2011-09-04 18:58:34 +05:30
Vijay Dev
a6bafb327d minor fixes in assets guide 2011-09-04 18:49:16 +05:30
Jon Leighton
74372f7e79 Merge pull request #2848 from arunagw/jruby_activesupport_fix
Need to have a check here for JAVA PLATFORM for JRuby
2011-09-04 03:11:45 -07:00
Arun Agrawal
fc5e3ff1ba We can't simply check the first line of the backtrace,
because JRuby reports the call to __send__ in the backtrace.
2011-09-04 15:33:58 +05:30
Jon Leighton
ef7e60f008 Revert "Fixes bug in ActiveRecord::QueryMethods, #1697"
This reverts commit 0df27c98d9.

Reverted due to failing test, see #2845.
2011-09-04 09:56:55 +01:00
José Valim
98c3fd87e2 Merge pull request #2841 from wojtekmach/app-generators-group
Add gem group support to generators
2011-09-04 01:47:10 -07:00
Wojciech Mach
47bc5d0cc8 Add gem_group support to generators 2011-09-04 10:32:48 +02:00
José Valim
036a25019d Merge pull request #2816 from sikachu/content_tag_for
Make `content_tag_for` and `div_for` accepts the array of records
2011-09-04 00:28:15 -07:00
Prem Sichanugrist
b84cee08c6 Make content_tag_for and div_for accepts the array of records
So instead of having to do this:

   @items.each do |item|
     content_tag_for(:li, item) do
        Title: <%= item.title %>
     end
   end

You can now do this:

   content_tag_for(:li, @items) do |item|
     Title: <%= item.title %>
   end
2011-09-04 11:55:12 +07:00
Guillermo Iguaran
479c853b3f Merge pull request #64 from rinaldifonseca/master
Added |t| to create_table block
2011-09-03 21:03:28 -07:00
Rinaldi Fonseca
d72ecd92a2 Added |t| to create_table block 2011-09-04 00:34:56 -03:00
Santiago Pastorino
0eefd8dc48 Remove useless parens 2011-09-04 00:24:31 -03:00
Santiago Pastorino
60b8bfa653 Merge pull request #2844 from arunagw/warnings_removed_master
Warnings removed from master
2011-09-03 20:17:07 -07:00
Arun Agrawal
a6c60222c5 Modified content in guides and comments
for "assert /" warnings.
Removed because if somebody will use this code
they will get warnings!
2011-09-04 08:24:02 +05:30
Arun Agrawal
c8d0dc376a Warnings removed for "assert_match /" Please do
not add more.!
2011-09-04 08:23:13 +05:30
Arun Agrawal
34618e6697 Warnings removed for using shadow variable. 2011-09-04 08:17:53 +05:30
Xavier Noria
0a38e2a5ce restores the API docs of AR::Fixtures, made a quick pass over them, revises link in fixture template [closes #2840] 2011-09-03 15:20:30 -07:00
Vijay Dev
5014b33028 add some missing dots in the docs 2011-09-04 03:44:47 +05:30
Santiago Pastorino
510a9707d8 Merge pull request #2835 from guilleiguaran/actionpack-changelog
Include ticket numbers in AP CHANGELOG
2011-09-03 19:13:47 -03:00
Vijay Dev
9da07d1b01 Merge pull request #2836 from avakhov/action-controller-helpers-desc
fix helpers behavior description
2011-09-03 13:17:16 -07:00
Alexey Vakhov
19ec3c1ae6 fix helpers behavior description 2011-09-03 23:13:40 +04:00
Aaron Patterson
8a9f4c6da4 Merge pull request #2825 from guilleiguaran/bcrypt-ruby-comments
Add comments about bcrypt-ruby gem to SecurePassword and add it to default Gemfile
2011-09-03 10:14:11 -07:00
Aaron Patterson
867c830603 Merge pull request #2824 from arunagw/bcrypt_fix
Need to add here to pass the test
2011-09-03 10:12:39 -07:00
Arun Agrawal
bf4117a8b1 Need to add here to pass the test
As in previous commit it's removed.
2011-09-03 14:33:27 +05:30
José Valim
d50c0acc95 Merge pull request #2827 from sikachu/extractable_ordered_hash
Make `ActiveSupport::OrderedHash` extractable when using `Array#extract_options!
2011-09-03 01:25:44 -07:00
Prem Sichanugrist
9984266c04 Make ActiveSupport::OrderedHash extractable when using Array#extract_options!
`ActiveSupport::OrderedHash` is actually a subclass of the hash, so it does make sense that it should be extractable from the array list.
2011-09-03 14:43:33 +07:00
Guillermo Iguaran
9b02f3f41f Add comments about bcrypt-ruby gem to SecurePassword 2011-09-03 00:44:33 -05:00
Guillermo Iguaran
af54fc5586 Add bcrypt-ruby to Gemfile template 2011-09-03 00:44:23 -05:00
Xavier Noria
5912ed9902 fixes CSS example in the asset pipeline guide 2011-09-03 01:36:57 +02:00
Guillermo Iguaran
1b8290db52 Fix asset_path example in CSS and ERB section 2011-09-02 17:10:11 -05:00
Vijay Dev
5b7bcb4959 document send_file guesses content type from the file extension
and remove info about x_send_file option to send_file
2011-09-03 02:46:09 +05:30
Richard Hulse
a3edf3d2a3 fix YUI description
YUI CSS compressor does not extend syntax! Also
added link to more info
2011-09-03 09:11:20 +12:00
David Peckham
b3a03253a7 Fixed a typo in the section about migration. 2011-09-02 13:38:20 -07:00
Vijay Dev
f83f169b85 some of the changes for validation earlier reverted from d20281a 2011-09-03 01:40:00 +05:30
Franco Catena
78497c7c27 Change photos_path to photos_url in Using redirect_to
Is more "correct" a complete url than only the path
2011-09-02 14:52:58 -03:00
Vijay Dev
eeda8403fd Merge branch 'master' of github.com:lifo/docrails 2011-09-02 23:00:59 +05:30
Vijay Dev
44284a613b Revert "Fixing guides validation errors."
This reverts commit d20281add1.

Reason: This needs more investigation. Will apply when this is verified.
2011-09-02 22:58:40 +05:30
Vijay Dev
220c77dd68 debug option to js, stylesheet tags are ignored when debug mode is off 2011-09-02 22:42:23 +05:30
Guillermo Iguaran
6779064437 Remove hard dependency on bcrypt. 2011-09-02 10:01:47 -07:00
Andrew Olson
57847fbfaf Merge branch 'fix_validation_errors' 2011-09-02 12:02:14 -04:00
Andrew Olson
d20281add1 Fixing guides validation errors. 2011-09-02 11:48:45 -04:00
Matt Burke
3a7c16dbb9 When a collection is empty, render returns nil. 2011-09-02 10:20:23 -04:00
Alexey Vakhov
fddf7ea1c1 current_page? returns false for non-GET requests 2011-09-02 18:20:10 +04:00
Josh Nesbitt
36b640e4b5 Merge branch 'activemodel_typo_fix' 2011-09-02 13:29:20 +01:00
Josh Nesbitt
d0f9f4e664 Fix typo in ActiveModel::Dirty comment. define_attribute_methods is a class method, not attribute. 2011-09-02 13:28:38 +01:00
José Valim
36f1612c34 Merge pull request #2811 from avakhov/fix-environment-generator-action
fix indent for generator environment method
2011-09-02 03:05:49 -07:00
Alexey Vakhov
e61d6afbab fix indent for generator environment method 2011-09-02 13:31:00 +04:00
Stephen J. Butler
16aa4330d7 Change the styling of '<ruby>initialize</ruby>' to '+initialize+' (the former breaks the HTML generation). 2011-09-01 19:55:38 -05:00
Aaron Patterson
6f3c6992c5 * Psych errors with poor yaml formatting are proxied. Fixes #2645, #2731 2011-09-01 15:08:19 -07:00
Aaron Patterson
8b9ddbd8f9 make sure encoding_aware? is available 2011-09-01 14:07:07 -07:00
Richard Hulse
ca7c37a660 fix some minor omissions in pipeline docs 2011-09-02 08:39:16 +12:00
Aaron Patterson
fdd619e9a7 CookieJar is enumerable. fixes #2795 2011-09-01 13:37:14 -07:00
Sebastian Martinez
2d92962701 Add #update_attributes as another alternative to #update_column. 2011-09-01 16:02:08 -03:00
Vijay Dev
5fbbf4417c Merge pull request #63 from carlosparamio/master
Fix name of parent resource params when declaring nested resources at routes
2011-09-01 11:51:31 -07:00
Jeremy Evans
1ebf84ac2e Edited activesupport/lib/active_support/core_ext/time/calculations.rb via GitHub 2011-09-01 11:49:49 -07:00
Carlos Paramio
3f64fa9289 Fix name of parent resource params when declaring nested resources at routes 2011-09-01 20:34:15 +02:00
Aaron Patterson
90248d2953 Merge pull request #2775 from jaw6/fix/reverse
Fixes bug in ActiveRecord::QueryMethods, #1697
2011-09-01 11:29:20 -07:00
Vijay Dev
c96cb8897b Revert "Fix logic in 3.1 release notes sentence"
This reverts commit 30d65da17e.

Reason: This commit is incorrect. It is indeed recommended to use
update_attribute when you want callbacks to be invoked.
2011-09-01 23:52:23 +05:30
Vijay Dev
7a7a3bcf02 Merge pull request #2718 from dasch/patch-5
Split long string into multiple shorter ones
2011-09-01 10:45:34 -07:00
Andy Leeper
8e900f1e38 Modified ActionMailer Basics doc with the following change:
* Changed the lines that said <tt>config/environments/env.rb</tt> to <tt>config/environments/$RAILS_ENV.rb</tt>.  People were mis-interpreting the filename to literally be env.rb.
2011-09-01 10:42:28 -07:00
José Valim
47f465df5d Merge pull request #2585 from marcgg/fix-ruby19-splitoptions
In some case ActiveResource fails to handle serialized attributes with Ruby 1.9 and crashes
2011-09-01 10:08:37 -07:00
Marc G Gauthier
28d605ff7f Do not use objects that don't respond to to_sym (integers, floats, dates...) as parameters 2011-09-01 18:26:29 +02:00
Vijay Dev
bc83e48ddf Merge pull request #62 from roytomeij/master
Call Sass by it's proper name while talking about the language, instead of using "SCSS" (which is a syntax within Sass).
2011-09-01 09:02:35 -07:00
Roy Tomeij
3461a5d436 Change "SCSS" to "Sass" in sentences where it's referred to as "language", because Sass is the language (SCSS is one possible syntax within the Sass language), as per documentation on sass-lang.com. 2011-09-01 17:24:26 +02:00
Vijay Dev
752d74f952 docs formatting changes 2011-09-01 20:30:45 +05:30
Richard Hulse
cfd785f910 Move css data URI into css/erb section 2011-09-01 21:20:26 +12:00
Richard Hulse
1f998c7578 pipeline docs improvement
Some cleaning up of whitespace/punctuation
and text refinements to clarify some things.
2011-09-01 21:15:06 +12:00
José Valim
da516e8f54 Merge pull request #2788 from spohlenz/precompile-without-digests-master
assets:precompile should not append asset digests when config.assets.digest is false
2011-09-01 01:59:58 -07:00
Sam Pohlenz
58b0c97347 assets:precompile should not append asset digests when config.assets.digest is false 2011-09-01 18:01:45 +09:30
José Valim
b93c3606cb Merge pull request #2787 from guilleiguaran/changelogs-3-1-1-master
Add missing changelog entries for 3.1.1
2011-09-01 01:20:18 -07:00
José Valim
9af2b5eeaa Merge pull request #2786 from spohlenz/extract-asset-paths-config-master
Remove explicit references to Rails.application.config from AssetPaths in Sprockets helper
2011-09-01 01:15:34 -07:00
Guillermo Iguaran
5bb1c7acdc Add missing changelog entries for 3.1.1 2011-09-01 03:12:13 -05:00
Sam Pohlenz
d5165e5ab0 Move references to Rails.application.config out of Sprockets AssetPaths 2011-09-01 17:41:42 +09:30
Richard Hulse
5421d4d016 pipeline docs - spelling and some whitespace 2011-09-01 18:25:24 +12:00
Guillermo Iguaran
72fea6d2eb Adding reference about ExecJS for CoffeeScript 2011-09-01 01:18:20 -05:00
Guillermo Iguaran
fdf2f519bd Add reference to ExecJS in JavaScript Compression section 2011-09-01 01:15:19 -05:00
Guillermo Iguaran
418e321b50 Fixing sass-rails helpers methods examples 2011-09-01 01:01:31 -05:00
Guillermo Iguaran
4ba35dd26b Giving info about what are the defaults for test environment 2011-09-01 00:35:01 -05:00
Santiago Pastorino
3ce3b5b1f1 Merge pull request #2780 from guilleiguaran/assets-pipeline-minor-changes
Assets pipeline: fix in manifest location and remove unused code
2011-08-31 22:51:37 -03:00
Richard Hulse
ed1dfaf48d update pipeline docs to reflect new defaults
Production section has been changed to reflect the
new default of precompilation and using the asset
manifest.

Development has been swapped around to reflect the
new default (debug mode is on).

Other changes to support this elsewhere.
2011-09-01 13:28:33 +12:00
Guillermo Iguaran
fe07669e27 Review config.assets options. 2011-08-31 20:05:59 -05:00
Xavier Noria
91fc86562a Merge pull request #61 from gabebw/master
Improve examples by using .each instead of for...in
2011-08-31 17:58:46 -07:00
Gabe Berke-Williams
de6660b5ec Improve examples: use each instead of for...in 2011-08-31 20:52:35 -04:00
Aaron Patterson
c5a91d0288 should be using a / in this route rather than a # 2011-08-31 16:12:26 -07:00
Xavier Noria
e851e9e407 Merge branch 'master' of git://github.com/lifo/docrails 2011-08-31 16:10:09 -07:00
Kir
6ce6ba8638 Instructions for nginx and apache added 2011-08-31 16:09:41 -07:00
Richard Hulse
f0af563952 Added new asset config options to guides 2011-09-01 11:06:05 +12:00
Greg Leppert
5767c13c68 Update wording surrounding template file extensions to include Rails 3 and above. 2011-08-31 19:39:41 -03:00
Ray Baxter
2422fbf628 make code example agree with text just above 2011-08-31 15:19:06 -07:00
Xavier Noria
27bcd96246 Merge branch 'master' of git://github.com/lifo/docrails 2011-08-31 14:30:25 -07:00
Richard Hulse
054bdc1f59 Add section to pipeline docs to help people upgrading
These are the options from a brand new app, and
should help people get it right when upgrading.
2011-09-01 09:11:00 +12:00
Joshua Wehner
0df27c98d9 Fixes bug in ActiveRecord::QueryMethods, #1697
Replace split on comma with a regexp that will reverse all ASC/DESC specifically
2011-08-31 16:17:28 -04:00
José Valim
e3efe78a5f Merge pull request #2772 from guilleiguaran/backports-assets-pipeline
Backports of the assets pipeline changes done in 3-1-stable
2011-08-31 11:25:47 -07:00
Andrew Olson
120b534d8e Fixing spelling, throught -> through. 2011-08-31 14:18:01 -04:00
Guillermo Iguaran
87074600d3 Fix asset debugging tests to reflect last changes in 3-1-stable 2011-08-31 13:12:25 -05:00
Guillermo Iguaran
d0b3937b8f Set default location of manifest with config.assets.manifest 2011-08-31 13:12:25 -05:00
Guillermo Iguaran
f236e00189 Backport f443f9cb0c to master 2011-08-31 13:12:09 -05:00
Guillermo Iguaran
fa04c37f45 Backport b0f3063166 to master 2011-08-31 12:42:54 -05:00
Guillermo Iguaran
dffdd82993 Read digests of assets from manifest.yml if config.assets.manifest is on 2011-08-31 12:41:28 -05:00
Chris Griego
508f33f35c Revert "Ruby 1.8.7+ provides to_date/to_datetime, AS just makes them public." to support date implementations without private to_date/to_datetime on Time (home_run).
This reverts commit 080345baca.

Signed-off-by: José Valim <jose.valim@gmail.com>
2011-08-31 19:21:55 +02:00
Guillermo Iguaran
73d34feb4c Always enable digest and compile in the Rake task 2011-08-31 19:18:16 +02:00
Vijay Dev
d0fafaf20f Merge pull request #2706 from mitio/doc-changes
Fixed some typos and made minor text changes in the Plugins guide.
2011-08-31 07:39:48 -07:00
Rodrigo Rosenfeld Rosas
30d65da17e Fix logic in 3.1 release notes sentence 2011-08-31 10:50:08 -03:00
Xavier Noria
47b8415bef Merge branch 'master' of git://github.com/rails/rails 2011-08-31 04:27:59 -07:00
Semyon Perepelitsa
6d772c0953 Fix typo: => instead of = 2011-08-31 14:40:45 +04:00
Xavier Noria
e746c4047c syncs assets guide with what's in 3-1-stable 2011-08-31 02:04:36 -07:00
Xavier Noria
19e853275b Merge pull request #2761 from raybaxter/bump_api_url
don't need edgeapi now that we are on 3.1
2011-08-31 01:59:00 -07:00
Xavier Noria
d7be97ec31 release notes: adds a couple of blank lines to get the markup right 2011-08-31 01:52:43 -07:00
Xavier Noria
73263f6c81 adds the release notes of 3.1 to the index 2011-08-31 01:44:59 -07:00
Ray Baxter
331dad14bc don't need edgeapi now that we are on 3.1 2011-08-30 22:32:09 -07:00
Santiago Pastorino
f4492b8656 Bump sprockets up 2011-08-30 22:49:03 -03:00
Santiago Pastorino
e5f2b0d75f Revert "Merge pull request #2647 from dmathieu/no_rescue"
This reverts commit 125b1b0b91.
2011-08-30 20:52:08 -03:00
Nicolas Hock Isaza
ee822f257e Adding first_or_new documentation to the AR Querying guide. 2011-08-30 16:37:13 -05:00
Raimonds Simanovskis
60d8e4ac28 Ensure correct ordering of results in test_update_all_with_joins_and_offset_and_order
Last two asserts in this test assume that all_comments are ordered by posts.id and then by comments.id therefore additional ordering is added. Without it test was failing on Oracle which returned results in different order.
2011-08-30 22:33:49 +01:00
Andrés Mejía
84dad446c6 Adding first_or_create, first_or_create!, first_or_new and first_or_build to Active Record.
This let's you write things like:

    User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true)

Related to #2420.
2011-08-30 16:33:37 -05:00
Xavier Noria
2350fecd22 adds the asset pipeline guide to the index 2011-08-30 13:48:16 -07:00
Xavier Noria
a7a01b8b8e Merge pull request #2684 from waynn/patch-2
Rephrasing to sound more natural, and some grammar fixes.
2011-08-30 13:32:59 -07:00
Jon Leighton
bd4bd3f50a Merge pull request #2750 from rsim/fix_test_column_names_are_escaped_for_oracle
Fix test column names are escaped for oracle
2011-08-30 11:04:01 -07:00
Aaron Patterson
9af7828d5a Merge pull request #2636 from dasch/document-sprockets-compressors
Document the Sprockets compressors
2011-08-30 10:15:54 -07:00
Daniel Schierbeck
725617a647 Document the Sprockets compressors
Add documentation to Sprockets::NullCompressor and
Sprockets::LazyCompressor. Also, make LazyCompressor#compressor
private, as it isn't part of the public API.
2011-08-30 11:06:53 +02:00
Xavier Noria
5aa86f793f let SDoc add a link to the source code in GitHub for each method 2011-08-29 15:47:56 -07:00
Jon Leighton
92619e4f78 Fix test failures on 1.8.7, since Object#initialize_dup is not defined there (and this call to super is no essential, so easiest to simply remove) 2011-08-29 23:05:26 +01:00
Xavier Noria
04f7338ff4 Merge pull request #2720 from biow0lf/master
Doc fixes
2011-08-29 14:35:08 -07:00
Aaron Patterson
cebff6d0f7 Merge pull request #2021 from dasch/more_postgres_utils
Make #extract_schema_and_table an instance method in Utils
2011-08-29 13:38:10 -07:00
Jon Leighton
c59c9bb8bc Move clear_timestamp_attributes into Timestamp module 2011-08-29 17:39:09 +01:00
Jon Leighton
735d985b01 The join_nodes must be passed to the JoinDependency initializer and therefore counted by the alias tracker. This is because the association_joins are aliased on initialization and then the tables are cached, so it is no use to alias the join_nodes later. Fixes #2556. 2011-08-29 15:05:47 +01:00
Jon Leighton
fd22d040fe Move the bulk alter table code into the abstract mysql adapter, hence it is supported for mysql2 as well now. 2011-08-29 12:43:39 +01:00
Jon Leighton
4fcd847c8d Extract simplified_type into the abstract class 2011-08-29 12:43:39 +01:00
Jon Leighton
5766539342 Create an AbstractMysqlAdapter to abstract the common code between MysqlAdapter and Mysql2Adapter. 2011-08-29 12:43:39 +01:00
Daniel Schierbeck
a720243961 Split long string into multiple shorter ones
This makes the code more readable.
2011-08-29 04:15:15 +03:00
Santiago Pastorino
cfe7548aef Merge pull request #2724 from guilleiguaran/avoid-recursive-call-sprockets-helper
Avoid extra recursive call in Sprockets helpers
2011-08-28 17:05:49 -07:00
Guillermo Iguaran
381904d26b Avoid extra recursive call in Sprockets helpers 2011-08-28 19:00:58 -05:00
Santiago Pastorino
734792aaaa Merge pull request #2723 from guilleiguaran/3-1-0-changelogs
Update changelogs for Rails 3.1.0
2011-08-28 20:42:12 -03:00
Igor Zubkov
871696a01a Documentation fixes 2011-08-29 02:37:56 +03:00
Aaron Patterson
d63688d9e6 fixing typo 2011-08-28 16:31:13 -07:00
Santiago Pastorino
49af31eada Bump rack-cache, rack-test, rack-mount and sprockets up 2011-08-28 19:06:29 -03:00
Aaron Patterson
b4ff82a791 clear and disable query cache when an exception is raised from called middleware 2011-08-28 14:16:00 -07:00
Aaron Patterson
e145acd6f1 Merge pull request #2711 from dasch/patch-3
Refactor ActionDispatch::Http::UploadedFile
2011-08-28 09:52:54 -07:00
Daniel Schierbeck
62a61add7e Refactor ActionDispatch::Http::UploadedFile 2011-08-28 16:16:22 +02:00
jbbarth
24674b3448 Fixed bad options order in ActiveRecord::Migration::CommandRecorder#invert_rename_index 2011-08-28 06:02:15 +02:00
Xavier Noria
bb4dedbc2c deletes spurious arrow 2011-08-27 15:34:33 -07:00
Santiago Pastorino
bd0550ef5a Merge pull request #2714 from vijaydev/docs
doc fixes
2011-08-27 14:03:55 -07:00
Vijay Dev
8526f727cf doc fixes 2011-08-28 02:27:39 +05:30
Dimitar Dimitrov
b5f68cc6fe Fixed typos and made minor changes in the Plugins guide. 2011-08-27 23:36:01 +03:00
Teng Siong Ong
5acbc19f30 remove misleading line on 500 error page. 2011-08-27 14:31:24 -05:00
Jared Tame
1606b6c7e4 fixed 500 error message which is misleading by suggesting all rails apps have exception notifications by default 2011-08-27 14:29:30 -05:00
Xavier Noria
827a0fee07 use sdoc to generate the API 2011-08-27 03:55:01 -07:00
Waynn Lue
6bdf4a3829 incorporate feedback from vijaydev and dasch to rephrase this to sound more natural, and some grammar fixes. 2011-08-26 10:58:06 -07:00
Aaron Patterson
e8b525f169 stop messing with the load path, load path should be adjusted in the test task 2011-08-26 10:15:17 -07:00
Santiago Pastorino
4a4dcb5059 Merge pull request #2702 from arunagw/removed_unused_var
Removed Unused Variable.
2011-08-26 05:41:59 -07:00
Arun Agrawal
651ef614f1 Removed Unused Variable. 2011-08-26 11:29:05 +05:30
Aaron Patterson
e3a020a679 Merge pull request #2699 from guilleiguaran/fix-asset-debugging-test-1.8
Fix failing asset debug test under 1.8
2011-08-25 19:12:24 -07:00
Guillermo Iguaran
a071c9b667 Fix failing asset debug test under 1.8 2011-08-25 21:05:23 -05:00
Aaron Patterson
42a7979cf1 Force binary data inserted for a string data type to utf-8 and log an
error.  Strings tagged as binary will be stored in sqlite3 as blobs.  It
is an error to insert binary data to a string column, so an error is
emitted in the log file.  People are highly encouraged to track down the
source of the binary strings and make sure that the encoding is set
correctly before inserting to the database.
2011-08-25 16:07:54 -07:00
Xavier Noria
635b9d4ca8 Merge pull request #2681 from guilleiguaran/doc-changes
Documentation changes: Assets Pipeline guide and Railties changelog
2011-08-25 15:07:11 -07:00
Jon Leighton
8ba491acc3 Revert all the stuff to do with disallowing non-public methods for Module#delegate 2011-08-25 22:30:42 +01:00
Santiago Pastorino
bad6803570 Merge pull request #2696 from guilleiguaran/string-keys-sprockets-helpers
Removing redundant stringify_keys in Sprockets helpers
2011-08-25 14:18:16 -07:00
Guillermo Iguaran
f5472a3898 Removing redundant stringify_keys in Sprockets helpers 2011-08-25 16:09:53 -05:00
Aaron Patterson
25ee30961a Merge pull request #2695 from dasch/more-debug-assets
Don't require a specific value for the ?debug flag
2011-08-25 11:47:23 -07:00
Daniel Schierbeck
8724f00cbd Don't require a specific value for the ?debug flag
Previously, only "1" and "true" were accepted. This change makes
any value, or no value at all, have the same effect.
2011-08-25 20:39:18 +02:00
Arun Agrawal
a840172c53 Yes we need this to pass the test. we are using config.log_level.
Fix broken test test_copying_migrations(RailtiesTest::EngineTest):
NoMethodError: undefined method `log_level' for #<Rails::Engine::Configuration:0xb87a98c>
2011-08-25 11:25:37 -07:00
Aaron Patterson
df948f3100 Merge pull request #2690 from dasch/pretty-debug-assets
Make Sprockets::Helpers::RailsHelper#debug_assets? more readable
2011-08-25 11:05:57 -07:00
Aaron Patterson
35f3907f34 Merge pull request #2688 from dasch/refactor-asset-debugging-tests
Refactor asset debugging tests
2011-08-25 11:04:34 -07:00
Santiago Pastorino
a16e888003 Merge pull request #2694 from bogdan/internal_validation
Moved strict validation changelog entry to right place
2011-08-25 10:14:25 -07:00
Bogdan Gusiev
f2f05da06e Moved strict validation changelog entry to right place 2011-08-25 19:37:11 +03:00
Guillermo Iguaran
3731a0f97b Update Debugging Assets section of Assets Pipeline guide 2011-08-25 09:49:18 -05:00
Guillermo Iguaran
9a68ea9643 Add missing CHANGELOG entries for Railties 2011-08-25 09:47:37 -05:00
Santiago Pastorino
eb6906890e Tiny refactor 2011-08-25 11:40:59 -03:00
Santiago Pastorino
67274ca162 Merge pull request #2491 from waynn/fix_symbol
fix destructive stringify_keys for label_tag
2011-08-25 07:39:31 -07:00
José Valim
d15069316f Merge pull request #2563 from bogdan/internal_validation
Implemented strict validation concept
2011-08-25 07:10:16 -07:00
Bogdan Gusiev
cbb147931b Typo fix 2011-08-25 16:43:43 +03:00
Daniel Schierbeck
b59aa358bb Make Sprockets::Helpers::RailsHelper#debug_assets? more readable 2011-08-25 12:36:11 +02:00
Daniel Schierbeck
372892eaea Move asset debugging tests into a separate test case
Also:

- Refactor AssetDebuggingTest.
- Use the %r regexp syntax. That way we don't need to escape the /'s.
2011-08-25 11:57:16 +02:00
Aaron Patterson
68424fb1cf fix ambiguous * and remove unused variable 2011-08-24 16:52:23 -07:00
Aaron Patterson
32836e7a53 fix ambiguous use of * 2011-08-24 16:48:30 -07:00
Aaron Patterson
b907271b4b stop circular require warnings 2011-08-24 16:47:01 -07:00
Aaron Patterson
bac5da3ccc only backport the to_d method if it does not exist 2011-08-24 16:33:49 -07:00
Aaron Patterson
4af431285b only define the encoding reader since we define the writer later on 2011-08-24 16:33:36 -07:00
Aaron Patterson
3096629d29 we are *sure* we want to set the encoding, so silence warnings around it 2011-08-24 16:23:38 -07:00
Aaron Patterson
5345958b3a Merge pull request #2679 from amatsuda/nullify_abstract_class_table_name
do not compute table names for abstract classes
2011-08-24 16:05:24 -07:00
Xavier Noria
0a2b105621 the command line guide is good to go 2011-08-24 14:45:42 -07:00
Jon Leighton
28a4d37843 Merge pull request #2674 from masterkain/master
Add back autoload :Table
2011-08-24 14:33:09 -07:00
Santiago Pastorino
e7634c2fdd Merge pull request #2677 from guilleiguaran/refactor-sprockets-helpers
Refactoring javascript_include_tag and stylesheet_link_tag Sprockets helpers
2011-08-24 14:11:35 -07:00
Guillermo Iguaran
23b5c55221 Preserve stylesheet_link_tag and javascript_include_tag options on debug 2011-08-24 16:01:06 -05:00
Guillermo Iguaran
e0db9cb17d Use super in javascript_include_tag and stylesheet_link_tag instead of generate tags manually 2011-08-24 15:54:47 -05:00
Guillermo Iguaran
c5a52850b3 Remove redundant join and call to html_safe 2011-08-24 15:40:10 -05:00
Aaron Patterson
09e2109686 bumping bcrypt-ruby requirement 2011-08-24 13:26:38 -07:00
Aaron Patterson
44f07098fe dealing with some -w warnings on startup 2011-08-24 13:25:11 -07:00
José Valim
2f88743c30 Merge pull request #2675 from jdelStrother/load_once_pathnames_fix
Fix autoload_once_paths when using Pathnames & ruby 1.9
2011-08-24 10:29:16 -07:00
Claudio Poli
098cc186c1 Adding missing autoload 2011-08-24 19:15:49 +02:00
Jonathan del Strother
e0714ee005 Fix autoload_once_paths when using Pathnames & ruby 1.9
Under ruby 1.9.2 -
  "/var/log".starts_with?(Pathname.new("/var"))  # => false

so setting config.autoload_once_paths with Pathnames would not work
2011-08-24 18:14:25 +01:00
Santiago Pastorino
289540e4ff Revert "Simplify JavaScriptHelper#escape_javascript"
This commit broke the build without any improvement.

This reverts commit eb0b71478a.
2011-08-24 13:22:37 -03:00
Joshua Peek
5493d22419 Bring in sprockets precompile task 2011-08-24 10:58:43 -05:00
Santiago Pastorino
976b2be108 Merge pull request #2644 from guilleiguaran/allow-assets-debugging
Add config.allow_debugging option
2011-08-24 08:01:08 -07:00
Guillermo Iguaran
827cdae6fb Add config.allow_debugging option to determine if the debug_assets query param can be passed by user 2011-08-24 09:53:55 -05:00
Santiago Pastorino
23d8a980d2 Merge pull request #2668 from guilleiguaran/debug-assets-media-type
Debug assets shouldn't ignore media type for stylesheets. Closes #2625
2011-08-24 07:46:04 -07:00
Santiago Pastorino
52207ecc81 Merge pull request #2390 from arunagw/test_for_environment_file
Test added to check development.rb, test.rb and production.rb content
2011-08-24 07:22:43 -07:00
Santiago Pastorino
f162f84aa5 Merge pull request #2647 from dmathieu/no_rescue
remove useless rescue
2011-08-24 07:02:03 -07:00
Santiago Pastorino
61e663073a Merge pull request #2669 from BMorearty/remove-extra-word
docs: Remove extra word from sentence in initialization guide.
2011-08-24 05:49:26 -07:00
Akira Matsuda
0a0da9d554 do not compute table names for abstract classes 2011-08-24 21:11:15 +09:00
Daniel Schierbeck
eb0b71478a Simplify JavaScriptHelper#escape_javascript
Use the Linus-style conditional. Also fix the documentation slightly.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-08-24 11:36:45 +01:00
Damien Mathieu
13dd7758ce remove useless rescue
params is a method, defined in every controller, which always returns a hash.
If it raises a NoMethodError, it means there's a bug somewhere else, which we want to know about.
2011-08-24 09:52:00 +02:00
Bogdan Gusiev
afe04da10b Add change log entry on strict validation 2011-08-24 10:26:18 +03:00
Bogdan Gusiev
a5e925c1d3 Add strict validation example to guides 2011-08-24 10:25:29 +03:00
Brian Morearty
11146f1485 Remove extra word from sentence in initialization guide. 2011-08-23 21:34:43 -07:00
Guillermo Iguaran
d133fd6d29 Debug assets shouldn't ignore media type for stylesheets. Closes #2625 2011-08-23 21:36:21 -05:00
Aaron Patterson
29004de1a2 load should also return the value from super 2011-08-23 17:04:05 -07:00
Aaron Patterson
a10606c490 require needs to return true or false. thank you Ryan "zenspider" Davis 2011-08-23 16:55:43 -07:00
David Heinemeier Hansson
4cc934993e Merge pull request #2607 from guilleiguaran/add-rbenv-gitignore
Add .rbenv-version to .gitignore
2011-08-23 16:33:06 -07:00
David Majda
68a13eded3 Make ActionController::TestCase#recycle! set @protocol to nil
This ensures that the protocol does not get carried over when there are
two or more requests in functional tests. This was a problem when e.g.
the first request was HTTP and the second request was HTTPS.

Closes #2654.

Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-08-23 15:34:11 +01:00
Andrew White
ebea387e4b Add failing test case for #2654 2011-08-23 15:33:59 +01:00
Andrew White
13400ac289 Ensure regexp and hash key are UTF-8 2011-08-23 14:56:04 +01:00
Xavier Noria
f7f9003cd5 Merge pull request #2616 from tilsammans/patch-2
Removed my name from the changelog as the amount of blogspam became ridic
2011-08-23 05:27:11 -07:00
Joost Baaij
707378c489 removed the link to my blog to help stop endless comments 2011-08-23 14:18:06 +02:00
Joost Baaij
c46befbce3 Revert "Removed my name from the changelog as the amount of blogspam became ridiculous. "
This reverts commit 95bece9155.
2011-08-23 14:17:29 +02:00
Xavier Noria
45f8ca54c9 Merge pull request #2653 from luckydev/ser-wrap
Missing require array/wrap in serialization
2011-08-23 04:05:34 -07:00
Xavier Noria
eb18f3d746 Merge pull request #2652 from dasch/remove-trailing-whitespace
Remove trailing whitespace
2011-08-23 04:00:59 -07:00
Anand
1be3442a0a added missing require array/wrap in serialization 2011-08-23 16:30:02 +05:30
José Valim
5536d901e5 Merge pull request #2651 from luckydev/serialization-tests
More tests for only-include and except-include options in serialization
2011-08-23 03:55:24 -07:00
Daniel Schierbeck
cacdbb9437 Remove trailing whitespace 2011-08-23 12:39:07 +02:00
Anand
56e32ad40f added more tests for only-include and except-include options in serialization 2011-08-23 16:03:58 +05:30
Andrew White
14cf4b2e35 Don't modify params in place - fixes #2624 2011-08-23 11:07:37 +01:00
Aaron Patterson
7079701e5b Merge pull request #2646 from guilleiguaran/add-destroy-alias-to-engine
Add destroy alias to engines
2011-08-22 22:54:42 -07:00
Guillermo Iguaran
d17954c7d8 Add destroy alias to engines 2011-08-22 23:39:17 -05:00
Santiago Pastorino
0b6da0c654 Merge pull request #2411 from ai/debug_assets_by_config
Debug assets by config
2011-08-22 11:50:27 -07:00
Aaron Patterson
999e7ea47d Merge pull request #2627 from luckydev/tr
travis status image added
2011-08-22 11:29:01 -07:00
Aaron Patterson
d7ec3ee9ae Merge pull request #2611 from ognevsky/add-destroy-alias
Added destroy alias to rails generator
2011-08-22 11:28:26 -07:00
Santiago Pastorino
0942879a52 Merge pull request #2524 from JonathonMA/fix_ecd37084b28a05f05251
Use mysql_creation_options inside rescue block
2011-08-22 10:36:12 -07:00
Joshua Peek
cfb5e14f5d Merge pull request #2634 from guilleiguaran/fix-sprockets-rewrite-asset-path
Fix Sprockets rewrite_asset_path
2011-08-22 10:24:16 -07:00
Anand
71232f5d5d Travis status image added to GitHub README, excluding API pages. 2011-08-22 22:28:02 +05:30
Guillermo Iguaran
e1f11ff37f Fix Sprockets rewrite_asset_path 2011-08-22 11:12:54 -05:00
Santiago Pastorino
041f1c7192 Merge pull request #2631 from dasch/refactor-sprockets
Refactor Sprockets::Helpers::RailsHelper#performing_caching?
2011-08-22 08:11:35 -07:00
Daniel Schierbeck
db181bddb6 Refactor Sprockets::Helpers::RailsHelper#performing_caching?
No need for them lines to get so long! Also, move that comment into
the method body where it belongs!
2011-08-22 16:50:33 +02:00
Andrey Ognevsky
44f0d94469 Add Destroy Alias
* Added destroy alias to rails generator

* add alias info for destroy command

* Updated command line guides
2011-08-22 17:46:10 +03:00
Aaron Patterson
aae5ebf3eb Merge pull request #2618 from FLOChip/unicode_j
fix escape_javascript for unicode character \u2028.
2011-08-21 18:42:17 -07:00
Santiago Pastorino
35c8a896fc Merge pull request #2620 from cesario/3-1-0
Fix CI and rename 1 misleading test case.
2011-08-21 19:59:09 -03:00
Andrey A.I. Sitnik
18b2223b32 Allow to debug assets by config.assets.debug 2011-08-22 09:36:36 +11:00
Joshua Peek
63d3809e31 Fix sprockets warnings
Fixes #2598
2011-08-21 16:42:06 -05:00
Joost Baaij
95bece9155 Removed my name from the changelog as the amount of blogspam became ridiculous.
When will docrails be back? :-p
2011-08-22 00:10:01 +03:00
Teng Siong Ong
f6ceb944ea fix escape_javascript for unicode character \u2028. 2011-08-21 15:14:45 -05:00
Xavier Noria
f25d65d2fb Merge pull request #2610 from asmega/documentation
added link to url_for in documentation
2011-08-21 09:17:47 -07:00
asmega
ebe9155313 Use typewriter styling on url_for in documentation 2011-08-21 16:40:56 +01:00
Santiago Pastorino
83b91c1fd4 Merge pull request #2609 from guilleiguaran/bump-sprockets-beta14
Bump sprockets to 2.0.0.beta.14
2011-08-21 07:36:02 -07:00
Xavier Noria
74b57b387f Merge pull request #2600 from al/finder_sql_example_update
Updated the docs for the has_many :finder_sql option
2011-08-21 04:36:12 -07:00
Guillermo Iguaran
f71c481545 Bump sprockets to 2.0.0.beta.14 2011-08-20 17:10:45 -05:00
Santiago Pastorino
165fb830d0 Merge pull request #2596 from dharmatech/patch-1
ActionController::Redirecting : fix docs typo
2011-08-20 14:16:15 -07:00
Santiago Pastorino
1299640ea5 Merge pull request #2595 from smartinez87/assets-guide
Document debugging assets set by default for dev and test envs on guides
2011-08-20 14:15:47 -07:00
Santiago Pastorino
71ef72c3d0 Merge pull request #2597 from dharmatech/patch-2
actionpack/lib/action_controller/base.rb: docs typo
2011-08-20 14:14:54 -07:00
Guillermo Iguaran
4fb4484cad Add .rbenv-version to .gitignore 2011-08-20 15:57:24 -05:00
Santiago Pastorino
77dfcae385 Merge pull request #2604 from vijaydev/params_wrapper_docs
Minor edit in the params wrapper api docs
2011-08-20 12:20:53 -07:00
Vijay Dev
7da70a431c params wrapper docs correction 2011-08-21 00:25:58 +05:30
Aaron Patterson
257366d118 Merge pull request #2602 from ernie/fix_predicate_builder_primary_key_assumption
Fix assumption of primary key name in PredicateBuilder subquery.
2011-08-20 11:49:17 -07:00
Alan Larkin
dbe9a9b482 Updated the docs for the has_many :finder_sql option to reflect changes made in #a7e19b30ca71f62af516, i.e. the use of Procs when interpolation of the SQL is required. 2011-08-20 19:42:07 +01:00
Santiago Pastorino
9ca44e36d3 Merge pull request #2603 from vijaydev/guides
Minor change in the 3.1 release notes
2011-08-20 11:38:45 -07:00
Vijay Dev
7444c620cf minor change in the 3.1 release notes 2011-08-20 23:27:31 +05:30
Ernie Miller
f74f5f7f00 Fix PredicateBuilder clobbering select_values in subquery. 2011-08-20 13:16:39 -04:00
Ernie Miller
e2ae015952 Fix assumption of primary key name in PredicateBuilder subquery. 2011-08-20 13:00:26 -04:00
dharmatech
dfd03fdbd3 actionpack/lib/action_controller/base.rb: docs typo 2011-08-20 00:17:44 -05:00
dharmatech
31d38d37d3 ActionController::Redirecting : fix docs typo 2011-08-20 00:07:34 -05:00
Sebastian Martinez
0b3b91cdcd Document debugging assets set by default for dev and test envs in the asset_pipeline guide. 2011-08-19 19:45:55 -03:00
Santiago Pastorino
8bd76aa50e Merge pull request #2581 from guilleiguaran/debug-assets-in-dev
Debug assets by default in development and test environments
2011-08-19 15:28:52 -07:00
Xavier Noria
72bc89fac7 Merge pull request #2589 from vijaydev/guides
Mailer guide fixes
2011-08-19 13:09:50 -07:00
Vijay Dev
129ad7226d mailer guide: fixes indentation, and use fixed width fonts wherever necessary 2011-08-20 00:17:37 +05:30
Marc G Gauthier
03b9630617 Do not try to use as a parameter elements that are not acceptable 2011-08-19 11:11:17 +02:00
Guillermo Iguaran
7223f10acd Debug assets by default in development and test environments 2011-08-18 15:35:41 -05:00
Xavier Noria
cc90adfd2a minor details revised in a gsub
Regexps have a construct to express alternation of characters, which
is character classes. In addition to being the most specific idiom to
write this pattern, it reads better without the backslashes. Also, it
is better not to use a capture if none is needed. As a side-effect of
these changes, the gsub is marginally faster, but speed is not the
point of this commit.
2011-08-18 03:09:18 -07:00
Xavier Noria
12c0ea954a Merge branch 'master' of https://github.com/lifo/docrails 2011-08-17 17:30:47 -07:00
Xavier Noria
3b5eb11664 fixes generation of the AR querying guide 2011-08-17 14:41:49 -07:00
Bogdan Gusiev
8620bf90c5 Implemented strict validation concept
In order to deliver debug information to dev team
instead of display error message to end user
Implemented strict validation concept
that suppose to define validation that always raise exception when fails
2011-08-17 17:26:00 +03:00
Xavier Noria
5912f3f97e Merge pull request #2551 from rgo/remove-blank-spaces-application-css
Cleanup application.css
2011-08-17 02:37:50 -07:00
Jeff Dutil
6783ce0de4 Updates to remove extra whitespaces and notably fix a whitespace issue with ajax_on_rails causing a code block not to render the entire block properly. 2011-08-16 23:35:40 -04:00
Jeff Dutil
6eadf5d192 Fix typo in i18n.textile header and remove extra whitespace. 2011-08-16 23:04:16 -04:00
Jeff Dutil
f302370c05 Fix ruby typo to correctly render code block in initializer.textile 2011-08-16 22:59:36 -04:00
Jeff Dutil
7ff894dcc7 Fix spacing in plugins.textile to fix html rendering and remove extra whitespace from security.textile 2011-08-16 22:48:01 -04:00
Rafa García
3ebb322f21 Cleanup application.css 2011-08-17 04:01:07 +02:00
Aaron Patterson
22e611ed5b making the order more clear, adding linux distros mailing lists to our cc 2011-08-16 17:39:58 -07:00
Aaron Patterson
9d9f59139e adding lessons learned so I do not make the same mistake twice 2011-08-16 16:30:29 -07:00
Aaron Patterson
5f94b93279 Properly escape glob characters. 2011-08-16 15:28:27 -07:00
Aaron Patterson
bfc432574d properly escape html to avoid invalid utf8 causing XSS attacks 2011-08-16 15:24:58 -07:00
Aaron Patterson
586a944ddd Tags with invalid names should also be stripped in order to prevent
XSS attacks.  Thanks Sascha Depold for the report.
2011-08-16 15:24:48 -07:00
Aaron Patterson
8a39f411dc prevent sql injection attacks by escaping quotes in column names 2011-08-16 15:24:42 -07:00
Aaron Patterson
b0555bb88b adding security email address 2011-08-16 11:30:02 -07:00
Xavier Noria
98fac9902b Merge branch 'master' of github.com:rails/rails 2011-08-16 11:19:20 -07:00
Jon Leighton
8e23615245 Use lazy load hooks to set parameter wrapping configuration. This means that it doesn't force Action Controller / Active Record to load, but it doesn't fail if they have already loaded. Thanks @josevalim for the hint. 2011-08-16 19:14:20 +01:00
Xavier Noria
0245792c83 Merge branch 'master' of github.com:lifo/docrails 2011-08-16 11:06:40 -07:00
Xavier Noria
d0d25a9317 prefer ends_with? over slicing 2011-08-16 10:49:20 -07:00
Xavier Noria
53a13083ec AS guide: document in Module#delegate that the method must be public in the target 2011-08-16 10:36:22 -07:00
Jeff Dutil
c5f97b5063 Fix formatting of active_record_validations_callbacks.textile so guide will render properly at http://edgeguides.rubyonrails.org/active_record_validations_callbacks.html#displaying-validation-errors-in-the-view 2011-08-16 13:12:07 -04:00
Jon Leighton
5902391567 Fix assets tests in railties 2011-08-16 16:41:01 +01:00
Jon Leighton
4dd985ae95 Don't reference ActiveRecord::Base in initializers/wrap_parameters.rb. Use config.active_record instead. This yields about a 20% decrease in startup time because it means that the connection is not created immediately on startup. Of course, this is only useful if you are not going to immediately use the database after startup. 2011-08-16 16:40:38 +01:00
Jon Leighton
0d5a6f68df In 1efd88283e, ConnectionAdapters was put under eager_autoload. Due to the requires in that file, this caused ConnectionSpecification to be loaded, which references ActiveRecord::Base, which means the database connection is established. We do not want to connect to the database when Active Record is loaded, only when ActiveRecord::Base is first referenced by the user. 2011-08-16 16:40:16 +01:00
Santiago Pastorino
c6e57467a6 Revert "Merge pull request #2543 from htanata/unused_require_in_ar_test"
This reverts commit 87152f2604, reversing
changes made to 0d3615f04c.
2011-08-16 09:24:49 -03:00
Santiago Pastorino
87152f2604 Merge pull request #2543 from htanata/unused_require_in_ar_test
Remove unused require in activerecord/test/cases/attribute_methods_test.rb
2011-08-16 05:22:27 -07:00
Vijay Dev
bd4800d614 document Array#append and Array#prepend methods in AS guide 2011-08-16 14:57:36 +05:30
Hendy Tanata
21e2eeacff Remove unused require. 2011-08-16 12:40:57 +08:00
Jon Leighton
0d3615f04c Fix tzinfo require (it broke test_raises_when_an_invalid_timezone_is_defined_in_the_config in railties) 2011-08-16 02:42:30 +01:00
Jon Leighton
f76842f57e Fix wrap_parameters initializer template 2011-08-16 02:28:13 +01:00
Jon Leighton
bfb9e61a9f Be more lazy about creating time zone objects. Decreases startup time by about 10%. (#734) 2011-08-16 01:33:34 +01:00
Jon Leighton
6c5f67cac1 Don't refer to ActionController::Base in the wrap_parameters initializer - use config object instead. Cuts about 15% off the load time. (#734) 2011-08-16 00:59:59 +01:00
Sebastian Martinez
308595739c Document Hash#extract!. 2011-08-15 20:20:28 -03:00
Jacob Mattingley
583d7c15c3 Fixed mistakes in layouts/rendering guide about yield
yield(:unspecified_block) actually returns true even if :unspecified_block never
exists. This means you can't use the form yield(:unspecified_block) or yield.
2011-08-15 16:00:53 -07:00
JESii
f7626ea38e Updates to Asset Pipeline Guide
Grammar/syntax/style changes:
1. Changed all 'we' to 'you'
2. Corrected typos
3. Make consistent styline (e.g., dashes & double-dash usage)
4. Change use of future tense (will...) to present tense (easier to read).
2011-08-15 15:17:13 -07:00
Jon Leighton
03a045b306 Bump arel dependency 2011-08-15 23:10:16 +01:00
Jon Leighton
c3dcb795f1 Use new SelectManager#source method 2011-08-15 23:10:16 +01:00
Jon Leighton
cc206a3507 Use new SelectManager#projections= method 2011-08-15 23:10:16 +01:00
Jon Leighton
12aaad0848 use update.key instead of update.ast.key. make better use of select manager. 2011-08-15 23:10:16 +01:00
Jon Leighton
8778c82e32 Use a SelectCore rather than a full SelectManager 2011-08-15 23:10:15 +01:00
Jon Leighton
fe0ec85541 Refactor building the update manager 2011-08-15 23:10:15 +01:00
Jon Leighton
43b99f290a Support for multi-table updates with limits, offsets and orders 2011-08-15 23:10:15 +01:00
Jon Leighton
128d006242 Support updates with joins. Fixes #522. 2011-08-15 23:10:15 +01:00
David Heinemeier Hansson
9482554f31 Added Array#prepend as an alias for Array#unshift and Array#append as an alias for Array#<< [DHH] 2011-08-15 16:56:33 -05:00
Jon Leighton
bb4e790dff Merge pull request #2539 from arunagw/delegate_expl
Delegate expl
2011-08-15 13:32:52 -07:00
Arun Agrawal
83eec4ca4c Requiring delegate. 2011-08-16 01:36:21 +05:30
Jon Leighton
b2469283a7 Removing unnecessary require, solve 'circular require considered harmful' warning. 2011-08-16 01:32:52 +05:30
Santiago Pastorino
fd29b4e47f Fix typo 2011-08-15 15:35:47 -03:00
Santiago Pastorino
4ca605b71b rake assets:precompile executes in production environment as default if RAILS_ENV was not provided 2011-08-15 15:31:47 -03:00
Santiago Pastorino
b01cc2241c Merge pull request #2536 from arunagw/unused_var
Unused variable removed.
2011-08-15 10:55:52 -07:00
Jon Leighton
ebb2e9423f Update travis config on @joshk's instructions 2011-08-15 17:23:15 +01:00
Arun Agrawal
45ccd64866 Unused variable removed. 2011-08-15 21:49:12 +05:30
Vijay Dev
c0c5d5fd2e assets guide - add info about require_directory, minor rephrasings 2011-08-15 21:46:21 +05:30
Jon Leighton
c80876f778 Document Object#public_send 2011-08-15 16:26:37 +01:00
Jon Leighton
2e2f3f5a46 Add a test for delegating a method ending in '=' as this is a special case. 2011-08-15 16:07:49 +01:00
Vijay Dev
b8363f84da minor changes in app templates guide 2011-08-15 20:36:32 +05:30
Jon Leighton
57423d815b Ensure empty has_many :through association preloaded via joins is marked as loaded. Fixes #2054. 2011-08-15 16:01:01 +01:00
Jon Leighton
4c743d9fce Merge pull request #2534 from arunagw/public_send_require
Need to include public_send
2011-08-15 06:46:59 -07:00
Arun Agrawal
10b99f2826 Need to include public_send 2011-08-15 19:13:25 +05:30
Jon Leighton
27da0c5480 Split up the definitions in Module#delegate depending on :allow_nil, and don't use exceptions for flow control in the :allow_nil => true case. 2011-08-15 13:56:04 +01:00
Jon Leighton
63d100ea35 Fix the line number in the backtrace when Module#delegate raises 2011-08-15 13:03:28 +01:00
Jon Leighton
7b56fb034a Fix private methods which are delegated to. This previously worked because Module#delegate previously ignored method visibility. 2011-08-15 12:38:44 +01:00
Jon Leighton
8bba95f293 Just do the method call directly in Module#delegate, if we can (we cannot for method names ending in '='). Two reasons: 1) it's faster, see https://gist.github.com/1089783 and 2) more importantly, delegate should not allow you to accidentally call private or protected methods. 2011-08-15 12:38:38 +01:00
Jon Leighton
6f4b405250 Backport Object#public_send to 1.8 so that we can implement Module#delegate such that non-public methods raise 2011-08-15 12:08:23 +01:00
Kamil Śliwak
9e3f0cdbbf Merge pull request #58 from cameel/fix-set_autoload_path-typo
Fix a typo in 'Configuring Rails Applications' guide
2011-08-14 17:23:02 -07:00
Kamil Śliwak
c026cc254c Fix a typo in 'Configuring Rails Applications' guide
- The initializer is called `set_autoload_paths`, not `set_autoload_path`. See https://github.com/rails/rails/blob/master/railties/lib/rails/engine.rb#L506
2011-08-15 03:13:07 +03:00
José Valim
652ab436db Ensure changing RAILS_GROUPS will load the proper dependencies. 2011-08-14 10:52:46 -07:00
Raul Murciano
7712db4c82 Typo 2011-08-14 10:24:48 -07:00
Raul Murciano
51b2502c5e Action Mailer guide: mention how to use :cc and :bcc parameters. 2011-08-14 10:20:02 -07:00
Raul Murciano
169a50930f Action Mailer guide update: the :to parameter now supports both String and Array values to indicate recipients. 2011-08-14 10:19:13 -07:00
José Valim
99f87c9ad3 Merge pull request #2527 from cesario/fix_2511
Methods like status and location are interfering with redirect_to [Closes #2511]
2011-08-14 10:04:14 -07:00
Franck Verrot
75dd33a0ae Methods like status and location are interfering with redirect_to [Closes #2511] 2011-08-14 19:00:30 +02:00
Vijay Dev
ac4dc5e240 rephrase how the verbose methods in a migration work 2011-08-14 20:15:51 +05:30
Vijay Dev
3c5715575d document alias for rails runner 2011-08-14 20:15:22 +05:30
Vijay Dev
9f76e47c9b added a few more items in the release notes 2011-08-14 19:52:22 +05:30
Vijay Dev
b98d3ab6f5 fix misleading comment (originally made by Tate Johnson, we lost this commit while porting to the rails repo) 2011-08-14 19:29:35 +05:30
Jonathon M. Abbott
4bb7abcb77 Use mysql_creation_options inside rescue block
Commit ecd37084b2 did not take into account the use of
creation_options inside the access denied exception handler.
2011-08-14 22:09:42 +10:00
Hendy Tanata
33be1b0e4b Active Model instead of ActiveModel. 2011-08-14 13:14:44 +08:00
Hendy Tanata
e10b288bc6 Use fixed-width font where necessary. 2011-08-14 13:08:50 +08:00
Hendy Tanata
4d525b8c03 Fix tt tag appearing on 3_1_release_notes guide. 2011-08-14 13:07:36 +08:00
Xavier Noria
bf2b9d2de3 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	RELEASING_RAILS.rdoc
	actionpack/lib/sprockets/railtie.rb
	actionpack/test/template/sprockets_helper_test.rb
	activerecord/test/cases/calculations_test.rb
	railties/guides/source/3_1_release_notes.textile
	railties/guides/source/active_resource_basics.textile
	railties/guides/source/command_line.textile
2011-08-13 16:30:07 -07:00
Waynn Lue
f566fb32c4 "suits" is correct here, not "suites" 2011-08-13 16:22:35 -07:00
Oge Nnadi
aa0d3cece8 Typo fix 2011-08-13 16:22:35 -07:00
Sebastian Martinez
0196f0feb1 Some fixes on the 3_1_release_notes guide. 2011-08-13 16:22:35 -07:00
geemus
53e1a9d411 update abstract_controller callbacks to document meta-programmed filters 2011-08-13 16:22:35 -07:00
Vishnu Atrai
54cd73e20d ActiveModel::Validations basic guide 2011-08-13 16:22:35 -07:00
Florent Guilleux
56efdbc626 Document exclamation point on dynamic finders 2011-08-13 16:22:34 -07:00
Emili Parreño
1b0d03b5db update rails on rack guide, section 2 needs to be changed or maybe deleted 2011-08-13 16:22:34 -07:00
Mr. Wolfe
635c1ca007 Revert "update rails on rack guide, section 2 needs to be changed or maybe deleted"
This reverts commit 7a4e545eccf834cb620df0f909ef3f4bec4e6608.
2011-08-13 16:22:34 -07:00
Mr. Wolfe
3b4e7c9f8e update rails on rack guide, section 2 needs to be changed or maybe deleted 2011-08-13 16:22:34 -07:00
Waynn Lue
76158146eb comma is more appropriate here 2011-08-13 16:22:34 -07:00
Floris Huetink
9cf56c709b Fixed typo (attachments method name was missing an s) in Action Mailer basics guide 2011-08-13 16:22:34 -07:00
Tate Johnson
239e615316 Fixed typo 2011-08-13 16:22:33 -07:00
Richard Hulse
49e81f21a3 [asset pipeline] update snippet to reflect patch
Two commented lines in example to match the
commit (8845ae683e)
2011-08-13 16:22:33 -07:00
Richard Hulse
32da2f864e [asset pipeline] update to reflect new sendfile header default
X-Sendfile headers are now set to nil and are off by default.
See commit eff7fddeb2
2011-08-13 16:22:33 -07:00
Vijay Dev
93ec7bb59a 3.1 release notes: fixed font changes 2011-08-13 16:22:33 -07:00
ov3y
8c133fc4c0 Point to current, official upgrade plugin 2011-08-13 16:22:33 -07:00
Richard Hulse
b840d71bfb [asset pipeline] Update Capistrano info
v2.8.0 of Capistrano has a recipe to handle precompile
and symlinking.
2011-08-13 16:22:33 -07:00
Vijay Dev
dbf22560c6 3.1 release notes: organize action_pack notes 2011-08-13 16:22:32 -07:00
JudeArasu
8320fbb3b0 prototype switch 2011-08-13 16:22:32 -07:00
Vijay Dev
31b820eef9 expand tmp:* tasks, and a few more additions in the command line guide 2011-08-13 16:22:32 -07:00
Vijay Dev
bc9eaf422d indentation fixes 2011-08-13 16:22:32 -07:00
Sukeerthi Adiga G
86ae14df47 Dirty object methods added to active model basics 2011-08-13 16:22:32 -07:00
Vishnu Atrai
a3cf68291d ActiveModel::Conversion basic guide 2011-08-13 16:22:32 -07:00
Vishnu Atrai
d5adaf2d38 ActiveModel::Callbacks basic guide 2011-08-13 16:22:32 -07:00
Vishnu Atrai
33d7a6bc55 ActiveModel::Callbacks basic guide 2011-08-13 16:22:31 -07:00
Richard Hulse
bc49d6d1eb [asset pipeline] fixed example
Changed << to += because we are _concatenating_
this new array to the end of config array, NOT
pushing this array in it.
2011-08-13 16:22:31 -07:00
Sukeerthi Adiga
b905f8c963 Rubygems => RubyGems 2011-08-13 16:22:31 -07:00
Waynn Lue
2579d88405 capitalize RubyGems properl 2011-08-13 16:22:31 -07:00
Waynn Lue
a7b2867061 rephrase "like to be" 2011-08-13 16:22:31 -07:00
Vishnu Atrai
9eb3e637fb AttributeMethods refector suffix method added some usages 2011-08-13 16:22:31 -07:00
Sukeerthi Adiga G
7963099b90 ActiveResource::Validations module basics updated 2011-08-13 16:22:30 -07:00
Vishnu Atrai
4bde1b0041 ActiveModel::AttributeMethods basic guide 2011-08-13 16:22:30 -07:00
Arun Agrawal
ac287b2aa0 Adding Basic file for ActiveModel. @vatrai and @sukeerthiadiga is going to take care other detailed stuff. 2011-08-13 16:22:30 -07:00
Aaron Patterson
c8e5c0d2b9 we should not ignore all gems in here 2011-08-13 16:22:30 -07:00
Santiago Pastorino
5852fcfb11 Add git push and git push --tags to RELEASING_RAILS.rdoc 2011-08-13 16:22:30 -07:00
Aaron Patterson
5399b20287 moving CI and Sam Ruby to the top of the list. I ❤️ CI and Sam 2011-08-13 16:22:30 -07:00
Aaron Patterson
bf0b6e4b8b add section about notifying implementors 2011-08-13 16:22:30 -07:00
Aaron Patterson
a7a3169cc3 fixing assert_difference issues on ruby 1.8 2011-08-13 16:22:29 -07:00
Aaron Patterson
886d0115dc fixing wrong words. thanks @jbrown 2011-08-13 16:22:29 -07:00
Casebook Developer
ebfca248f9 ActionView::Helpers::TextHelper#simple_format should not change the text in place. Now it duplicates it. 2011-08-13 16:22:29 -07:00
Aaron Patterson
6b80917314 adding my brain dump of the release process 2011-08-13 16:22:29 -07:00
Waynn Lue
68c4b66015 fix stringify_keys destructive behavior for most FormTagHelper functions
add four new tests to verify that the other three methods that called stringify_keys! are fixed. verified that the tests break in master without the code patch. Closes #2355
2011-08-13 16:22:29 -07:00
Jon Leighton
66e114cd0c Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved. 2011-08-13 16:22:29 -07:00
Santiago Pastorino
f2ea1ddc27 Fix a bit precompile and lazy compile comments 2011-08-13 16:22:28 -07:00
Aaron Patterson
eaee18dd9a make assert_difference error message not suck 2011-08-13 16:22:28 -07:00
artemk
bb72183bca accept option for recreate db for postgres (same as mysql now) 2011-08-13 16:22:28 -07:00
Santiago Pastorino
ab6b61e34c Don't require assets group in production by default, you can change this default in the application.rb anyways 2011-08-13 16:22:28 -07:00
Santiago Pastorino
a9b2634a3c This dep is already defined in activerecord.gemspec 2011-08-13 16:22:28 -07:00
Aaron Patterson
1ff52cbe81 initializing @open_transactions in the initialize method 2011-08-13 16:22:28 -07:00
Aaron Patterson
d6af6fc0c0 add a migrate class method and delegate to the new instance 2011-08-13 16:22:27 -07:00
Christopher Meiklejohn
9d31acf8b9 Ensure that .up and .down work as well. 2011-08-13 16:22:27 -07:00
Christopher Meiklejohn
9d19bae233 Support backwards compatible interface for migration down/up with rails 3.0.x. 2011-08-13 16:22:27 -07:00
Aaron Patterson
8293b10425 use File.directory? as Dir.exists? is only 1.9.2+ 2011-08-13 16:22:27 -07:00
Santiago Pastorino
f9a69e8744 Merge pull request #2324 from zenapsis/3-1-stable
Rails 3.1 throws a Errno::ENOTDIR if files are put in assets directories
2011-08-13 16:22:27 -07:00
Brian Durand
05d4b9d2fd Pass options in ActiveSupport::Cache::CacheStore#read_multi through to the delete_entry call. 2011-08-13 16:22:27 -07:00
Dmitriy Kiriyenko
cc78a8f04c Remove unnecessary require (happened after fcbde454f6) 2011-08-13 16:22:27 -07:00
Bogdan Gusiev
f86f770250 MassAssignmentProtection: consider 'id' insensetive in StrictSanitizer
In order to use StrictSanitizer in test mode
Consider :id as not sensetive attribute that can be filtered from
mass assignement without exception.
2011-08-13 16:22:26 -07:00
thoefer
5f3265c471 Fix the issue where default_url_options is being cached on test cases. Closes #1872. Closes #2031.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-08-13 16:22:26 -07:00
José Valim
b6b6e81a5c Rename new method to_path to to_partial_path to avoid conflicts with File#to_path and similar. 2011-08-13 16:22:26 -07:00
Arun Agrawal
30ef55de66 Removing extra requires from the test. Already loaded in abstract_unit. 2011-08-13 16:22:26 -07:00
Vishnu Atrai
9d0b376bbf remove extra require for 'active_support/dependencies' as it is required in abstract_unit.rb 2011-08-13 16:22:26 -07:00
Vishnu Atrai
665a89ed4f remove extra require for 'stringio' as it is required in helper.rb 2011-08-13 16:22:26 -07:00
Vijay Dev
076afd0e22 fixes #2368. rake about not showing the middleware, db adapter and db schema version 2011-08-13 16:22:25 -07:00
Brad Ediger
e1b546464e remove_possible_method: test if method exists
This speeds up remove_possible_method substantially since it doesn't
have to rescue a NameError in the common case.

Closes #2346.
2011-08-13 16:22:25 -07:00
Arun Agrawal
3d2bda9601 magic comment test only if encoding_aware?. 2011-08-13 16:22:25 -07:00
Vishnu Atrai
67d76f43a0 Covering more files in test for plugin new generator. 2011-08-13 16:22:25 -07:00
Brian Cardarella
3d87d01dad Resolve warnings by instantizing @attrubtes as nil 2011-08-13 16:22:25 -07:00
Waynn Lue
759815547b remove redundant calls to stringify_keys 2011-08-13 16:22:25 -07:00
Brian Durand
48fce08bb3 Change ActiveSupport::Cache behavior to always return duplicate objects instead of frozen objects. 2011-08-13 16:22:24 -07:00
Aaron Patterson
f85b966269 delay backtrace scrubbing until we actually raise an exception. fixes #1936 2011-08-13 16:22:24 -07:00
Aaron Patterson
4a74493816 default writing the schema file as utf-8 2011-08-13 16:22:24 -07:00
Aaron Patterson
17a66a8ddc dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592 2011-08-13 16:22:24 -07:00
Brian Cardarella
55fb1780a0 Instead of removing the instance variable just set it to nil, resolves the warnings because of a missing instance variable 2011-08-13 16:22:24 -07:00
Brian Cardarella
9d5340e709 Reset @dirty to false when slicing an instance of SafeBuffer 2011-08-13 16:22:24 -07:00
Arun Agrawal
1deb0253ae Test add for plugin new generator generate mailer 2011-08-13 16:22:24 -07:00
Dan Gebhardt
bfde0636dd Include empty app/mailers directory in mountable and full plugins 2011-08-13 16:22:23 -07:00
Santiago Pastorino
651a9c93be Tidy up 2011-08-13 16:22:23 -07:00
Franck Verrot
018b1315b5 We don't need to require erb here. 2011-08-13 16:22:23 -07:00
thedarkone
a53ef97206 Make use of the inherited initializer. 2011-08-13 16:22:23 -07:00
thedarkone
37b30d4b4e There is no need to be destructive with the passed-in options.
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
2011-08-13 16:22:23 -07:00
Grant Hutchins
c4cf9073a1 Give attribution to Peter Jaros for the patch we paired on. 2011-08-13 16:22:23 -07:00
Vishnu Atrai
b50dfce601 pluging generator test fix 2011-08-13 16:22:22 -07:00
Santiago Pastorino
60f593dc54 Tidy up a bit plugin new gemspec 2011-08-13 16:22:22 -07:00
Dan Gebhardt
47cc214600 Moved dependencies from Gemfile to gemspec to eliminate redundant declarations. 2011-08-13 16:22:22 -07:00
Dan Gebhardt
f9eadb8b43 Extracted version from gemspec and placed it in its own file. This is consistent with the approach taken by "bundle gem", and is expected by gems such as svenfuchs/gem-release which can be used to bump / tag versions of gems. 2011-08-13 16:22:22 -07:00
Dan Gebhardt
b82e226b7f Expanded meta-data in gemspec to include author, email, etc.; Defaults include "TODO" to prevent gems from being built without review. 2011-08-13 16:22:22 -07:00
Jon Leighton
bec5977932 Revert "Merge pull request #2309 from smasry/master"
This reverts commit 9d396ee819, reversing
changes made to fa2bfd832c.

Reason: the change broke the build.
2011-08-13 16:22:22 -07:00
José Valim
66fdfbc2d5 Update CHANGELOG. 2011-08-13 16:22:21 -07:00
José Valim
554ea3c37b Move the cache to a nested hash which performs better than a hash with array as keys. 2011-08-13 16:22:21 -07:00
José Valim
91ca214ca0 Rename class method to_path to _to_path and make it explicit that it is an internal method. 2011-08-13 16:22:21 -07:00
Grant Hutchins & Peter Jaros
6e671a8536 Let ActiveModel instances define partial paths.
Deprecate ActiveModel::Name#partial_path. Now you
should call #to_path directly on ActiveModel
instances.
2011-08-13 16:22:21 -07:00
Joshua Peek
a636a9358e Make Rails.application.assets available in initializers 2011-08-13 16:22:21 -07:00
Xavier Noria
f76e689f00 contrib app minor tweak 2011-08-13 16:22:21 -07:00
Samer Masry
c751bb1ac2 Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697 2011-08-13 16:22:20 -07:00
thedarkone
45f9c2b361 Handle the empty array correctly. 2011-08-13 16:22:20 -07:00
Christos Zisopoulos
035d31bd93 Improve performance and memory usage for options_for_select with Ruby 1.8.7 2011-08-13 16:22:20 -07:00
Dmitriy Kiriyenko
4c873cbf36 Fixed failing query when performing calculation with having based on select. 2011-08-13 16:22:20 -07:00
Jon Leighton
05f1a9bcc3 Add a proxy_association method to association proxies, which can be called by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner. 2011-08-13 16:22:20 -07:00
Lachlan Sylvester
924975a34a fix some types in schema_test.rb 2011-08-13 16:22:20 -07:00
Aaron Patterson
ed09aef1a3 simplify conditionals by assuming hash values will never be false 2011-08-13 16:22:19 -07:00
Aaron Patterson
a704fd4ea9 use regular ruby rather than clever ruby 2011-08-13 16:22:19 -07:00
Aaron Patterson
f445bb2671 fixing wildcard path matching when wildcard is inside parenthesis 2011-08-13 16:22:19 -07:00
Jonathan del Strother
ab422b04a2 Replace unnecessary regexp in Dependencies#load_missing_constant 2011-08-13 16:22:19 -07:00
Jonathan del Strother
f1403f9303 Constantize a regexp in Dependencies#load_missing_constant 2011-08-13 16:22:19 -07:00
Santiago Pastorino
1d64041d59 Remove blank line 2011-08-13 16:22:19 -07:00
thoefer
39183f4ede refactored 'assert_redirected_to': local call to validate_request! will be called in assert_response already. changed names of local variables in order to recognize the semantics a bit easier. 2011-08-13 16:22:18 -07:00
Santiago Pastorino
b36a710e71 Remove cruise files 2011-08-13 16:22:18 -07:00
Dan Gebhardt
28daa8bd4b added test case for fix to issue #2094 2011-08-13 16:22:18 -07:00
Dan Gebhardt
f87b33daaf fixed problem in which options[:html][:remote] would be overridden in form_for() - fixes #2094 2011-08-13 16:22:18 -07:00
Vishnu Atrai
d13b5d4b2a remove unused variables warnings removed 2011-08-13 16:22:18 -07:00
Josh Kalderimis
7b2d5e0d92 enable Travis CI irc notifications to #rails-contrib on irc.freenode.org 2011-08-13 16:22:18 -07:00
Vishnu Atrai
745d90bde3 remove deprication warning: ambiguous first argument; put parentheses or even spaces 2011-08-13 16:22:17 -07:00
Aaron Patterson
797d2254d7 fixing tests on ruby trunk 2011-08-13 16:22:17 -07:00
Aaron Patterson
7934ffe5e9 fixing whitespace errors 2011-08-13 16:22:17 -07:00
Vishnu Atrai
5a92c6627e remove deprication warning for ruby 1.9.3-head for unused variables 2011-08-13 16:22:17 -07:00
Damien Mathieu
838ec4b645 use sprocket's append_path and assert_match 2011-08-13 16:22:17 -07:00
Piotr Sarnacki
182a428418 Revert "allow select to have multiple arguments"
This reverts commit 04cc446d17.

I reverted it because apparently we want to use: select([:a, :b])
instead of select(:a, :b), but there was no tests for that form.
2011-08-13 16:22:17 -07:00
Sławosz Sławiński
e7f7439d06 allow select to have multiple arguments 2011-08-13 16:22:16 -07:00
Franck Verrot
5004aaffc1 Simplify the test by using id and name. id will be the only real sort criteria in any case as it's unique. 2011-08-13 16:22:16 -07:00
Santiago Pastorino
16e3c40426 use_sprockets is not used anymore 2011-08-13 16:22:16 -07:00
Santiago Pastorino
33ee3898ef Bump sprockets up 2011-08-13 16:22:16 -07:00
Santiago Pastorino
34ca9c122c Check that Rack::Sendfile is not included unless config.action_dispatch.x_sendfile_header is set 2011-08-13 16:22:16 -07:00
Santiago Pastorino
cd5f54cfb6 Bump rack up. Closes #2107 2011-08-13 16:22:16 -07:00
Erik Michaels-Ober
6d4f916218 Add documentation for :format => true 2011-08-13 16:22:15 -07:00
Erik Michaels-Ober
710c5eaf2f Allow a route to have :format => true
When format is true, it is mandatory (as opposed to :format => false).
This is currently not possible with resource routes, which automatically
make format optional by default.
2011-08-13 16:22:15 -07:00
Santiago Pastorino
5b5b22acb5 Remove unused use_sprockets config 2011-08-13 16:22:15 -07:00
Santiago Pastorino
19ac034bdc Don't use Rack::Sendfile middleware if x_sendfile_header is not present 2011-08-13 16:22:15 -07:00
Xavier Noria
b537595665 Revert "Explicitly included hashes in sentence regarding SQL-injection-safe forms"
Reason: The hash form is secure, and preferred over the array form if possible.

This reverts commit 6dc749596c.
2011-08-13 16:22:15 -07:00
Xavier Noria
19122e767c Revert "grammatical changes"
Reason: As discussed in GitHub, it is debatable, and present tense
is fine (and simple, and preferred).

This reverts commit 54ccda9f0a5e4a5e72a4c159dc8787faaf65e8a2.
2011-08-13 16:22:15 -07:00
Rashmi Yadav
111347f0cc The trailing '/' isn't being picked up by Github anyway, and the link works as is. 2011-08-13 16:22:15 -07:00
Waynn Lue
0012a9e9d4 The trailing '/' isn't being picked up by Github anyway, and the link works as is. 2011-08-13 16:22:14 -07:00
JudeArasu
fbd3e38d76 grammatical changes 2011-08-13 16:22:14 -07:00
Vijay Dev
e4d8a95443 typo fix 2011-08-13 16:22:14 -07:00
Vijay Dev
688b0c318f minor changes in migrations guide 2011-08-13 16:22:14 -07:00
Vijay Dev
5adb90a14f fixed incorrect tags 2011-08-13 16:22:14 -07:00
pbflinn
ff0b1a3cc6 Fix typo 'console' -> 'constant' 2011-08-13 16:22:14 -07:00
Vishnu Atrai
1ea8d9c38d Active Resource - guide for destroy 2011-08-13 16:22:13 -07:00
Vishnu Atrai
212654be02 Active Resource - guide for update/save 2011-08-13 16:22:13 -07:00
Vishnu Atrai
aa9da1fe70 Active Resource - guide for create 2011-08-13 16:22:13 -07:00
Vishnu Atrai
61899bff17 Active Resource - guide for reading and writing data 2011-08-13 16:22:13 -07:00
Waynn Lue
55296ec0ea typo in "wont" 2011-08-13 16:22:13 -07:00
Vijay Dev
8f6959d5a4 3.1 release notes Active Record changes, Architectural changes and
organizing sections.
2011-08-13 16:22:13 -07:00
Arun Agrawal
8015acf032 Adding more info as rake about is fixed 2011-08-13 16:22:12 -07:00
Arun Agrawal
0e715d0b8c Rack::Sendfile is no more default middleware. 2011-08-13 16:22:12 -07:00
Waynn Lue
a98eca8ba5 "blog" is more common than "weblog" these days. 2011-08-13 16:22:12 -07:00
Vijay Dev
f407239964 3.1 release notes - added AP and Railties sections 2011-08-13 16:22:12 -07:00
Vijay Dev
ebbf010d4d 3.1 release notes draft 2011-08-13 16:22:12 -07:00
Vijay Dev
ad9e52f156 prefer to use if..end unless the condition is simple/compact 2011-08-13 16:22:12 -07:00
Vijay Dev
225a2482c1 remove some parts of the section on shortcut helpers, document custom validators 2011-08-13 16:22:11 -07:00
Vijay Dev
7372e9ae9a make the warning clear about the effect of using validates_associated on both sides on an association. 2011-08-13 16:22:11 -07:00
Vishnu Atrai
ad55b1aa86 usages of active resouce 2011-08-13 16:22:11 -07:00
Vishnu Atrai
95c2230f05 configuration for active resource 2011-08-13 16:22:11 -07:00
Vishnu Atrai
5da1ddb750 Introduction for active resource 2011-08-13 16:22:11 -07:00
Vishnu Atrai
2177282262 Active Resouce guide initial load 2011-08-13 16:22:11 -07:00
Bratish Goswami
186e7dd4ff '/' was outside of anchor tag. 2011-08-13 16:22:11 -07:00
Waynn Lue
086339a26a Superfluous "the". 2011-08-13 16:22:10 -07:00
Bratish Goswami
bf3649ab19 extra '/' removed from url, which was not linked 2011-08-13 16:22:10 -07:00
Xavier Noria
acfdb18d92 Merge pull request #2519 from vijaydev/readme_fixes
Fixes the README links in README.rdoc on GitHub
2011-08-13 10:52:12 -07:00
Vijay Dev
c3bd6bb75f Fixes readme links better - earlier links broke when the current page is anything other than github.com/rails/rails/. Even github.com/rails/rails (without the trailing slash) broke the readme links. Also change the rakefile that generates the rdoc readme accordingly 2011-08-13 22:14:18 +05:30
Jon Leighton
9ecc4433bb Perf: don't mess around with thread local vars unless we actually need to 2011-08-13 16:54:05 +01:00
Jon Leighton
24f902b1bc Fix default scope thread safety. Thanks @thedarkone for reporting. 2011-08-13 16:54:05 +01:00
José Valim
291072a64a Merge pull request #2514 from myronmarston/fix_active_record_observer_disabling
Allow ActiveRecord observers to be disabled.
2011-08-13 08:40:13 -07:00
Jon Leighton
34689c40a0 Work around for lolruby bug. (Read on for explanation.)
We were experiencing CI test failures, for example:

* 3-1-stable: http://travis-ci.org/#!/rails/rails/builds/79473/L407
* master: http://travis-ci.org/#!/rails/rails/builds/79507/L80

These failures only happened on 1.8.7-p352, and we were only able to
reproduce on the Travis CI VM worker. We even tried creating a new 32
bit Ubuntu VM and running the tests on that, and it all worked fine.

After some epic trial and error, we discovered that replacing the
following:

  fuu = Marshal.load(Marshal.dump(fuu))

with:

  marshalled = Marshal.dump(fuu)
  fuu = Marshal.load(marshalled)

seemed to prevent the failure.

We have NO IDEA why this is. If anyone has some great insight to
contribute then that is welcome. Otherwise, hopefully this will just
help us get the CI green again.

Many thanks to @joshk for help with sorting this out.
2011-08-13 13:54:54 +01:00
Jon Leighton
6b56f059bf Merge pull request #2516 from arunagw/path_set_fix
We need [] method here. previously it's an array.
2011-08-13 03:31:43 -07:00
Arun Agrawal
5bc87cc2ee We need [] method here. previously it's an array. 2011-08-13 13:13:05 +05:30
Myron Marston
d3c15a1d31 Allow ActiveRecord observers to be disabled.
We have to use Observer#update rather than Observer#send since the enabled state is checked in #update before forwarding the method call on.
2011-08-12 20:48:44 -07:00
Aaron Patterson
943a37348a moving test_generate to an integration test with one assert per test 2011-08-12 15:55:00 -07:00
Aaron Patterson
c420ebf74a Merge pull request #2503 from arunagw/cant_dup_on_nil
We cannot dup on nil.
2011-08-12 15:54:33 -07:00
Arun Agrawal
8196c842b6 We actually don't need a reverse_merge! here. dup removed was giving error with nil class. 2011-08-12 16:56:29 +05:30
Santiago Pastorino
d1f1b04386 Merge pull request #2497 from akaspick/url_for_fix
When calling url_for with a hash, additional (likely unwanted) values (such as :host) would be returned in the hash
2011-08-11 15:55:14 -07:00
Andrew Kaspick
60d358b233 fix assert_select_email to work on non-multipart emails as well as converting the Mail::Body to a string to prevent errors. 2011-08-11 17:49:31 -05:00
Andrew Kaspick
61579b7661 when calling url_for with a hash, additional (likely unwanted) values (such as :host) would be returned in the hash... calling #dup on the hash prevents this 2011-08-11 13:28:31 -05:00
Santiago Pastorino
e6fdfd0f6f Merge pull request #2489 from grzuy/master
Remove parameters_for_url from form_tag method header
2011-08-11 06:38:57 -07:00
Waynn Lue
895d64531d fix destructive stringify_keys for label_tag 2011-08-11 00:30:45 -07:00
Gonzalo Rodriguez and Leonardo Capillera
9e81bfd8fc Remove 'parameters_for_url' parameter from 'form_tag' method signature
If you use that parameter it will end calling to url_for with two
arguments, which fails because url_for expects only one
2011-08-10 23:14:56 -03:00
Aaron Patterson
d00e1646f7 add the gem requirement for sqlite3 2011-08-10 11:39:48 -07:00
Andrew Kaspick
d48dd18bb2 fix exists? to return false if passed nil (which may come from a missing URL param) 2011-08-10 12:55:29 -05:00
José Valim
bb4f687bc6 Remove lame comment. 2011-08-09 16:49:38 -07:00
Santiago Pastorino
d9b690f71f rake assets:precompile defaults to production env 2011-08-09 20:40:52 -03:00
Aaron Patterson
5f56db4454 adding missing require to fist railties tests 2011-08-09 14:54:56 -07:00
Jon Leighton
4f8801963c Okay, the new incompatible arel is now called 2.2 and the sun shines upon thee once more 2011-08-09 22:05:48 +01:00
Aaron Patterson
ae3ab0c58a Merge pull request #2465 from pivotal-casebook/patch-3
Further monkey-patching to avoid deprecation warnings
2011-08-09 13:33:24 -07:00
Aaron Patterson
f9f423fa18 deprecating process_view_paths 2011-08-09 12:10:25 -07:00
Aaron Patterson
3ad26c8e48 avoid object creation via useless duping and freezing 2011-08-09 11:41:06 -07:00
Aaron Patterson
26e53a16c4 just use map and case / when rather than modifying the iterating array 2011-08-09 11:30:43 -07:00
Aaron Patterson
7cd3772fe6 only typecast what we need to typecast 2011-08-09 11:26:44 -07:00
Aaron Patterson
b14f1c3ad7 Favor composition over inheritance. 2011-08-09 11:23:02 -07:00
Aaron Patterson
88de343ef4 Array#+ automatically dups, no double duping 2011-08-09 10:54:05 -07:00
Aaron Patterson
14a8fd146a Just remove the sort_locals method 2011-08-09 10:13:02 -07:00
Aaron Patterson
1fbc4704df the freeze trick does nothing on arrays used as hash keys. 2011-08-09 10:09:46 -07:00
Aaron Patterson
233696a027 use functional style to build a list of template objects 2011-08-09 09:32:16 -07:00
Aaron Patterson
37b77c6ae7 refactor the optimized build_query a bit 2011-08-08 22:16:52 -07:00
Aaron Patterson
128467e927 reduce file stats by improving our dir glob pattern 2011-08-08 21:42:45 -07:00
Aaron Patterson
295a7fd1bb hash on the template directory in order to improve cache hits 2011-08-08 21:03:40 -07:00
Aaron Patterson
940404096f use meaningful names with our variables 2011-08-08 21:01:19 -07:00
Aaron Patterson
0155bf4021 use binread to read the files 2011-08-08 19:51:41 -07:00
Aaron Patterson
681bf1fc48 backporting IO#binread for 1.8 users 2011-08-08 19:48:12 -07:00
Aaron Patterson
0b212117e6 be explicit about arguments passed around 2011-08-08 19:29:12 -07:00
Jon Leighton
5680a51dcb Remove TODO comment I didn't mean to commit 2011-08-09 00:00:52 +01:00
Jon Leighton
5870291425 Bump arel version 2011-08-08 23:51:07 +01:00
Jon Leighton
9062b75bb7 Fully marshal AR::Base objects. Fixes #2431. 2011-08-08 23:28:49 +01:00
Jon Leighton
7db90aa7c7 Make it the responsibility of the connection to hold onto an ARel visitor for generating SQL. This improves the code architecture generally, and solves some problems with marshalling. Adapter authors please take note: you now need to define an Adapter.visitor_for method, but it degrades gracefully with a deprecation warning for now. 2011-08-08 23:28:23 +01:00
Aaron Patterson
ff9a2e6697 Merge pull request #2426 from pivotal-casebook/fix-build
Make rails gem build directory consistent with actionpack, etc.
2011-08-08 14:17:02 -07:00
Aaron Patterson
11fbeb71d9 Merge pull request #2466 from rsim/fix_test_disable_referential_integrity
Fixed test_disable_referential_integrity on Oracle
2011-08-08 12:40:28 -07:00
Raimonds Simanovskis
58af0d46cf Fixed test_disable_referential_integrity on Oracle
On Oracle disable_referential_integrity before execution of block will disable foreign key constraints and after block will enable them but when constraints are enabled then they are validated. Therefore created record with invalid foreign key should be deleted before enabling foreign key constraints.
2011-08-08 22:32:26 +03:00
Pivotal Casebook
396e12155a Further monkey-patching to avoid deprecation warnings 2011-08-08 13:47:24 -03:00
Santiago Pastorino
8360d71965 Initialize config.assets.version the same way it's done in Sprockets 2011-08-08 12:49:10 -03:00
Joshua Peek
eabc036496 Merge pull request #2448 from igrigorik/master
Asset pipeline fixes: clear out tmp cache and use environment in digest generation
2011-08-08 07:42:49 -07:00
Aaron Patterson
9e5140078f Merge pull request #2451 from gdelfino/master
sqlite transactions in log files
2011-08-07 18:22:32 -07:00
Xavier Noria
e746980507 guides generation: apparently this workaround for RedCloth is not needed anymore 2011-08-07 16:20:51 -07:00
Xavier Noria
e06db7276c Merge pull request #2457 from Gregg/zombie_singular_fix
Added irregular zombie inflection, so zombies != zomby
2011-08-07 11:34:10 -07:00
Gregg Pollack
554232e481 Added irregular zombie inflection, so zombies no longer gets singularized into zomby 2011-08-07 14:20:03 -04:00
Santiago Pastorino
9c205624ee Merge pull request #2455 from vijaydev/patch-7
Edit changelog to mention about x_sendfile_header default change
2011-08-07 11:01:29 -07:00
Vijay Dev
4cf94979c9 edit changelog to mention about x_sendfile_header default change -
Santiago Pastorino
8845ae683e x_sendfile_header now defaults to nil and production.rb env file doesn't
set a particular value for it. This allows servers to set it through
X-Sendfile-Type, read
https://github.com/rack/rack/blob/master/lib/rack/sendfile.rb for more
info. Anyways you can force this value in your production.rb
2011-08-07 13:11:50 -03:00
José Valim
888539c541 Test against 1.9.3 as well. 2011-08-07 13:18:10 +03:00
Gustavo Delfino
cdb49fc2f3 sqlite transactions now logged
motivation: http://stackoverflow.com/questions/6892630/sqlite-transactions-not-showing-in-test-log
2011-08-06 16:05:45 -04:30
Santiago Pastorino
7ba95bf747 Merge pull request #2450 from guilleiguaran/activesupport-gzip-1.8
Fix ActiveSupport::Gzip under Ruby 1.8.7. Closes #2416
2011-08-06 13:18:51 -07:00
Guillermo Iguaran
aed9917094 Fix ActiveSupport::Gzip under Ruby 1.8.7. Closes #2416 2011-08-06 11:33:18 -05:00
Santiago Pastorino
81eb5b38db Merge pull request #2444 from elight/master
Minor refactor to delegate
2011-08-06 05:27:40 -07:00
Santiago Pastorino
43e581ef7f Use rake >= 0.9.3.beta.1 in Ruby 1.9.3 2011-08-06 09:16:17 -03:00
Ilya Grigorik
c0bfb5a63c use assets.version in asset checksum to allow user to easily override 2011-08-05 22:55:56 -07:00
Evan Light
b642922496 Refactored to more closely resemble idiom applied for on_nil 2011-08-05 22:06:47 -04:00
Santiago Pastorino
201e41e11a Avoid generating app/views/layouts/application.html.erb on mountable engines, just generate the namespaced one 2011-08-05 21:29:00 -03:00
Aaron Patterson
5bc6285cfe Revert "Test against Rubinius"
This reverts commit 3cfbb38244.
2011-08-05 15:51:33 -07:00
Aaron Patterson
cec805f515 Merge pull request #2442 from sferik/test_on_rubinius
Test against Rubinius
2011-08-05 15:47:23 -07:00
Erik Michaels-Ober
3cfbb38244 Test against Rubinius
Happy Rubinius Day!
2011-08-05 15:44:28 -07:00
Santiago Pastorino
1b676fc760 Revert "to_key on a destroyed model should return nil". Closes #2440
This reverts commit c5448721b5.
2011-08-05 19:39:19 -03:00
Santiago Pastorino
e0a6ec2149 Fix test for Rubinius 2011-08-05 16:48:46 -03:00
Aaron Patterson
ab2582f417 Merge pull request #2439 from guilleiguaran/fix-error-on-ar-tests-rbxday
Fix AR test suite error under Rubinius 2.0 #rbxday
2011-08-05 11:28:53 -07:00
Guillermo Iguaran
780ee36c56 Fix AR test suite error under Rubinius 2.0 2011-08-05 13:20:18 -05:00
Aaron Patterson
5a05207d99 pg does not allow aliases in the having clause, but functions are fine 2011-08-05 11:20:15 -07:00
Ilya Grigorik
fe55f5e581 Merge branch 'asset_hash_should_depend_on_env' 2011-08-04 23:55:31 -04:00
Ilya Grigorik
050c1510b6 Clear out tmp/cache when assets:clean is invoked.
Otherwise, if bad data is cached in tmp/clear then the next invocation
of assets:precompile (or a regular incoming request) will pickup files from
tmp without regenerating them from source.
2011-08-04 23:54:22 -04:00
Ilya Grigorik
ed5c6d254c generate environment dependent asset digests
If two different environments are configured to use the pipeline, but
one has an extra step (such as compression) then without taking the
environment into account you may end up serving wrong assets
2011-08-04 23:53:32 -04:00
Ilya Grigorik
e44efac086 Clear out tmp/cache when assets:clean is invoked.
Otherwise, if bad data is cached in tmp/clear then the next invocation
of assets:precompile (or a regular incoming request) will pickup files from
tmp without regenerating them from source.
2011-08-04 23:53:32 -04:00
Xavier Noria
04f88d1630 Merge branch 'master' of github.com:rails/rails 2011-08-04 16:42:14 -07:00
Xavier Noria
9e18380a32 Revert "Explicitly included hashes in sentence regarding SQL-injection-safe forms"
Reason: The hash form is secure, and preferred over the array form if possible.

This reverts commit 6dc749596c.
2011-08-04 16:41:31 -07:00
Xavier Noria
e82b4901eb Revert "grammatical changes"
Reason: As discussed in GitHub, it is debatable, and present tense
is fine (and simple, and preferred).

This reverts commit 54ccda9f0a5e4a5e72a4c159dc8787faaf65e8a2.
2011-08-04 16:41:31 -07:00
Rashmi Yadav
681d919e48 The trailing '/' isn't being picked up by Github anyway, and the link works as is. 2011-08-04 16:41:31 -07:00
Waynn Lue
5f2c790cb7 The trailing '/' isn't being picked up by Github anyway, and the link works as is. 2011-08-04 16:41:31 -07:00
JudeArasu
2e764c5fd1 grammatical changes 2011-08-04 16:41:30 -07:00
Vijay Dev
25845b3d42 typo fix 2011-08-04 16:41:30 -07:00
Vijay Dev
febdd6c96c minor changes in migrations guide 2011-08-04 16:41:30 -07:00
Vijay Dev
b3719ee7ed fixed incorrect tags 2011-08-04 16:41:30 -07:00
pbflinn
9e1a27a0ac Fix typo 'console' -> 'constant' 2011-08-04 16:41:30 -07:00
Vishnu Atrai
f3564b9e22 Active Resource - guide for destroy 2011-08-04 16:41:29 -07:00
Vishnu Atrai
eed1026e83 Active Resource - guide for update/save 2011-08-04 16:41:29 -07:00
Vishnu Atrai
163533b17d Active Resource - guide for create 2011-08-04 16:41:29 -07:00
Vishnu Atrai
abfbab2713 Active Resource - guide for reading and writing data 2011-08-04 16:41:29 -07:00
Waynn Lue
dbc10a09b3 typo in "wont" 2011-08-04 16:41:29 -07:00
Vijay Dev
05f6135895 3.1 release notes Active Record changes, Architectural changes and
organizing sections.
2011-08-04 16:41:28 -07:00
Arun Agrawal
f63599825b Adding more info as rake about is fixed 2011-08-04 16:41:28 -07:00
Arun Agrawal
8362b070dc Rack::Sendfile is no more default middleware. 2011-08-04 16:41:28 -07:00
Waynn Lue
384ac3eca7 "blog" is more common than "weblog" these days. 2011-08-04 16:41:28 -07:00
Vijay Dev
fe6b967aea 3.1 release notes - added AP and Railties sections 2011-08-04 16:41:28 -07:00
Vijay Dev
4e28c40bfd 3.1 release notes draft 2011-08-04 16:41:27 -07:00
Vijay Dev
54e7694982 prefer to use if..end unless the condition is simple/compact 2011-08-04 16:41:27 -07:00
Vijay Dev
29772a136a remove some parts of the section on shortcut helpers, document custom validators 2011-08-04 16:41:27 -07:00
Vijay Dev
38bfcffc59 make the warning clear about the effect of using validates_associated on both sides on an association. 2011-08-04 16:41:27 -07:00
Vishnu Atrai
c62cb2f2fb usages of active resouce 2011-08-04 16:41:27 -07:00
Vishnu Atrai
8d1c642cae configuration for active resource 2011-08-04 16:41:27 -07:00
Vishnu Atrai
e898556543 Introduction for active resource 2011-08-04 16:41:26 -07:00
Vishnu Atrai
f56c2b88c5 Active Resouce guide initial load 2011-08-04 16:41:26 -07:00
Bratish Goswami
2350185e40 '/' was outside of anchor tag. 2011-08-04 16:41:26 -07:00
Waynn Lue
b15cc2e8ec Superfluous "the". 2011-08-04 16:41:26 -07:00
Bratish Goswami
e23bc8ac9b extra '/' removed from url, which was not linked 2011-08-04 16:41:26 -07:00
Arun Agrawal
60af023107 Extra "l" removed before h2. 2011-08-04 16:41:10 -07:00
Vijay Dev
d8c77fa16c document meta method 2011-08-04 16:40:25 -07:00
ejy
07f172ff83 Removed trailing slash of 'Download and installation' Github URL as per convention 2011-08-04 16:40:25 -07:00
Pete Campbell
3c3f808764 Explicitly included hashes in sentence regarding SQL-injection-safe forms 2011-08-04 16:40:25 -07:00
Alberto Perdomo
e84ea65e71 Association and Callbacks guide: Added section on shortcut syntax 'validates'. 2011-08-04 16:40:25 -07:00
Hendy Tanata
a45c2d5934 Fix two spaces between sententes on README.rdoc. 2011-08-04 16:40:24 -07:00
Vijay Dev
2dc6cca773 move the note after the scaffold files listing 2011-08-04 16:40:24 -07:00
Xavier Noria
4265f2eaa5 sync the getting started guide with master 2011-08-04 16:40:24 -07:00
Aaron Patterson
c7af6cf58e we should not ignore all gems in here 2011-08-04 16:31:57 -07:00
Santiago Pastorino
d338e8976f Add git push and git push --tags to RELEASING_RAILS.rdoc 2011-08-04 18:43:13 -03:00
Andrew Marshall & Sean Moon
343daf309b Make rails gem build directory consistent with actionpack, etc. 2011-08-04 17:32:43 -04:00
Aaron Patterson
cb6a082fee moving CI and Sam Ruby to the top of the list. I ❤️ CI and Sam 2011-08-04 14:15:45 -07:00
Aaron Patterson
879dcada2e add section about notifying implementors 2011-08-04 14:13:41 -07:00
Aaron Patterson
2d2c9179ad fixing assert_difference issues on ruby 1.8 2011-08-04 14:07:40 -07:00
Aaron Patterson
19ab8e4bc9 fixing wrong words. thanks @jbrown 2011-08-04 14:07:39 -07:00
Santiago Pastorino
d7e55c3429 Merge pull request #2421 from pivotal-casebook/master
Simple_format should not edit it in place. (Fixes https://github.com/rails/rails/issues/1980)
2011-08-04 11:49:43 -07:00
Aaron Patterson
bf5b4c0055 adding my brain dump of the release process 2011-08-04 11:27:41 -07:00
Casebook Developer
f0034c75d5 ActionView::Helpers::TextHelper#simple_format should not change the text in place. Now it duplicates it. 2011-08-04 13:34:47 -04:00
Santiago Pastorino
cf96649bb7 Merge pull request #2356 from waynn/fix_symbol
fix stringify_keys destructive behavior for most FormTagHelper functions
2011-08-04 09:29:18 -07:00
Waynn Lue
54b83566cc fix stringify_keys destructive behavior for most FormTagHelper functions
add four new tests to verify that the other three methods that called stringify_keys! are fixed. verified that the tests break in master without the code patch. Closes #2355
2011-08-03 20:53:55 -07:00
Jon Leighton
f000d4e5fa Quote these dates to prevent intermittent test failure. Suppose local time is 00:50 GMT+1. Without the quoting, the YAML parser would parse this as 00:50 UTC, into the local time of 01:50 GMT+1. Then, it would get written into the database in local time as 01:50. When it came back out the UTC date from the database and the UTC date of two weeks ago would be compared. The former would be 23:50, and the latter would be 00:50, so the two dates would differ, causing the assertion to fail. Quoting it prevents the YAML parser from getting involved. 2011-08-04 00:38:27 +01:00
Santiago Pastorino
7d4321711e Fix a bit precompile and lazy compile comments 2011-08-03 21:05:36 -03:00
Aaron Patterson
171881f610 make assert_difference error message not suck 2011-08-03 16:55:00 -07:00
Santiago Pastorino
cc9ed15785 Merge pull request #2413 from artemk/master
accept hash of options to recreate database for postgres adapter
2011-08-03 15:34:11 -07:00
Santiago Pastorino
bf5d1d4662 Don't require assets group in production by default, you can change this default in the application.rb anyways 2011-08-03 19:20:08 -03:00
artemk
b386951e42 accept option for recreate db for postgres (same as mysql now) 2011-08-04 00:34:13 +03:00
Santiago Pastorino
8962e96e39 This dep is already defined in activerecord.gemspec 2011-08-03 18:15:14 -03:00
Aaron Patterson
86b7d83f1c initializing @open_transactions in the initialize method 2011-08-03 08:57:52 -07:00
Arun Agrawal
3c7b29da1b Test added to check mass_assignment_sanitizer is not present if --skip-active-record provided. 2011-08-03 20:14:50 +05:30
Aaron Patterson
3a29cc3412 add a migrate class method and delegate to the new instance 2011-08-02 20:01:38 -07:00
Christopher Meiklejohn
43fc814074 Ensure that .up and .down work as well. 2011-08-02 18:57:34 -07:00
Christopher Meiklejohn
74d7bfb200 Support backwards compatible interface for migration down/up with rails 3.0.x. 2011-08-02 18:55:59 -07:00
Aaron Patterson
3a4dc9d34c use File.directory? as Dir.exists? is only 1.9.2+ 2011-08-01 17:29:03 -07:00
Santiago Pastorino
6dda216715 Merge pull request #2324 from zenapsis/3-1-stable
Rails 3.1 throws a Errno::ENOTDIR if files are put in assets directories
2011-08-01 16:33:27 -03:00
Santiago Pastorino
6e701e8735 Merge pull request #2393 from bdurand/fix_cache_read_multi
Fix ArgumentError in ActiveSupport::Cache::CacheStore.read_multi
2011-08-01 10:58:48 -07:00
Brian Durand
fec4c5ad76 Pass options in ActiveSupport::Cache::CacheStore#read_multi through to the delete_entry call. 2011-08-01 12:05:29 -05:00
Santiago Pastorino
5c26f56b17 Merge pull request #2389 from dmitriy-kiriyenko/remove_unnecessary_require_in_delegation
Remove unnecessary require (happened after fcbde454f6)
2011-08-01 08:32:06 -07:00
Dmitriy Kiriyenko
6244a53a07 Remove unnecessary require (happened after fcbde454f6) 2011-08-01 18:00:41 +03:00
José Valim
6b3af028ac Merge pull request #2385 from bogdan/test_default_sanitizer2
MassAssignmentProtection: consider 'id' insensetive in StrictSanitizer
2011-08-01 04:50:06 -07:00
thoefer
860202e8b2 Fix the issue where default_url_options is being cached on test cases. Closes #1872. Closes #2031.
Signed-off-by: José Valim <jose.valim@gmail.com>
2011-08-01 11:49:24 +02:00
José Valim
dc8773b19f Rename new method to_path to to_partial_path to avoid conflicts with File#to_path and similar. 2011-08-01 11:42:00 +02:00
Santiago Pastorino
d701b3fa47 Merge pull request #2379 from arunagw/extra_require_removal
Removing extra requires from the test. Already loaded in abstract_unit.
2011-07-31 11:50:52 -07:00
Santiago Pastorino
0fd7857841 Merge pull request #2377 from castlerock/remove_require
remove extra require for 'active_support/dependencies' as it is required
2011-07-31 11:49:22 -07:00
Arun Agrawal
ec7457ed2a Removing extra requires from the test. Already loaded in abstract_unit. 2011-07-31 23:36:21 +05:30
Franck Verrot
325fdfc928 Remove warnings by calling remove_method 2011-07-31 20:05:58 +02:00
Vishnu Atrai
070513016f remove extra require for 'active_support/dependencies' as it is required in abstract_unit.rb 2011-07-31 23:12:28 +05:30
Santiago Pastorino
82061671dc Merge pull request #2370 from castlerock/remove_duplicate_require
remove extra require for 'stringio' as it is required in helper.rb
2011-07-31 09:51:43 -07:00
José Valim
3c4c281ed0 Merge pull request #2375 from vijaydev/rakeaboutfix
Fixes #2368. rake about not showing a few properties
2011-07-31 09:23:04 -07:00
Vijay Dev
040f65b091 fixes #2368. rake about not showing the middleware, db adapter and db schema version 2011-07-31 21:39:10 +05:30
Jon Leighton
e022c95eee Merge pull request #2371 from bradediger/issue-2346
remove_possible_method: test if method exists
2011-07-31 07:28:50 -07:00
Brad Ediger
7f88539087 remove_possible_method: test if method exists
This speeds up remove_possible_method substantially since it doesn't
have to rescue a NameError in the common case.

Closes #2346.
2011-07-31 08:51:48 -05:00
Vishnu Atrai
624c4571fd remove extra require for 'stringio' as it is required in helper.rb 2011-07-31 18:05:05 +05:30
José Valim
779d78d591 Merge pull request #2358 from arunagw/test_fix_187_skip
skiping magic comment test for < 1.9
2011-07-31 04:25:25 -07:00
Santiago Pastorino
853ca2e489 Merge pull request #2345 from castlerock/plugin_new_generator_more_default_file
Covering more files in test for plugin new generator.
2011-07-30 16:01:59 -07:00
Arun Agrawal
329409decd magic comment test only if encoding_aware?. 2011-07-30 23:46:26 +05:30
José Valim
4c85c4ed95 Merge pull request #2364 from bcardarella/resolve_undefined_instance_attributes_instance_variable
Resolve warnings by instantizing @attrubtes as nil
2011-07-30 09:11:19 -07:00
Brian Cardarella
e7330f3d4f Resolve warnings by instantizing @attrubtes as nil 2011-07-30 12:08:26 -04:00
Santiago Pastorino
2b925e8201 Merge pull request #2354 from waynn/patch-1
remove redundant calls to stringify_keys
2011-07-29 17:39:20 -07:00
Waynn Lue
1f270e80e6 remove redundant calls to stringify_keys 2011-07-29 17:07:27 -07:00
Aaron Patterson
ae1e70cf80 Merge pull request #2353 from bdurand/no_freeze_cache_entries
Change ActiveSupport::Cache behavior to not return frozen objects
2011-07-29 16:20:21 -07:00
Brian Durand
a263f37797 Change ActiveSupport::Cache behavior to always return duplicate objects instead of frozen objects. 2011-07-29 17:27:45 -05:00
Aaron Patterson
ea7f50863d delay backtrace scrubbing until we actually raise an exception. fixes #1936 2011-07-29 14:38:57 -07:00
Aaron Patterson
cea06a8e3f default writing the schema file as utf-8 2011-07-29 12:28:12 -07:00
Aaron Patterson
3d6e187255 dump IO encoding value along with schema.rb so the file can be reloaded. fixes #1592 2011-07-29 12:23:37 -07:00
Santiago Pastorino
455e9e748d Merge pull request #2342 from bcardarella/remove_controller_instance_variable_warnings_from_sprocket_helper_test
Resolve "instance variable @controller not initialized" warnings for sprocket_helper_test
2011-07-29 10:48:27 -07:00
Vishnu Atrai
6969638020 Covering more files in test for plugin new generator. 2011-07-29 23:05:40 +05:30
Aaron Patterson
3e8fe1d898 Merge pull request #2344 from bcardarella/resolve_warning_for_capture_helper_test
Reset @dirty to false when slicing an instance of SafeBuffer
2011-07-29 10:32:24 -07:00
José Valim
bbe1b1afce Merge pull request #2343 from arunagw/test_add_for_plugin_new_gen
Test add for plugin new generator generate mailer
2011-07-29 10:11:43 -07:00
Brian Cardarella
6ef1079e0e Reset @dirty to false when slicing an instance of SafeBuffer 2011-07-29 13:10:31 -04:00
Arun Agrawal
4fe2c99052 Test add for plugin new generator generate mailer 2011-07-29 22:06:36 +05:30
Brian Cardarella
1c94ba0332 Instead of removing the instance variable just set it to nil, resolves the warnings because of a missing instance variable 2011-07-29 12:08:35 -04:00
José Valim
270fa63e9b Merge pull request #2339 from dgeb/mailers-in-plugins
Ensure that app/mailers gets created in new plugins (#2287 brought into master)
2011-07-29 07:21:16 -07:00
Dan Gebhardt
d8e62a93e3 Include empty app/mailers directory in mountable and full plugins 2011-07-29 08:15:44 -04:00
Santiago Pastorino
54463592cb Tidy up 2011-07-28 16:56:57 -03:00
Vijay Dev
b57773c738 document meta method 2011-07-29 01:13:58 +05:30
José Valim
caacf85673 Merge pull request #2327 from cesario/patch-1
We don't need to require erb here.
2011-07-28 11:24:08 -07:00
José Valim
b295ea1362 Merge pull request #2330 from thedarkone/resources-router-fix
Inline resources router fix
2011-07-28 11:10:23 -07:00
thedarkone
a5f57a7ef2 Make use of the inherited initializer. 2011-07-28 20:02:21 +02:00
thedarkone
4d4d2179f6 There is no need to be destructive with the passed-in options.
This fixes a bug that is caused by Resource/SingletonResource mangling resource options when using inline "multi"-resource declarations.
2011-07-28 20:00:48 +02:00
Xavier Noria
adce9b4ca3 Merge pull request #2329 from nertzy/master
Give attribution to Peter Jaros for the patch we paired on
2011-07-28 10:12:51 -07:00
ejy
9e39fd9985 Removed trailing slash of 'Download and installation' Github URL as per convention 2011-07-28 18:40:35 +02:00
Grant Hutchins
b407034c9d Give attribution to Peter Jaros for the patch we paired on. 2011-07-28 13:38:28 -03:00
Santiago Pastorino
84763047a0 Merge pull request #2326 from castlerock/plugin_generator_fix
pluging generator test fix
2011-07-28 08:47:04 -07:00
Franck Verrot
ad0772f268 We don't need to require erb here. 2011-07-28 18:45:43 +03:00
Vishnu Atrai
5a4e8f5514 pluging generator test fix 2011-07-28 21:14:29 +05:30
Santiago Pastorino
d10f268d20 Tidy up a bit plugin new gemspec 2011-07-28 11:48:21 -03:00
Santiago Pastorino
5ab9132c19 Merge pull request #2295 from dgeb/mo-better-plugins
Improve dependency management and gemspec file for plugins
2011-07-28 07:44:10 -07:00
Dan Gebhardt
a74e4736f9 Moved dependencies from Gemfile to gemspec to eliminate redundant declarations. 2011-07-28 09:58:27 -04:00
Dan Gebhardt
d9b59c341c Extracted version from gemspec and placed it in its own file. This is consistent with the approach taken by "bundle gem", and is expected by gems such as svenfuchs/gem-release which can be used to bump / tag versions of gems. 2011-07-28 09:47:21 -04:00
Dan Gebhardt
5515a18aa5 Expanded meta-data in gemspec to include author, email, etc.; Defaults include "TODO" to prevent gems from being built without review. 2011-07-28 09:46:13 -04:00
Pete Campbell
6dc749596c Explicitly included hashes in sentence regarding SQL-injection-safe forms 2011-07-28 09:44:51 -04:00
Jon Leighton
971a74b81f Revert "Merge pull request #2309 from smasry/master"
This reverts commit 9d396ee819, reversing
changes made to fa2bfd832c.

Reason: the change broke the build.
2011-07-28 13:14:11 +01:00
Bogdan Gusiev
b93a918337 MassAssignmentProtection: consider 'id' insensetive in StrictSanitizer
In order to use StrictSanitizer in test mode
Consider :id as not sensetive attribute that can be filtered from
mass assignement without exception.
2011-07-28 11:56:08 +03:00
José Valim
30dae273c8 Update CHANGELOG. 2011-07-28 10:05:17 +02:00
José Valim
d5eeacc95f Move the cache to a nested hash which performs better than a hash with array as keys. 2011-07-28 10:01:55 +02:00
José Valim
dee8115539 Rename class method to_path to _to_path and make it explicit that it is an internal method. 2011-07-28 09:56:42 +02:00
José Valim
1b7db58a06 Merge pull request #2034 from Casecommons/to_path
Allow ActiveModel-compatible instances to define their own partial paths
2011-07-28 00:50:07 -07:00
Alberto Perdomo
5a22f05522 Association and Callbacks guide: Added section on shortcut syntax 'validates'. 2011-07-28 00:51:17 +01:00
Joshua Peek
8248052ee7 Make Rails.application.assets available in initializers 2011-07-27 15:29:36 -05:00
Xavier Noria
5eeae68657 contrib app minor tweak 2011-07-27 13:25:08 -07:00
Aaron Patterson
9d396ee819 Merge pull request #2309 from smasry/master
Unmangaling reverse_sql_order when function is used
2011-07-27 10:26:39 -07:00
Samer Masry
18d307ed94 Reverse order fix when using function for ActiveRecord::QueryMethods Fixes #1697 2011-07-27 10:17:25 -07:00
Santiago Pastorino
fa2bfd832c Merge pull request #2305 from thedarkone/errors-include
Improve AM::Errors#include?
2011-07-27 09:44:15 -07:00
thedarkone
efe4cbe5f2 Handle the empty array correctly. 2011-07-27 18:07:47 +02:00
Christos Zisopoulos
8faeed1d71 Improve performance and memory usage for options_for_select with Ruby 1.8.7 2011-07-27 08:37:10 -07:00
Jon Leighton
091e767c2d Merge pull request #1969 from dmitriy-kiriyenko/calculations_with_having_on_select
ActiveRecord calculation fail when having contains conditions based on select values
2011-07-27 07:02:04 -07:00
Dmitriy Kiriyenko
9a298a162c Fixed failing query when performing calculation with having based on select. 2011-07-27 16:48:15 +03:00
Jon Leighton
24f0a872e6 Add a proxy_association method to association proxies, which can be called by association extensions to access information about the association. This replaces proxy_owner etc with proxy_association.owner. 2011-07-27 12:36:00 +01:00
Hendy Tanata
b0a91f2c5e Fix two spaces between sententes on README.rdoc. 2011-07-27 17:30:53 +07:00
Xavier Noria
46b8261830 Merge pull request #2296 from lsylvester/typo
fix some typos
2011-07-27 01:11:31 -07:00
Lachlan Sylvester
7e13284645 fix some types in schema_test.rb 2011-07-27 17:01:50 +10:00
Aaron Patterson
0b987042bf simplify conditionals by assuming hash values will never be false 2011-07-26 17:49:47 -07:00
Aaron Patterson
7868cf8a65 use regular ruby rather than clever ruby 2011-07-26 17:45:34 -07:00
Aaron Patterson
ba43b9bf5f fixing wildcard path matching when wildcard is inside parenthesis 2011-07-26 17:33:22 -07:00
Aaron Patterson
e4a7b23d38 Merge pull request #2291 from jdelStrother/load_missing_constant
Replace unnecessary regexp in Dependencies#load_missing_constant
2011-07-26 16:19:48 -07:00
Jonathan del Strother
43ef635b95 Replace unnecessary regexp in Dependencies#load_missing_constant 2011-07-27 00:06:19 +01:00
Santiago Pastorino
6089ecf931 Merge pull request #2279 from jdelStrother/load_missing_constant
Constantize a regexp in Dependencies#load_missing_constant
2011-07-26 15:23:11 -07:00
Santiago Pastorino
b4efff4bac Remove blank line 2011-07-26 19:20:45 -03:00
Santiago Pastorino
77e67f419c Merge pull request #2273 from thoefer/refactor
refactored 'assert_redirected_to'
2011-07-26 15:18:39 -07:00
Santiago Pastorino
17d0efb679 Remove cruise files 2011-07-26 18:11:03 -03:00
Aaron Patterson
ef89a70540 Merge pull request #2095 from dgeb/issue-2094
Fixes overriding of options[:html][:remote] in form_for() (Issue #2094)
2011-07-26 13:50:20 -07:00
Santiago Pastorino
d482cf8bfa Merge pull request #2285 from castlerock/remove_warnings_ruby193
remove unused variables warnings removed
2011-07-26 12:33:34 -07:00
Santiago Pastorino
49ebd01d19 Merge pull request #2284 from joshk/patch-6
enable Travis CI irc notifications to #rails-contrib on irc.freenode.org
2011-07-26 12:32:39 -07:00
Vishnu Atrai
db34a65277 remove unused variables warnings removed 2011-07-26 23:53:54 +05:30
Josh Kalderimis
5a5d7ba973 enable Travis CI irc notifications to #rails-contrib on irc.freenode.org 2011-07-26 18:17:58 +00:00
Aaron Patterson
0868461ee0 Merge pull request #2283 from castlerock/remove_warnings_ruby193
remove deprication warning: ambiguous first argument; put parentheses or
2011-07-26 11:14:23 -07:00
Vishnu Atrai
1e69f0b84a remove deprication warning: ambiguous first argument; put parentheses or even spaces 2011-07-26 23:39:17 +05:30
Aaron Patterson
64807b964f fixing tests on ruby trunk 2011-07-26 11:02:41 -07:00
Aaron Patterson
d4246e5bb3 fixing whitespace errors 2011-07-26 11:00:33 -07:00
Santiago Pastorino
af6abc6404 Merge pull request #2281 from castlerock/remove_warnings_ruby193
remove deprication warning for ruby 1.9.3-head for unused variable
2011-07-26 10:42:15 -07:00
Vishnu Atrai
cf3f1c9ba8 remove deprication warning for ruby 1.9.3-head for unused variables 2011-07-26 22:33:23 +05:30
Jonathan del Strother
f17ea60f98 Constantize a regexp in Dependencies#load_missing_constant 2011-07-26 16:10:55 +01:00
José Valim
bdbf97c23b Merge pull request #2277 from dmathieu/fix_actionpack_tests
Fix actionpack's test suite
2011-07-26 08:02:45 -07:00
Damien Mathieu
945f0c82af use sprocket's append_path and assert_match 2011-07-26 16:59:15 +02:00
Piotr Sarnacki
14c6fca9cd Revert "allow select to have multiple arguments"
This reverts commit 04cc446d17.

I reverted it because apparently we want to use: select([:a, :b])
instead of select(:a, :b), but there was no tests for that form.
2011-07-26 16:15:12 +02:00
Vijay Dev
fa159d3176 move the note after the scaffold files listing 2011-07-26 19:35:16 +05:30
Piotr Sarnacki
89f3d8a886 Merge pull request #2271 from slawosz/enhance_select_method_api
allow select to have multiple arguments ie. Post.select(:id,:name,:author)
2011-07-26 06:33:54 -07:00
Santiago Pastorino
cfd086a302 Merge pull request #2272 from cesario/fix_relations_test
Simplify the test by using id and name.
2011-07-26 06:25:05 -07:00
Sławosz Sławiński
04cc446d17 allow select to have multiple arguments 2011-07-26 14:57:47 +02:00
thoefer
3bfcf5ffc8 refactored 'assert_redirected_to': local call to validate_request! will be called in assert_response already. changed names of local variables in order to recognize the semantics a bit easier. 2011-07-26 11:42:53 +02:00
Franck Verrot
41902e6932 Simplify the test by using id and name. id will be the only real sort criteria in any case as it's unique. 2011-07-26 11:36:18 +02:00
Santiago Pastorino
b4e577945b use_sprockets is not used anymore 2011-07-26 01:00:00 -03:00
Santiago Pastorino
155bb7c75d Bump sprockets up 2011-07-26 00:42:31 -03:00
Santiago Pastorino
4d13e90531 Check that Rack::Sendfile is not included unless config.action_dispatch.x_sendfile_header is set 2011-07-26 00:19:45 -03:00
Santiago Pastorino
36ab1cd293 Bump rack up. Closes #2107 2011-07-25 23:03:30 -03:00
José Valim
647eeb1881 Merge pull request #2262 from sferik/format_true
Allow a route to have :format => true
2011-07-25 15:51:43 -07:00
Xavier Noria
cb02d10df2 sync the getting started guide with master 2011-07-25 15:10:13 -07:00
Santiago Pastorino
cb85d70d61 Remove unused use_sprockets config 2011-07-25 19:07:39 -03:00
Santiago Pastorino
ecd4f0b6ff Don't use Rack::Sendfile middleware if x_sendfile_header is not present 2011-07-25 18:55:13 -03:00
Xavier Noria
703d0e05c0 Merge branch 'master' of git://github.com/lifo/docrails 2011-07-25 14:20:01 -07:00
Erik Michaels-Ober
c17254319b Add documentation for :format => true 2011-07-25 14:13:26 -07:00
Xavier Noria
598eab90ff let TIP and friends handle a multiline paragraph
Normally I would have done this in master, but there was already
a guide with wrapped content, so worked here. I am going to
cross-merge now.
2011-07-25 14:12:12 -07:00
Grant Hutchins & Peter Jaros
bf812074fd Let ActiveModel instances define partial paths.
Deprecate ActiveModel::Name#partial_path. Now you
should call #to_path directly on ActiveModel
instances.
2011-07-25 16:05:24 -04:00
Erik Michaels-Ober
b9c9142603 Allow a route to have :format => true
When format is true, it is mandatory (as opposed to :format => false).
This is currently not possible with resource routes, which automatically
make format optional by default.
2011-07-25 11:37:25 -07:00
Vijay Dev
50ca6f06c7 Revert "aligment issues fixed"
This reverts commit 6f29b356c1.

Reason: Changelogs are not meant to be changed in docrails.
2011-07-25 23:41:28 +05:30
JudeArasu
6f29b356c1 aligment issues fixed 2011-07-25 23:26:36 +05:30
Santiago Pastorino
8e0061128e Merge pull request #2245 from davidtrogers/constraints_block_passed_to_following_routes_in_same_scope
Memoizing @blocks & disposing of constraints options properly
2011-07-25 10:32:31 -07:00
Dave Rogers
4dc42f5353 Ensure the constraints block is only applied to the correct route
addresses issue #1907 - any routes that follow a route with a constraints
  block are inheriting the previous route's constraints.
2011-07-25 09:59:53 -07:00
Glenn Gillen
4605b5639d Simplify the way default DATABASE_URL works. 2011-07-25 09:08:08 -07:00
Aaron Patterson
36fd3fdf46 no need for an anonymous class on every setup call 2011-07-25 09:07:46 -07:00
José Valim
b033a24814 Merge pull request #2258 from thedarkone/no-file-stat
Use shorter class-level File methods instead of going through File.stat
2011-07-25 08:13:21 -07:00
thedarkone
624b118616 Use shorter class-level File methods instead of going through File.stat. 2011-07-25 17:02:28 +02:00
Santiago Pastorino
64affc9384 Merge pull request #2236 from cldwalker/after_initialize
Fix after_initialize and Base.create edge case
2011-07-25 07:20:38 -07:00
José Valim
14c0f0ee12 Merge pull request #2254 from dmathieu/test_name
provide more explicit test names
2011-07-25 06:52:40 -07:00
Damien Mathieu
3348ea6254 provide more explicit test names 2011-07-25 15:25:22 +02:00
José Valim
451f63b42e Merge pull request #2247 from dmathieu/test_precompile_caching
Add test checking that precompiling assets performs caching
2011-07-25 05:36:00 -07:00
Vijay Dev
203a85f191 Revert "Add in a tip about opening two command prompt windows"
This reverts commit 1e5fa59d13.

Reason: It's somewhat a grey area. We don't really want to tell the
users how they want to use the terminal.
2011-07-25 17:39:17 +05:30
Vijay Dev
60c505dc79 Revert "Update the TIP formatter to handle multiline tips"
This reverts commit e3dbe66e19.

Reason: Code changes are not allowed in docrails.
2011-07-25 17:37:01 +05:30
José Valim
a850cf7058 Merge pull request #2251 from thedarkone/update-all-order
Bring back the ability to provide :order for update_all
2011-07-25 05:03:28 -07:00
José Valim
dffd920432 Merge pull request #2252 from thedarkone/polymorphic-url-helpers
Make polymorphic_url calls go through application helpers again.
2011-07-25 05:02:00 -07:00
thedarkone
036f77574d Make polymorphic_url calls go through application helpers again.
This brings back the ability to overwrite/extend url generating methods in application heleprs.
2011-07-25 13:43:02 +02:00
thedarkone
10863580aa Bring back the ability to provide :order for update_all. 2011-07-25 13:33:44 +02:00
Damien Mathieu
07c9ff0b4a add test checking that precompiling assets performs caching 2011-07-25 10:32:03 +02:00
Elliot Winkler
f330e6af34 Improve ch. 1 of the Form Helpers guide 2011-07-24 17:09:47 -06:00
Jason Noble & Ralph Shnelvar
1e5fa59d13 Add in a tip about opening two command prompt windows 2011-07-24 16:37:28 -06:00
Jason Noble & Ralph Shnelvar
0076a6fce2 Fix two spaces after end of sentence. 2011-07-24 16:37:27 -06:00
Jason Noble & Ralph Shnelvar
1ca4990a10 Extend description of rails generate scaffold and what it's options accomplish 2011-07-24 16:37:27 -06:00
Michael Lavrisha
62f865db0b Merge branch 'master' of github.com:lifo/docrails 2011-07-24 16:36:52 -06:00
Michael Lavrisha
5cece57c93 Simpler brief explanation of Rails and REST 2011-07-24 16:36:23 -06:00
Michael Lavrisha
e3dbe66e19 Update the TIP formatter to handle multiline tips
- includes 3 tests
2011-07-24 16:17:40 -06:00
Mike Howard
6734bc98e7 Updated migrations.textile to clarify Using Models in Your Migrations
Rewrote entire section including example code, error message, and work
around.
2011-07-24 16:11:06 -06:00
Jason Noble & Ralph Shnelvar
2f7ea1907d Make the rails not found tip more explanatory. 2011-07-24 16:07:41 -06:00
Jason Noble & Ralph Shnelvar
5ee349c711 Updated rails_welcome.png to latest Rails welcome page. 2011-07-24 16:01:51 -06:00
Aaron Patterson
02691d3516 Merge pull request #2238 from cesario/order-with-extra-spaces
Ordering with extra spaces was raising a SQL exception
2011-07-24 14:40:15 -07:00
Jason Noble & Ralph Shnelvar
fe5cb7c521 Update wording of TIP about --database option for rails new 2011-07-24 15:39:22 -06:00
Jason Noble & Ralph Shnelvar
715c128e6a Remove "bundle install" section, as rails new ______ runs bundle install for you 2011-07-24 15:34:14 -06:00
John
dd8a485170 Fixed Typo 2011-07-24 17:11:29 -04:00
Jason Noble & Ralph Shnelvar
72e06dc7a0 Fix TIP formatting issue 2011-07-24 15:04:12 -06:00
Xavier Noria
12034516e2 Merge pull request #2243 from dmathieu/comment
Help the next guy with explanations - See bb3b3e306
2011-07-24 14:02:36 -07:00
Jason Noble & Ralph Shnelvar
e99a0b62ec Add a note about the fact that the Windows prompt will look different than the linux/osx prompt 2011-07-24 14:51:48 -06:00
Andrew White
0599e16dd9 Use top level Rails constant 2011-07-24 21:48:56 +01:00
Michael Lavrisha
4b189bd336 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	railties/guides/source/getting_started.textile
2011-07-24 14:40:18 -06:00
Jason Noble & Ralph Shnelvar
b084836339 Reformatted to 80 chars. 2011-07-24 14:37:24 -06:00
Michael Lavrisha
073609f5e5 Merge branch 'master' of github.com:lifo/docrails
Conflicts:
	railties/guides/source/getting_started.textile
2011-07-24 14:37:22 -06:00
Gabriel Horner
f5e4d13270 use existing model for testing Base.create with #after_initialize 2011-07-24 16:36:06 -04:00
Michael Lavrisha
06b59e39a1 Rewrite apart of the REST section to be in the present tense 2011-07-24 14:34:34 -06:00
Jason Noble & Ralph Shnelvar
3ba30e6650 Wrapped text content to 120 chars 2011-07-24 14:04:58 -06:00
Michael Lavrisha
941fae2cbb Provide consistant indentation for the example code 2011-07-24 13:59:52 -06:00
Ben Marini
c02288e6fd Fix example code for #validates_with instance method 2011-07-24 12:13:23 -07:00
Xavier Noria
4bb0a8bcbd Merge branch 'master' of git://github.com/lifo/docrails 2011-07-24 21:02:51 +02:00
Xavier Noria
0626668374 little details seen while reviewing 2011-07-24 21:01:53 +02:00
Damien Mathieu
ee56f7b8df help the next guy with explanations - See bb3b3e306 2011-07-24 20:52:08 +02:00
Jason Noble & Ralph Shnelvar
48e85d8b8c Moved ActionController, ActionView and ActionDispatch sections under ActionPack 2011-07-24 12:50:23 -06:00
Jason Noble & Ralph Shnelvar
5e8263b687 Add link to the Layouts and Rendering guide to explain more on view templates 2011-07-24 12:29:15 -06:00
Jason Noble & Ralph Shnelvar
f04725f3ba Modified the content based on vijaydev's comment
3eb99aab77 (commitcomment-493737)
2011-07-24 12:24:00 -06:00
Jason Noble & Ralph Shnelvar
8e44ff63b2 Update guide to be based on Rails 3.1. 2011-07-24 12:15:12 -06:00
Jason Noble & Ralph Shnelvar
25bcca139f Added link to the RubyGems User's Guide 2011-07-24 12:15:11 -06:00
Jason Noble & Ralph Shnelvar
bb746e3362 Added explanation to Components of Rails to help users not get hung up on details 2011-07-24 12:15:11 -06:00
Ken Ip
12955a393d Merge branch 'master' of https://github.com/lifo/docrails 2011-07-24 14:13:06 -04:00
Ken Ip
ce66fc047e Update "Getting Started" for Rails 3.1
Add additional files generated by rails 3.1 generator.
2011-07-24 14:12:15 -04:00
Jason Noble & Ralph Shnelvar
3eb99aab77 Added some context for rack apps, linked to the Rails on Rack guide. 2011-07-24 11:46:02 -06:00
Mike Howard
5712e7aa47 Clarified notes in 3.2 Creating the Blog Application
Changed descriptino of Gemfile to add reference to Bundler
Changed description of README to add 'You should edit ...'
Changed description of Rakefile to reflect dynamic nature of Rakefile
and point to app/lib/tasks/ as the place to add app-specific rake tasks.
2011-07-24 11:39:07 -06:00
Mike Howard
25850d17ac Changed wording of paragraph 2.1.1 Models to clarify table/model
relationship.

changed wording 'one table ... corresponds to one model' to 'each table
...'
2011-07-24 10:54:19 -06:00
Santiago Pastorino
97716e6273 Merge pull request #1186 from mitijain123/duplicable_test
Duplicable test is looking fine now.
2011-07-24 08:20:17 -07:00
Mitesh Jain
2c90568a06 Duplicable test is looking fine now. 2011-07-24 19:43:42 +05:30
Santiago Pastorino
8a9cacba6d Merge pull request #2239 from castlerock/scaffold_jquery
fixing broken test as jquery-rails is included in application.js
2011-07-24 06:55:25 -07:00
Mitesh Jain
fe37b48f28 Bringing back the jquery-rails. One test is dependent. 2011-07-24 19:18:49 +05:30
Xavier Noria
3665ffda83 Revert "Tests now require MySQL2 adapter in order to run"
Reason: Setting up MySQL and Postgres needs installing servers
and libraries that perhaps you don't need in your machine. We
think fixing a bug in Active Support without running the suite
of Active Record for all possible drivers is OK. That's why
we explain first --without db, and after that we cover AR
specifically. mysql2 is no different than mysql or pg in that
sense.

This reverts commit 50d5e0f7e8.
2011-07-24 11:40:06 +02:00
Oemuer Oezkir
ee5cfdf120 Missed a few instances of British English spelling in the last commit
oh and obviously I meant according to Webster, not Weber
2011-07-24 10:40:40 +00:00
Oemuer Oezkir
71d18ce48e Changed a few instances of of words in the API docs written in British English to
American English(according to Weber)
2011-07-24 10:21:42 +00:00
Franck Verrot
77bb0b79f2 Ordering with extra spaces was raising a SQL exception 2011-07-24 08:18:04 +02:00
Gabriel Horner
6e3c0a5d9a simplify and be more explicit about create and after_initialize tests 2011-07-24 00:31:37 -04:00
Les Fletcher
f956759f8a fix after_initialize edge case (close #2074 and close #2175)
fix behavior when after_initialize is defined and a block is passed to Base.create
2011-07-24 00:31:28 -04:00
Aaron Patterson
d33eb07543 Merge pull request #2233 from gramos/fix-issue-1951-master
Fix issue 1951 master Namespaced model partial_path is wrong in namespaced controllers
2011-07-23 21:00:11 -07:00
Aaron Patterson
d89a33d162 just use normal ruby for stubbing 2011-07-23 20:55:29 -07:00
Gaston Ramos
dc1b0fd957 - added ActionView::PartialRenderer#merge_path_into_partial(path, partial)
fix issues/1951
2011-07-24 00:54:58 -03:00
Gaston Ramos
7621d131d2 - added test case for issue:
https://github.com/rails/rails/issues/1951
  Namespaced model partial_path is wrong in namespaced controllers
2011-07-24 00:54:45 -03:00
Aaron Patterson
a14f4566dd Merge pull request #2185 from castlerock/lazy_load_abstract_adapter
lazy load ConnectionAdapters remove require.
2011-07-23 20:51:43 -07:00
Aaron Patterson
9327b4de58 Merge pull request #2228 from Empact/helper_tags_in_mailers
Simple fix to the NoMethodError noted in #2177.
2011-07-23 20:40:12 -07:00
Aaron Patterson
cdc4274931 simplify singleton_class? method 2011-07-23 20:02:03 -07:00
Aaron Patterson
06c52d6ac9 Merge pull request #2226 from dmathieu/perform_caching
rake assets:precompile should always perform caching - Closes #2199
2011-07-23 17:50:43 -07:00
Ben Woosley
1f89898175 Simple fix to the NoMethodError noted in #2177.
Unfortunately #respond_to?(:controller) won't work as suggested, nor will respond_to?(:params), as #controller is present and #params is delegated to #controller. #delegate makes respond_to? return true regardless whether the target responds to it.
2011-07-23 17:31:48 -07:00
Damien Mathieu
bb3b3e3062 rake assets:precompile should always perform caching - Closes #2199 2011-07-24 01:32:14 +02:00
Dieter Komendera
8ae7008ac3 Fix fragment cache helper regression on cache miss introduced with 03d01ec7.
Contains following patches cherry-picked from @lhahne's 3-0-stable branch:

* Added tests for the output_buffer returned by CacheHelper (c476a6b)
The output_buffer returned by CacheHelper should be html_safe if the original buffer is html_safe.

* made sure that the possible new output_buffer created by CacheHelper is of the same type as the original (39a4f67)
2011-07-23 23:41:33 +02:00
Santiago Pastorino
410e75419d Remove unused gems from Gemfile 2011-07-23 18:38:42 -03:00
Santiago Pastorino
e178fcbd01 Merge pull request #2221 from grzuy/master
Fix ActiveSupport::Cache::FileStore#file_path_key does not work if initialized with Pathname
2011-07-23 14:05:15 -07:00
Gonzalo Rodriguez
49b0f9e395 Fix ActiveSupport::Cache::FileStore#file_path_key does not work if initialized with Pathname
Port from 3-1-stable
2011-07-23 17:57:04 -03:00
Aaron Patterson
c3346b31c9 Merge pull request #2218 from guilleiguaran/avoid-map-chaining
Remove unneccesary map chaining
2011-07-23 13:24:24 -07:00
Guillermo Iguaran
3fe32c3554 Remove unneccesary map chaining 2011-07-23 15:21:39 -05:00
Aaron Patterson
abe61054af Merge pull request #2217 from marcandre/fix_enumerable
Fix enumerable
2011-07-23 13:05:12 -07:00
Marc-Andre Lafortune
f061ffd9f4 Trivial optimization for Enumerable#each_with_object 2011-07-23 15:52:38 -04:00
Marc-Andre Lafortune
816abecf90 Insure that Enumerable#index_by, group_by, ... return Enumerators 2011-07-23 15:52:37 -04:00
Marc-Andre Lafortune
c785038839 Make Enumerable#many? iterate only over what is necessary 2011-07-23 15:52:37 -04:00
Marc-Andre Lafortune
a96e824c53 Make Enumerable#many? not rely on #size 2011-07-23 15:52:37 -04:00
Marc-Andre Lafortune
f6ac022a6f Test using generic Enumerables instead of arrays. 2011-07-23 15:52:37 -04:00
Marc-Andre Lafortune
0b5386f422 Make tests more precise 2011-07-23 15:52:37 -04:00
Carol Nichols
9b9cf92768 Changing Textile emphasis underscores to em tags; the link with underscores that follows is causing the emphasis underscores to be parsed incorrectly.
This appears to be a bug with RedCloth; parsing with official Textile creates the HTML that I expect. I have filed ticket # 226 on RedCloth's lighthouse project and I will attempt to fix the problem with RedCloth.

This commit is a workaround for the RedCloth bug that will give this guide the right formatting.
2011-07-23 15:27:07 -04:00
Xavier Noria
2115068476 registers the recent change to date multiparameter handling in the CHANGELOG 2011-07-23 20:31:41 +02:00
Xavier Noria
a62f450661 Merge pull request #2086 from amatsuda/date_multiparameter_nil
convert multiple Date parameters into a nil if any of its bits were blank
2011-07-23 11:20:12 -07:00
Evan Farrar
66b4d11236 Changed several instances of British English to be American English 2011-07-23 13:57:56 -04:00
Evan Farrar
662a71b09f Replaced ‘ with ' in the guides. 2011-07-23 12:23:58 -04:00
Joe Fiorini
50d5e0f7e8 Tests now require MySQL2 adapter in order to run 2011-07-23 12:15:58 -04:00
gnagno
72df64b4e1 now the documentation reflects the actual returned value for a missing translation 2011-07-23 08:26:18 -07:00
Santiago Pastorino
35c87a139a Merge pull request #2198 from Karunakar/fixing_2168
Improve rails:template undefined LOCATION variable error message fixed
2011-07-23 08:26:16 -07:00
Raghunadh
e9f16256ba Improve rails:template undefined LOCATION variable error message fixed 2011-07-23 20:52:53 +05:30
Santiago Pastorino
7dadb6aa0a Merge pull request #2171 from arunagw/database-rake-1.9.2
This conditions is required to work with database create task. 1.9.2 is h
2011-07-23 07:58:59 -07:00
Santiago Pastorino
25ec3c86e0 Merge pull request #2193 from zhengjia/remove_ruby_prof_for_rubinius
only install ruby-prof for mri ruby
2011-07-23 07:12:51 -07:00
Santiago Pastorino
7e4cedf534 Merge pull request #2196 from arunagw/issue_713
Spliting the ouput of git ls-files for running tasks Fixes #713
2011-07-23 07:06:14 -07:00
Santiago Pastorino
fb36f3d1e4 Merge pull request #2195 from castlerock/command_line_information
Small missing information added to command description. --help also works
2011-07-23 07:04:00 -07:00
Xavier Noria
d352e0dff2 checked all .rb files in the project tree for missing magic comments, one was missing
Came with this one-liner for this:

    find . -name '*.rb' | \
    xargs chardet | \
    grep -v ascii | \
    cut -d: -f1 -s | \
    xargs -n1 ruby -0777 -ne 'puts $FILENAME if $_ !~ /#.*coding:\s*utf/i'

Welcome $_.
2011-07-23 14:50:29 +02:00
Xavier Noria
4d8aaff4ea adds a couple of missing magic comments [fixes #1374] 2011-07-23 14:15:00 +02:00
Xavier Noria
c300e13a9c Revert "notextile tag has been placed with ascii quotes"
Reason: <notextile> is an internal tag

This reverts commit 01040b5dc9.
2011-07-23 12:51:02 +02:00
Xavier Noria
ace3723d2f Merge branch 'master' of git://github.com/lifo/docrails 2011-07-23 12:15:41 +02:00
Xavier Noria
38310ab1a6 little details seen while doing a pass through what's new in docrails 2011-07-23 12:14:10 +02:00
Arun Agrawal
0fb0973248 For svn files also spilt required 2011-07-23 13:58:23 +05:30
Arun Agrawal
7d9cf9a846 Spliting the ouput of git ls-files for running tasks Fixes #713 2011-07-23 13:21:36 +05:30
Bratish Goswami
611fd7955a Small missing information added to command description. --help also works like -h. 2011-07-23 10:41:49 +05:30
Vijay Dev
2db9a7e930 minor refactor in the template guide 2011-07-23 02:21:05 +05:30
Vijay Dev
573c6e6982 document the change in edge rails which makes a more strict check on the arity of the dynamic finders 2011-07-23 01:59:46 +05:30
Vijay Dev
ccb3af4683 corrected sentences to make them consistent in command line guide 2011-07-23 01:19:24 +05:30
Vijay Dev
14b9726ecd minor corrections in caching guide 2011-07-23 01:18:37 +05:30
Xavier Noria
94978b9a46 Merge pull request #2188 from vijaydev/patch-6
Fixes typo
2011-07-22 10:06:35 -07:00
Aaron Patterson
253b472838 forgot to add this test case 2011-07-22 09:12:32 -07:00
Vijay Dev
a2778861fe Fixes typo 2011-07-22 08:41:00 -07:00
zhengjia
74eb8486da remove ruby-prof for rubinius in Gemfile 2011-07-22 07:55:48 -05:00
Vishnu Atrai
1efd88283e lazy load ConnectionAdapters remove require. 2011-07-22 17:49:24 +05:30
Aaron Patterson
5b6121aa34 use rake tasks to set the default environment variables. fixes #2126 2011-07-21 15:30:28 -07:00
Aaron Patterson
bb7e35531e removing inline source option from rdoc task. fixes #2169 2011-07-21 13:49:36 -07:00
Aaron Patterson
b744c8493b adding changelog entry for connection urls 2011-07-21 13:09:42 -07:00
Aaron Patterson
1a0b7ea3c9 adding more tests around database uri parsing 2011-07-21 12:57:05 -07:00
JudeArasu
3cafe04c81 grammatical changes 2011-07-22 00:28:24 +05:30
JudeArasu
238550f7c4 Merge branch 'master' of git@github.com:lifo/docrails 2011-07-22 00:26:31 +05:30
Aaron Patterson
f4ed975125 move around tests 2011-07-21 11:54:29 -07:00
Vishnu Atrai
dc1b207d81 alias added for rails generate guide 2011-07-22 00:05:07 +05:30
Vishnu Atrai
444e01e4af alias added for rails runner guide 2011-07-21 23:54:41 +05:30
JudeArasu
6dfed66c32 grammatical changes 2011-07-21 23:52:10 +05:30
JudeArasu
9c7a55cf11 typo change 2011-07-21 22:57:41 +05:30
Vishnu Atrai
5801f42975 fixed type 2011-07-21 10:12:29 -07:00
Igor Zubkov
dcb838e695 Merge pull request #54 from biow0lf/fix_typo
Fix typo
2011-07-21 05:04:40 -07:00
Igor Zubkov
e7a7591087 Fix typo 2011-07-21 14:58:20 +03:00
Bratish Goswami
840ca47a46 Download and installation, License and Support sections added for activemodel 2011-07-21 13:03:45 +05:30
Ray Baxter
18792069ab use the doc conventions for arguments in all cases
See 5c71a4e768 (commitcomment-485675)
2011-07-20 23:33:42 -07:00
Arun Agrawal
fbf4bee6ed This conditions is required to work with database create task. 1.9.2 is having a bug with "Calling return within begin still executes else". 2011-07-21 09:47:42 +05:30
Terence Lee
16921437a1 fix postgres connection url test 2011-07-20 16:23:31 -07:00
Glenn Gillen
1f427b5341 Add documentation for URL connection strings. 2011-07-20 16:23:31 -07:00
Glenn Gillen
16249feaab Added test for postgres connections as URL. Fixed query param parsing. 2011-07-20 16:23:31 -07:00
Glenn Gillen
89357c8f83 Provide database connection settings as a URL. 2011-07-20 16:23:31 -07:00
Aaron Patterson
22e47279bc no need to sort the values 2011-07-20 15:52:53 -07:00
Franck Verrot
8bc314b3b7 assign_nested_attributes_for_collection_association should work with Ruby 1.9 [Closes #2106]
Children attributes can be either String's or Symbol's, so let's check if the object responds to to_i.
2011-07-20 15:40:01 -07:00
Aaron Patterson
d8736b266b Revert "this fixes a brittle test in fixtures_test.rb which fails when you are in a timezone which is ahead of UTC but UTC is in the previous day still."
This reverts commit f92cefa95f.
2011-07-20 15:37:52 -07:00
Aaron Patterson
09a488456a bigdecimal should be typecast to a float on sqlite3. fixes #2162 2011-07-20 14:39:01 -07:00
Santiago Pastorino
993d0f6477 Merge pull request #2159 from ogeidix/master
Fixed issue #2119: XHR without Accept and Content-Type header gets 500 error
2011-07-20 10:29:28 -07:00
Xavier Noria
64268c5dd1 Merge pull request #2165 from joshk/fixtures_test_fix
Timezone fixtures test correction
2011-07-20 04:04:47 -07:00
Xavier Noria
4636638bb9 Merge pull request #2136 from judearasu/guides_branch
notextile tag in rails guides generator has been placed with ascii quotes
2011-07-20 04:04:07 -07:00
Xavier Noria
0e6f19cc9b documents the changes to String#blank? in the AS guide 2011-07-20 12:17:37 +02:00
Xavier Noria
e175117eaf registers the changes to String#blank? in the CHANGELOG 2011-07-20 12:17:37 +02:00
Xavier Noria
82b5ebb710 Merge pull request #2164 from dmathieu/missing_require
missing require of string/encoding to have access to encoding_aware?
2011-07-20 03:09:49 -07:00
Damien Mathieu
2a371368c9 missing require of string/encoding to have access to encoding_aware? 2011-07-20 11:45:59 +02:00
Xavier Noria
af561901a0 Merge pull request #2146 from dmathieu/blank_binary_encoding
fix String#blank? on binary strings
2011-07-20 02:38:26 -07:00
Damien Mathieu
0c58f39c2c fix String#blank? on binary strings. 2011-07-20 11:23:00 +02:00
Damien Mathieu
de20e7c989 Merge pull request #53 from sepastian/master
Documentation fix ActiveModel::Dirty
2011-07-20 01:46:36 -07:00
Sebastian Gassner
9714d866f5 Documentation fix: adding missing equal sign in code sample for ActiveModel::Dirty. 2011-07-20 10:31:57 +02:00
Josh Kalderimis
f92cefa95f this fixes a brittle test in fixtures_test.rb which fails when you are in a timezone which is ahead of UTC but UTC is in the previous day still. 2011-07-20 01:00:35 +02:00
Jeremy Kemper
b8a4e9fc6d Merge pull request #2160 from joshk/patch-5
Changed the year of a date used in a test which fails when using 1.8.7
2011-07-19 14:11:03 -07:00
Josh Kalderimis
322393f8cb Changed the year of a date used in a test which fails when using 1.8.7 on a 32bit machine (ArgumentError: time out of range) 2011-07-19 13:52:32 -07:00
ogeidix
1ac802fe3c Check Accept and Content-Type headers before evaluating them in xhr requests. Closes #2119
An xhr request must have an "Accept" or "Content-type" header in order to be considered a request with valid_accept_header.
2011-07-19 22:05:16 +02:00
Paul Battley
01c2a989f1 Update form helper documentation to match code.
Change d3cfee11 removed the automatically generated object_name_submit id attributes on form submit elements. This makes the documentation match.
2011-07-19 20:31:19 +01:00
Santiago Pastorino
37418e5468 Merge pull request #2155 from vijaydev/changelogs
Adding changelog entry for submit helper change which removed object_name_id generation
2011-07-19 12:20:36 -07:00
Santiago Pastorino
ee6be604c6 Merge pull request #2154 from vijaydev/better_map
Avoid Symbol#to_proc
2011-07-19 12:18:46 -07:00
Vijay Dev
d275a98446 add entry for submit helper change removing object_name_id 2011-07-20 00:39:23 +05:30
Evan Machnic
51df7cac8f Fixed asset_url in asset_pipeline doc 2011-07-19 14:59:06 -04:00
Vijay Dev
02cbaf0593 avoid Symbol#to_proc 2011-07-20 00:28:51 +05:30
Evan Machnic
f1a239fd6d Merge branch 'master' of github.com:lifo/docrails 2011-07-19 14:46:24 -04:00
Evan Machnic
2f4d9ef34e image_url documentation in asset_pipelin doc 2011-07-19 14:46:19 -04:00
Vijay Dev
46be69a220 spacing fix 2011-07-20 00:03:28 +05:30
Vijay Dev
4a54e40488 Fixing the incorrect change made in bae54c5 2011-07-20 00:03:28 +05:30
Vijay Dev
4719543c80 reword select_date's behaviour clearly when an incomplete options array is passed 2011-07-20 00:03:28 +05:30
Vijay Dev
4885e5d3eb minor corrections in form helpers guide and api docs 2011-07-20 00:03:28 +05:30
Vijay Dev
09dd03095a some corrections in assets pipeline guide 2011-07-20 00:03:28 +05:30
Evan Machnic
0cf5160a80 Capitalization compliance for asset_pipeline doc 2011-07-19 13:36:50 -04:00
Santiago Pastorino
30289c7683 Merge pull request #2148 from norman/master
Explicitly require Active Support dependencies (master)
2011-07-19 06:38:20 -07:00
Norman Clarke
9db2d10b11 Explicitly require Active Support dependencies
This fixes errors when using Active Record outside of Rails. In Rails,
these files are required by other classes that are always loaded, so
this error does not happen.

Without core_ext/module/delegation, a NoMethodError is raised because
`delegate` remains undefined.

Without core_ext/class/attribute_acessors, an ArgumentError is raised because
`delegate` does not receive a value for its :to option.
2011-07-19 09:56:02 -03:00
Vijay Dev
db655ec7a6 Revert "notextile tag has been placed with ascii quotes"
This reverts commit 3e6052a430.

Reason: Code changes are not allowed in docrails (even if they are related to guides generation)
2011-07-19 12:18:23 +05:30
JudeArasu
3e6052a430 notextile tag has been placed with ascii quotes 2011-07-19 06:41:20 +05:30
Santiago Pastorino
73efb68dc9 Merge pull request #2139 from mcmire/issue_2078_master
Fix for #2078 (against master)
2011-07-18 17:27:21 -07:00
Xavier Noria
aaff90ac7f Merge pull request #2141 from joshk/master
Config files to get Rails on Travis-CI
2011-07-18 14:34:18 -07:00
Elliot Winkler
0e1d617b8b ActiveRecord: Fix eager loading so that giving a blank order clause generates valid SQL 2011-07-18 14:56:37 -06:00
JudeArasu
01040b5dc9 notextile tag has been placed with ascii quotes 2011-07-19 01:33:45 +05:30
José Valim
b475f74da5 Merge pull request #2133 from jstorimer/ensure-status-codes-are-logged-properly
Ensure that status codes are logged properly
2011-07-18 11:05:37 -07:00
Jesse Storimer
ac81af40c0 Ensure that status codes are logged properly
Needed to move AC::Metal::Instrumentation before AM::Metal::Rescue
so that status codes rendered from rescue_from blocks are logged
properly.
2011-07-18 13:42:07 -04:00
Santiago Pastorino
8efc0f1f34 Merge pull request #2116 from guilleiguaran/fix-environment-generator-action
Fix Rails::Generators::Actions#environment when env is passed
2011-07-18 10:00:08 -07:00
Guillermo Iguaran
fcdcc87a08 Fix Rails::Generators::Actions#environment when env is passed. Closes #2110 2011-07-18 10:43:25 -05:00
José Valim
da144894e9 Merge pull request #195 from bigfix/active_model_include_serialization
ActiveModel support for the :include serialization option
2011-07-18 06:50:43 -07:00
José Valim
44e83ac341 Merge pull request #2075 from lawrencepit/match_attribute_method
Optimization of ActiveModel's match_attribute_method?
2011-07-18 06:46:31 -07:00
Jon Leighton
50941ec07c Merge pull request #2128 from sikachu/master-dynamic_finder
Raise an ArgumentError if user passing less number of argument in the dynamic finder
2011-07-18 01:24:33 -07:00
Ryan Bigg
2f69469479 Complete another review of asset pipeline guide 2011-07-18 16:28:22 +10:00
Aaron Patterson
1e452f1840 make tzinfo a development dependency 2011-07-18 14:28:14 +09:00
Prem Sichanugrist
4443905169 Refactor test case to use anonymous class - Thank you @tenderlove 2011-07-18 00:37:06 -04:00
Santiago Pastorino
adc7097dc0 Merge pull request #2124 from arunagw/render_partial_invalid_check_fix
Checking with to_s. As regexp fail with 1.8.7
2011-07-17 20:14:12 -07:00
Jon Leighton
fcbde454f6 Don't do remove_possible_method when delegate is used. Two reasons: 1) warnings should be shown, and fixed at the source and 2) the code is slow. Fixes #1937. 2011-07-18 00:22:26 +01:00
Richard Hulse
27b1bf3c1f [asset pipeline] update capistrano task code
This code actually works.
2011-07-18 11:02:46 +12:00
Prem Sichanugrist
1ccca1b9cb Refactor the code a bit to reduce the duplication 2011-07-17 18:53:15 -04:00
Prem Sichanugrist
6e6994994d Raise an ArgumentError if user passing less number of argument in the dynamic finder
The previous behavior was unintentional, and some people was relying on it. Now the dynamic finder will always expecting the number of arguments to be equal or greater (so you can still pass the options to it.)

So if you were doing this and expecting the second argument to be nil:

    User.find_by_username_and_group("sikachu")

You'll now get `ArgumentError: wrong number of arguments (1 for 2).` You'll then have to do this:

    User.find_by_username_and_group("sikachu", nil)
2011-07-17 18:44:03 -04:00
Ray Baxter
98df4983b3 Add seach, tel, url and email inputs as 'Other Helpers of Interest' 2011-07-17 13:22:15 -07:00
Ray Baxter
82569b3827 examples for telephone_field, url_field and email_field 2011-07-17 13:10:17 -07:00
Ray Baxter
65b19c3633 document options to search_field 2011-07-17 13:08:02 -07:00
Arun Agrawal
d4f4626940 Checking with to_s. As regexp fail with 1.8.7 2011-07-18 01:27:38 +05:30
Santiago Pastorino
e9bd83402e Merge pull request #2046 from sikachu/master-test_fix
Fix a wrong assertion on url_helper_test, and add missing `#html_safe?` a
2011-07-17 12:48:49 -07:00
Prem Sichanugrist
edfb81d668 Fix a wrong assertion on url_helper_test, and refactor html_safe test to be in its method 2011-07-17 15:34:01 -04:00
Santiago Pastorino
7669c33c74 Merge pull request #2018 from bhus/render_partial_invalid_check
Render partial invalid check
2011-07-17 12:28:03 -07:00
Jon Leighton
ac97e25235 Revert "Fix failure in test_preserves_existing_fixture_data from test/cases/fixtures_test.rb when UTC and local time occur on different dates." I am pretty sure this was an incorrect fix, and it still failed in certain circumstances anyway. I am now unable to reproduce the original failure I was experiencing so will leave it for now and see if this pops up again.
This reverts commit e4479b2f1b.
2011-07-17 19:55:05 +01:00
John Firebaugh
4860143ee4 ActiveModel support for the :include serialization option
This commit moves support for the :include serialization option for
serializing associated objects out of ActiveRecord in into ActiveModel.
The following methods support the :include option:

  * serializable_hash
  * to_json
  * to_xml

Instances must respond to methods named by the values of the :includes
array (or keys of the :includes hash). If an association method returns
an object that is_a?(Enumerable) (which AR has_many associations do), it
is assumed to be a collection association, and its elements must respond
to :serializable_hash. Otherwise it must respond to :serializable_hash
itself.

While here, fix #858, XmlSerializer should not singularize already
singular association names.
2011-07-17 11:34:07 -07:00
John Firebaugh
1723a7a6c6 Move to_xml tests to xml_serialization_test.rb
One duplicate was eliminated: test_to_xml_including_methods/
test_methods_are_called_on_object.
2011-07-17 11:34:07 -07:00
John Firebaugh
0933b6d1ba We already have the record; no need to retrieve it again 2011-07-17 11:34:06 -07:00
John Firebaugh
cbf924ef08 Replace map+compact with select 2011-07-17 11:34:06 -07:00
John Firebaugh
2a9a10f5e3 Add a test 2011-07-17 11:34:06 -07:00
John Firebaugh
da4e1faf6f serializable_hash(:only => [], :methods => [:foo]) should work 2011-07-17 11:34:06 -07:00
Santiago Pastorino
2f00854d22 Merge pull request #2118 from arunagw/fix_plugin_gen_test
As we are adding db folder in it. Required in test also.
2011-07-17 10:04:53 -07:00
Ray Baxter
a4a309f2bc Merge branch 'master' of github.com:lifo/docrails 2011-07-17 09:31:23 -07:00
Ray Baxter
a92780e72a use correct in description 2011-07-17 09:07:18 -07:00
Josh Kalderimis
e6f0c24bc3 This fixes an issue when bundling to a local path (eg. /vendor/bundle).
If you bundle to a local path bundler is not included in it, so
calling "gem 'bundler'" will fail.
2011-07-17 15:21:19 +02:00
Arun Agrawal
24d67cc9df As we are adding db folder in it. Required in test also. 2011-07-17 18:39:33 +05:30
Richard Hulse
5187264e19 [asset pipeline] Correct CSS section and include Gem details
Also added note about compress option, which was 
not mentioned anywhere and is required
2011-07-17 20:22:25 +12:00
Richard Hulse
602bac19e7 [configuring] add doc for missing assets attribute
.compress turns on the compression using the types
specified in other config options
2011-07-17 20:22:25 +12:00
Ray Baxter
10c2132cbd we're talking about days here, not hours 2011-07-17 00:31:28 -07:00
Ray Baxter
5c71a4e768 wording between select_second, select_minute and
select_hour should be consistent and correct
2011-07-17 00:31:09 -07:00
Ray Baxter
f0a58dbd9b fix typo 2011-07-17 00:24:31 -07:00
Ray Baxter
2e6475ec06 make documentation agree with test expectations and
behaviour

See: test_select_date_with_incomplete_order in 
actionpack/test/template/date_helper_test.rb
2011-07-17 00:06:46 -07:00
Ray Baxter
4341a5abaa document that second tags are also returned by default 2011-07-16 23:54:40 -07:00
Ray Baxter
6970c000e8 there is no Time.today method, use Time.now 2011-07-16 23:47:06 -07:00
Ray Baxter
343a05a64f remove stray character 2011-07-16 23:44:01 -07:00
Ray Baxter
9a2b18cfd3 disambiguate uses of post/POST by using "article"
for the related variable passed to  date_select, 
time_select and datetime_select
2011-07-16 23:42:35 -07:00
Ray Baxter
762a2f4653 clarify that classes that include DateHelper can
also manipulate times
2011-07-16 23:29:51 -07:00
Ray Baxter
589ff96809 clarify that DateTime objects are allowed arguments
to distance_of_time_in_words
2011-07-16 23:27:26 -07:00
Ray Baxter
4ada0a58ae use minute instead of second in description of select_minute 2011-07-16 23:11:48 -07:00
Ray Baxter
851275e706 show correct helper in description 2011-07-16 23:09:59 -07:00
Ray Baxter
5dd8277f5b use 'hour' instead of 'minutes' and 'second' for select_hour 2011-07-16 23:08:30 -07:00
Lawrence Pit
52a096275a Made attribute_method_matchers_cache private + doc 2011-07-17 14:51:34 +10:00
Sam Umbach
bae54c5430 Switch Tilt link to Textile format 2011-07-16 21:08:14 -07:00
Sam Umbach
ade629e206 Fix typo 2011-07-16 21:02:36 -07:00
Richard Hulse
86869a09ee [asset pipeline] A few corrections and some new material
Add notes about capistrano task being added to that project
and correction to information about precompilation.
2011-07-17 14:19:04 +12:00
Xavier Noria
0aec2e7191 indeed, if we are going to remove everything in public/assets on assets:clean, just do that 2011-07-17 00:44:00 +02:00
Xavier Noria
53f6acd252 if we are cleaning all files, we are cleaning all gz files 2011-07-17 00:35:21 +02:00
Santiago Pastorino
296b1eef67 Merge pull request #2082 from htanata/rake_routes_formatting
Better formatting of rake routes (issue #1991)
2011-07-16 11:22:58 -07:00
Hendy Tanata
7b619f1d7b Improve formatting of route to Rack application in rake routes.
This route:

    match 'foo/:id' => RackApp, :id => /[A-Z]\d{5}/

is shown as:

    /foo/:id(.:format) RackApp {:id=>/[A-Z]\d{5}/}
2011-07-17 00:49:48 +08:00
Santiago Pastorino
e98d747705 Merge pull request #2108 from loz/master
Adds gem helper rake tasks to engines generator
2011-07-16 08:43:51 -07:00
Jonathan Lozinski
8b080b3831 Added gem helper to rake task for engines, as per pull request from 3-1-stable, #2103 2011-07-16 16:06:44 +01:00
Santiago Pastorino
3e06ec8944 Fix the output a bit 2011-07-16 09:54:03 -03:00
Dan Gebhardt
455e321284 added test case for fix to issue #2094 2011-07-16 08:22:43 -04:00
José Valim
94d8e6bdf8 Merge pull request #2101 from loz/master
Added db to gemspec so migrations are packaged
2011-07-16 04:02:12 -07:00
Richard Hulse
0f78aeee87 [asset pipeline] Add section on sendfile option
This option has caught a few people out, so it
is a good idea to include an explanation and
a Gotcha.

See Rails bug 1822
See 1822 comment 1585926 for resolution
2011-07-16 19:05:42 +12:00
Lawrence Pit
c3dd4c653d Issue #2075 Optimization of ActiveModel's match_attribute_method? 2011-07-16 16:40:11 +10:00
Jonathan Lozinski
06c9dd1906 Added db to gemspec files so migrations are correctly packaged 2011-07-16 06:48:54 +01:00
John Warwick
765b79257a Fixing typo in plugins.textile 2011-07-15 22:40:17 -04:00
Dan Gebhardt
c6d83ab741 fixed problem in which options[:html][:remote] would be overridden in form_for() - fixes #2094 2011-07-15 18:22:31 -04:00
Santiago Pastorino
c2b62addfe Merge pull request #2090 from htanata/fix_wildcard_route_code_in_changelog
Fix wildcard route code example in changelog
2011-07-15 14:24:43 -07:00
Hendy Tanata
d7f4a3ef78 Fix wildcard route code example in changelog. 2011-07-16 04:27:27 +08:00
Hendy Tanata
193e4de206 Better formatting of route requirements in rake:routes.
Previously it was:

    {:controller=>"photos", :action=>"show", :id=>/[A-Z]\d{5}/}

Now it becomes:

    photos#show {:id=>/[A-Z]\d{5}/}
2011-07-16 04:23:05 +08:00
Vijay Dev
88e307a0a6 Merge pull request #52 from dyba/651cabc69a6cd661bc33824b995c2242fb65befe
Modified migrations file
2011-07-15 11:32:11 -07:00
Vishnu Atrai
b6d5612f55 Should be "match" instead of "map" 2011-07-15 23:56:58 +05:30
Vijay Dev
ff410c4ea9 Revert "Fix wildcard route code examples."
This reverts commit 0894d73c75.

Reason: CHANGELOGs should not be changed in docrails.
2011-07-15 23:06:37 +05:30
Hendy Tanata
0894d73c75 Fix wildcard route code examples.
Should be "match" instead of "map".
2011-07-15 22:24:04 +08:00
Akira Matsuda
9cd1f754d0 convert multiple Date parameters into a nil if any of its bits were blank 2011-07-15 21:19:23 +09:00
Josh Kalderimis
d664eba5b4 Added a .travis.yml config and travis specific ci script.
Don't install ruby-debug if running the test suite on Travis,
linecache19 is the main offender, very very slow.

And do not install pg if Travis is bundling the gems, pg will be setup
on Travis soon.
2011-07-15 10:47:50 +02:00
Richard Hulse
28d5d22f5a [asset pipeline] Added information about data uri helper
See Sprockets issue 111
and Sprockets commit cd38a1670a
2011-07-15 16:19:11 +12:00
Lawrence Pit
f04c5d640d Optimization of ActiveModel's match_attribute_method? 2011-07-15 09:58:46 +10:00
Santiago Pastorino
f88e9d83f1 Merge pull request #2073 from bfolkens/master
ported test from pull request #2071 to master
2011-07-14 12:19:21 -07:00
Bradford Folkens
4755930727 assert nothing raised for setting a cookie value to nil in ActionDispatch 2011-07-14 14:01:39 -05:00
Santiago Pastorino
31ea0276a4 Merge pull request #2063 from elight/master
Patch for https://github.com/rails/rails/issues/2059
2011-07-14 11:14:27 -07:00
Evan Light
f13dea8a34 Fix and unit test for https://github.com/rails/rails/issues/2059
Cache key was incorrectly using timezone-dependent record#updated_at when it should be using a timezone-independent value to generate the cache key

Minor refactoring to cache_key timezone test

Closes #2059

Adds a test to validate the format of the cache_key for nil and present updated_at values

Correctly handles updated_at == nil
2011-07-14 14:04:02 -04:00
joeellis
cd8530db3c Minor grammar mistake 2011-07-14 09:17:29 -07:00
Santiago Pastorino
d632e927ec Merge pull request #1807 from caius/find_in_batches_id_bug
Bugfix by stopping find_in_batches using the records after yielding.
2011-07-14 07:57:04 -07:00
Aaron Patterson
db0a65cbe0 Merge pull request #2066 from amatsuda/magicome
missing magic comments
2011-07-14 01:30:53 -07:00
Akira Matsuda
99d598a131 need magic comments 2011-07-14 12:39:34 +09:00
Daniel Dyba
651cabc69a Modified Migrations file 2011-07-13 20:20:01 -07:00
Aaron Patterson
003c6516dc Merge pull request #2052 from amatsuda/fullwidth_blank
treat fullwidth whitespace as a blank character
2011-07-13 19:04:28 -07:00
Santiago Pastorino
54ab63ee77 Bump rack up 2011-07-13 21:40:46 -03:00
Akira Matsuda
9c60860322 treat fullwidth whitespace as a blank character 2011-07-14 07:48:39 +09:00
huskins
2668dce1c0 Added view template invalid name check, along with tests. No merges in commit. 2011-07-13 13:06:03 -04:00
Akira Matsuda
c7359e3267 documentation fix: wrong result 2011-07-13 18:29:45 +09:00
Richard Hulse
5dcebd7e38 [asset pipeline] add capistrano task
Task still needs to symlink default rails default
filestore location, but code may still be settling
2011-07-13 21:20:53 +12:00
Aslam Najeebdeen
991678c1df Replaced appropriate word. 2011-07-13 13:33:32 +05:30
José Valim
704ee0df65 Use cache/assets instead. 2011-07-12 22:55:34 -03:00
José Valim
8f0e0b63f5 assets.cache_store now defaults to filesystem. You will want to share tmp/assets_cache between deploys. 2011-07-12 22:30:17 -03:00
Santiago Pastorino
8cf45150de Merge pull request #2042 from SAP-Oxygen/master-sqlbypass-patch
Fix for SqlBypass session store (for master)
2011-07-12 15:06:00 -07:00
Santiago Pastorino
4735e2ec65 Merge pull request #2041 from SAP-Oxygen/master-session-id-patch-with-test
Fixed session ID fixation for ActiveRecord::SessionStore (for master)
2011-07-12 15:05:29 -07:00
José Valim
8f58bd49d7 Merge pull request #2038 from FLOChip/extra_space
remove extra space since comment_if already returns the space.
2011-07-12 11:49:32 -07:00
Joseph Wong
88e6c06242 Fix for SqlBypass session store
Two issues fixed:
1) connection_pool is not defined - needed by SessionStore#drop_table!
and create_table! since c94651f

2) initialization of connection to the default of AR::Base.connection
only occurred at the singleton level - the instance level method defined
by cattr_accessor did not have this logic
2011-07-12 11:10:25 -07:00
Joseph Wong
66dee26930 Fixed session ID fixation for ActiveRecord::SessionStore
I have found that Rails will take an invalid session ID specified by the
client and materialize a session based on that session ID. This means
that it is possible, among other things, for a client to use an
arbitrarily weak session ID or for a client to resurrect a previous used
session ID. In other words, we cannot guarantee that all session IDs are
generated by the server and that they are (statistically) unique through
time.

The fix is to always generate a new session ID in #get_session if an
existing session cannot be found under the incoming session ID.

Also added new tests that make sure that an invalid session ID is never
materialized into a new session, regardless of whether it comes in via a
cookie or a URL parameter (when :cookie_only => false).
2011-07-12 11:09:11 -07:00
Teng Siong Ong
5e73a2fa50 remove extra space since comment_if already returns the space. 2011-07-13 00:59:30 +08:00
Matt Jankowski
85dd1dd663 grammar correction for rails/paths #add method arguments 2011-07-12 10:20:42 -04:00
Matt Jankowski
2f30fb03bb misc grammar and clarity changes for rails/engine docs 2011-07-12 09:54:43 -04:00
Matt Jankowski
eb716f6307 grammar/tense correction to rails application doc 2011-07-12 09:37:55 -04:00
Jon Leighton
e4479b2f1b Fix failure in test_preserves_existing_fixture_data from test/cases/fixtures_test.rb when UTC and local time occur on different dates. 2011-07-12 00:14:45 +01:00
Jon Leighton
1712d90050 Fix exception if old and new targets are both nil. Fixes #1471. 2011-07-12 00:14:45 +01:00
Joshua Peek
5c8be9eb86 Ensure Dir.glob is sorted 2011-07-11 16:09:46 -07:00
Marc-Andre Lafortune
eeb58b0934 Generate valid default fixtures for models with a type column
Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
2011-07-11 19:47:57 -03:00
José Valim
1939fa3f16 Merge pull request #1722 from AndrewRadev/grouped-select
Make "select" helper handle nested collections
2011-07-11 10:25:04 -07:00
José Valim
133a20354e Merge pull request #1756 from shtirlic/xmlschema_fix
Fix xmlschema output with fraction_digits >0
2011-07-11 10:00:28 -07:00
Andrew Radev
587dd7d56c Grouped select helper
FormBuilder#select now works with a nested data structure.
2011-07-11 19:08:23 +03:00
Xavier Noria
91bba21815 Merge pull request #2032 from dziulius/master
#many? - uses count instead of select
2011-07-11 08:36:15 -07:00
shtirlic
c2b79c011f Fix xmlschema output with fraction_digits >0
Current implementation produce incorrect output when Time#usec returns
integer < 100000, because to_s doesn't add leading zeros.
2011-07-11 18:41:04 +04:00
José Valim
1fdbd4708f Merge pull request #2009 from vatrai/autoload-todo-new
TODO fix explicitly loading exceptations, autoload removed
2011-07-11 07:35:43 -07:00
José Valim
3da3df8fcb Require assets in all environments by default and provide a way to opt-out from uglifier. 2011-07-11 11:19:03 -03:00
José Valim
d5e8722683 Merge pull request #2029 from sikachu/acronym_mention
Mention about acronym inflection in config/initializers/inflections.rb
2011-07-11 06:51:24 -07:00
Prem Sichanugrist
75cfd037cb Mention about acronym inflection in config/initializers/inflections.rb
Closes #1366
2011-07-11 09:45:33 -04:00
Santiago Pastorino
539d684b7a Merge pull request #1929 from sobrinho/master
Create a test case for disable_referential_integrity
2011-07-11 06:00:59 -07:00
Hrvoje Šimić
812950e027 fixed paths, more consistent helpers and paths examples 2011-07-11 14:45:47 +02:00
Julius Markūnas
ea0eb02f48 #many? uses count instead of select - a bit faster 2011-07-11 14:59:51 +03:00
José Valim
8f2e32158b Merge pull request #1608 from sishen/sishen
MemcacheStore: deserialize the entry reading from local_cache when using
2011-07-11 04:54:28 -07:00
José Valim
e9f9ce971e Merge pull request #1296 from c42engineering/issue636
Resubmitting issue #636 as a pull request
2011-07-11 04:28:00 -07:00
José Valim
871d7fad03 Merge pull request #1924 from cesario/1922-get-back-and-deprecate-env-default
Put back Rails.application#env_default and deprecate it [Closes #1922]
2011-07-11 04:20:48 -07:00
Franck Verrot
ea649de669 Rails.application#env_config is now public API. [Closes #1924] 2011-07-11 11:05:26 +02:00
Richard Hulse
826820fb7f [asset pipeline] more updates to docs 2011-07-11 19:55:03 +12:00
Vishnu Atrai
525fd3ac86 TODO fix explicitly loading exceptations, autoload removed 2011-07-11 13:14:02 +05:30
Sidu Ponnappa
83555a5398 Issue #636 - Parsing an xml file with multiple records and extra attributes (besides type) fails 2011-07-11 11:41:22 +05:30
Santiago Pastorino
c3732bfed0 Merge pull request #1823 from gnarg/master
Log instrumentation name for exists? queries
2011-07-10 18:02:31 -07:00
Vijay Dev
d2ff099b16 use simpler words in docs 2011-07-10 21:44:06 +05:30
José Valim
60076de1d4 Make Rails.groups accept arrays. 2011-07-10 08:36:08 -03:00
José Valim
3a611cb207 Merge pull request #2026 from spohlenz/asset-tag-fix
Include TagHelper within AssetTagHelper
2011-07-10 03:58:57 -07:00
Sam Pohlenz
0ac79d0343 Include TagHelper within AssetTagHelper 2011-07-10 12:37:32 +09:30
Santiago Pastorino
c5448721b5 to_key on a destroyed model should return nil 2011-07-09 15:36:57 -03:00
Pol Llovet
ea16e0f716 Add more examples to #titleize 2011-07-09 12:35:16 -06:00
Daniel Schierbeck
a982443ae5 Make #extract_schema_and_table an instance method in Utils
Also, move the utils test into its own test case.
2011-07-09 14:24:28 +02:00
Santiago Pastorino
bc364afb93 Merge pull request #2007 from amatsuda/having_vargs_nomethoderror_fix
having() raises NoMethodError: undefined method `empty?' when the given argument does not respond to empty?
2011-07-09 05:20:42 -07:00
Akira Matsuda
7c921fbf15 formats 2011-07-09 20:14:41 +09:00
Akira Matsuda
d1545bcf94 fix AR having() not to raise NoMethodError when the given argument does not respond to empty?
having raises NoMethodError: undefined method `empty?' when a Fixnum or Date/Time were passed via varargs
2011-07-09 20:14:41 +09:00
Jon Leighton
111968d402 Foo.joins(:bar).includes(:bar) should result in a single query with :bar as a join. Related: #1873. 2011-07-09 11:39:04 +01:00
Olek Janiszewski
2beea3b249 Documentation fixes for rendering partials 2011-07-09 13:38:07 +03:00
Xavier Noria
b65bd01d55 Merge branch 'master' of git://github.com/lifo/docrails 2011-07-09 12:20:24 +02:00
José Valim
6917c65f04 Merge pull request #2017 from Casecommons/active_record_lint
ActiveRecord::Base subclasses should pass ActiveModel::Lint.
2011-07-08 18:34:02 -07:00
Ryan Bigg
1835aba6f1 Add section about debugging assets 2011-07-09 10:54:08 +10:00
Ryan Bigg
678dd6f5d6 Clarify that per-controller asset files are not 'magically' loaded by the controller, but rather need to be required 2011-07-09 10:54:08 +10:00
Santiago Pastorino
d9182c0ae9 config should always be an AS::InheritableOptions object. Closes #1992 2011-07-08 21:45:53 -03:00
Grant Hutchins & Peter Jaros
6b9c38c1a8 ActiveRecord::Base should pass ActiveModel::Lint. 2011-07-08 17:51:40 -04:00
Tomas D'Stefano
ea4b94a7bf Destroy association habtm record before destroying the record itself. Fixes issue #402. 2011-07-08 22:26:54 +01:00
Jon Leighton
dfec3737b0 Ensure that the foreign key gets set when doing record.create_association or record.create_association. Fixes #1960. 2011-07-08 21:03:54 +01:00
Christopher Scott Hernandez
5f6c6a7677 Merge pull request #51 from christopherscott/master
Single word change (find -> where) on active record query page
2011-07-08 10:05:05 -07:00
Christopher Scott Hernandez
2423aca1c5 Updated active_record_querying.textile: intro paragraph of 'Conditions' to change 'find method' to 'where method' 2011-07-08 10:02:01 -07:00
Aaron Patterson
c1c886a0c4 Merge pull request #2012 from dasch/refactor_postgres_adapter
Refactor PostgreSQLAdapter a bit
2011-07-08 09:12:06 -07:00
Vijay Dev
5724625e81 update Rails version. (rails console didn't exist in 2.1) 2011-07-08 20:51:09 +05:30
Oge Nnadi
2b8c87404c Changed the value that log_level takes to match the examples in the paragraph above 2011-07-08 07:57:16 -07:00
Daniel Schierbeck
9991f0f15a Refactor PostgreSQLAdapter a bit
Move the private method #extract_schema_and_table into a separate
Utils module so that it can be tested without resorting to #send.
2011-07-08 16:05:55 +02:00
Santiago Pastorino
4f7ca00bf2 Merge pull request #2010 from hasclass/cache_false_values
Properly cache value when it is "false"
2011-07-08 06:10:55 -07:00
Santiago Pastorino
3a1ec9b544 Merge pull request #2011 from amatsuda/with_index
replaced some "i += 1" sort of codes with Enumerable#with_index
2011-07-08 06:05:20 -07:00
Akira Matsuda
dab0de4a20 Use Enumerable#with_index. We're on Ruby > 1.8.7 (part II) 2011-07-08 21:45:41 +09:00
Akira Matsuda
49bf8597e6 Use Enumerable#with_index. We're on Ruby > 1.8.7 2011-07-08 21:38:02 +09:00
Sebi Burkhard
9e63f9f2e4 Properly cache value when it is "false" 2011-07-08 18:08:37 +07:00
Akira Matsuda
d02726c24c minor document edit
the sample model has only 9 lines: 4d4819fb27 (commitcomment-467295)
2011-07-08 18:44:42 +09:00
Xavier Noria
ad912c08a9 use Zlib.crc2 rather that bytes.sum, as per Aaron's suggestion
That integer is rather irrelevant, the only thing that matters is that
it is consistent and with no apparent bias. Zlib.crc32 is 8-10 times
faster than bytes.sum, so use that.
2011-07-08 00:58:14 +02:00
José Valim
e01aba1504 Move config.default_asset_host_protocol to the railtie. 2011-07-07 19:13:10 -03:00
José Valim
2a24bcc6cf Don't raise on mass assignment for test 2011-07-07 18:58:04 -03:00
Akira Matsuda
4d4819fb27 :conditions => where 2011-07-08 06:13:21 +09:00
Akira Matsuda
b2816ae971 :joins => joins 2011-07-08 06:13:21 +09:00
Akira Matsuda
c4bd47778f :include => includes 2011-07-08 06:13:21 +09:00
Akira Matsuda
6c94f69673 find(:first) => first 2011-07-08 06:13:21 +09:00
Akira Matsuda
a3683fd0e4 find(:all) => all 2011-07-08 06:13:21 +09:00
Aaron Patterson
215193d19a removing brittle assertion 2011-07-07 13:12:28 -07:00
José Valim
453f2221cb Merge pull request #2005 from acroca/master
Fixing asset number for asset_path with %d to be consistent in ruby 1.9
2011-07-07 12:15:36 -07:00
Albert Callarisa Roca
f6a6b51ae5 Using the sum of bytes instead the hash of the path when replacing the wildcard of the assets path because in ruby 1.9 is not consistent 2011-07-08 00:10:20 +08:00
Santiago Pastorino
99c20aaa75 Merge pull request #1767 from jwarwick/rake_notes_dirs
Updated rake:notes to search additional directories
2011-07-07 09:03:43 -07:00
Santiago Pastorino
63861e0c9c Merge pull request #1997 from knapo/master
Make `ActiveRecord::Batches#find_each` to not return `self`.
2011-07-07 09:00:35 -07:00
Xavier Noria
6469560f2d Merge pull request #1999 from dmitriy-kiriyenko/add_require_active_support_delegation_to_relation
Add require ActiveSupport delegation to ActiveRecord::Relation class.
2011-07-07 08:07:59 -07:00
José Valim
298a0834e1 Just generate AR options if AR is enabled 2011-07-07 11:52:20 -03:00
Dmitriy Kiriyenko
f1553731ed Add require ActiveSupport delegation to ActiveRecord::Relation class. 2011-07-07 17:32:18 +03:00
José Valim
4b6232e5a7 Merge pull request #1996 from bogdan/default_sanitizer_squashed
Rails app template: setup different mass assignment sanitizer for envs
2011-07-07 03:59:34 -07:00
José Valim
03a016c08f Merge pull request #1406 from dmathieu/fix_test_warnings
Fix test warnings
2011-07-07 03:59:01 -07:00
Shawn Drost
1d3f833a54 document HashWithIndifferentAccess#extractable_options? 2011-07-07 03:52:48 -07:00
knapo
2ca9b6dfab Make ActiveRecord::Batches#find_each to not return self.
This caused that `find_each` was producing extra db call taking all the records from db, and was less efficient than `ActiveRecord::Base#all`.
2011-07-07 11:40:11 +02:00
dmathieu
e722fbb50f remove the warning when testing whiny_nil 2011-07-07 11:21:23 +02:00
Bogdan Gusiev
0fab8c388e Rails app template: setup different mass assignment sanitizer for envs
For production - leave the default
For test and dev: :strict.
2011-07-07 10:24:05 +03:00
Santiago Pastorino
1bad08f116 Merge pull request #1120 from lysenko/collection_singular_ids
collection_singular_ids ignores association :include option
2011-07-06 20:13:24 -07:00
Santiago Pastorino
c6578d64ca Merge pull request #1989 from simonbaird/master
rake db:test:purge creates mysql database with wrong charset & collation (master branch)
2011-07-06 20:10:14 -07:00
José Valim
35597e3606 Ensure the engine_path is there (it may make CI happy). 2011-07-06 23:00:02 -03:00
jwarwick
a85caaa185 Updated rake:notes to search app, config, lib, script and test dirs 2011-07-06 21:41:13 -04:00
José Valim
86e2f888e7 Give higher priority to assets.cache_store. 2011-07-06 17:59:56 -07:00
José Valim
2f6e3895a8 Make compressors lazily load. 2011-07-06 21:41:13 -03:00
Jon Leighton
86390c3bf3 Don't construct association scope in initializer. This yields a big performance gain for cases where the association is never used to load the target, for example with preloading. Related: #1873. 2011-07-07 01:07:31 +01:00
Simon Baird
ecd37084b2 Fix charset/collate in mysql recreate_database
See new method mysql_creation_options. It is used by both
create_database and recreate_database so they are consistent.

(Cherry pick of 3ba3125b24)
2011-07-07 09:27:51 +10:00
José Valim
7da88c5b29 Remove stream at the class level.
This is because only template rendering works with streaming.
Setting it at the class level was also changing the behavior
of JSON and XML responses, closes #1337.
2011-07-06 20:24:30 -03:00
Jon Leighton
689c3d674c Merge pull request #1987 from ernie/fix_fix_to_reverse_sql_order
Remove case statement changes from 2e0840d and 56ac32a. Inheritance FTW.
2011-07-06 14:33:14 -07:00
Anatoliy Lysenko
66dd2d3d10 Fix bug in collection_singular_ids on has many through association with conditions and includes,
when condtions references tables from includes.
Test fail because of invalid sql:
ActiveRecord::StatementInvalid: SQLite3::SQLException: no such column: comments.id:
SELECT "posts".id FROM "posts" INNER JOIN "readers" ON "posts"."id" = "readers"."post_id"
WHERE "readers"."person_id" = 1 AND (comments.id is null)

Bug described in github#925

This commit will revert fix from 3436fdfc12 , but tests is ok.

Bug described in #6569 ticket.
2011-07-06 23:23:34 +03:00
Ernie Miller
2bdad7669c Remove case statement changes from 2e0840d and 56ac32a. Inheritance FTW. 2011-07-06 16:13:57 -04:00
Santiago Pastorino
c713cf9a5d Merge pull request #1273 from jeremyf/feature-association-proxy-send
Addresses an inconsistency in the ActiveRecord::Base.method_missing handl
2011-07-06 13:05:58 -07:00
Santiago Pastorino
d10d93225c Merge pull request #1463 from psanford/master
Fix timezone handling in String.to_time
2011-07-06 12:36:47 -07:00
Santiago Pastorino
d5bd7030e5 Merge pull request #1494 from anildigital/master
Fix failing test because of Timezone difference.
2011-07-06 12:23:19 -07:00
Santiago Pastorino
61913684a2 Merge pull request #1926 from tobsch/master
Accept application.js/.css to exist in a deeper directory depth by default
2011-07-06 11:42:29 -07:00
Jon Leighton
2c72830cd9 Merge pull request #1979 from bogdan/association_sum_array_compatibility
Fixed AR::Relation#sum compatibility with Array#sum
2011-07-06 00:49:05 -07:00
Aaron Patterson
a990b1223b updating pg supported versions docco. fixes #1959 2011-07-05 11:32:31 -07:00
JudeArasu
a95d7d86c8 rails text been added before version 2011-07-05 22:49:44 +05:30
Santiago Pastorino
b27871a66f Merge pull request #1968 from bogdan/associations_find_array_compatibility2
Fixed CollectionAssociation#find to be compatible with Array#find
2011-07-05 09:41:09 -07:00
James Miller
9fec798124 Remove attachment_fu, add CarrierWave to suggested uploader libraries 2011-07-05 08:40:09 -07:00
Bogdan Gusiev
e7bec4e435 Fixed AR::Relation#sum compatibility with Array#sum
In order make Relation behavior closer to Array
Made Relation#sum to accept block and delegate it to Array#sum
2011-07-05 14:36:20 +03:00
José Valim
eb2e109b7e Merge pull request #1963 from jake3030/fix_engine_rake_task
Fix engine rake task
2011-07-05 03:41:54 -07:00
Bogdan Gusiev
8ba0c1ac53 Fixed CollectionAssociation#find to be compatible with Array#find
In order to make CollectionAssociation behave closer to Array
Add the ability to pass block to #find method just like Array#find does.
2011-07-05 10:51:40 +03:00
Xavier Noria
289b5253ce Merge branch 'master' of git://github.com/lifo/docrails 2011-07-05 01:42:13 +02:00
Jon Leighton
892c99ca5c Merge pull request #1964 from kommen/has_one_fix
Only call set_owner_attributes for has_one association if target exists. [3.1.0rc4]
2011-07-04 16:14:56 -07:00
Jake Varghese
467c9b6e23 fix engines rake tasks 2011-07-04 15:48:15 -05:00
Vijay Dev
254a1e57d7 minor edit in 7896ac3 2011-07-05 00:10:59 +05:30
Dieter Komendera
7d3aa2462c Only call set_owner_attributes for has_one association if target exists. 2011-07-04 18:43:09 +02:00
Andrew White
718542bb18 Revert "The rails gem doesn't have a lib directory - closes #1958."
RubyGems requires at least one require_path.

This reverts commit e7fc5d1cad.
2011-07-04 16:59:51 +01:00
Andrew White
e7fc5d1cad The rails gem doesn't have a lib directory - closes #1958. 2011-07-04 14:52:29 +01:00
Xavier Noria
8c1bd05662 Merge pull request #1957 from vijaydev/add-validator-gem
Add w3c_validators gem to the doc group to fix failing validation of guides
2011-07-04 04:44:54 -07:00
Vijay Dev
8b25b55755 add w3c_validators gem to the doc group to fix failing validation of guides 2011-07-04 17:12:25 +05:30
Andrew White
9f7442a3ab Use an instance variable to store the current masss assignment options 2011-07-04 06:47:42 +01:00
José Valim
78ff00d196 Merge pull request #1950 from dmathieu/require_railties
Add railties to the load path if it's not already there
2011-07-03 15:45:39 -07:00
Damien Mathieu
dc2d8af1a3 Load the generators test helper and properly load it's test case 2011-07-03 20:22:30 +02:00
Jon Leighton
3adb24aa6b Merge pull request #1941 from vijaydev/command-recorder-fix
Reversing the changes related to CommandRecorder
2011-07-03 09:23:43 -07:00
Mohammad Typaldos
47139b8cb6 Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-07-03 07:13:20 -07:00
Vijay Dev
caab9f4e95 document meta methods 2011-07-03 18:15:47 +05:30
José Valim
17693a99ef Merge pull request #1948 from dmathieu/html_safe_numeric
All numerics should be html_safe
2011-07-03 05:18:57 -07:00
Damien Mathieu
b7327241aa all numerics should be html_safe - Closes #1935 2011-07-03 13:09:46 +02:00
Richard Hulse
a715c37218 [asset pipeline] expand section on configuration 2011-07-03 17:20:04 +12:00
José Valim
a1d85a03bd Merge pull request #1945 from spohlenz/fix-engine-migrations-check
Fix has_migrations? check in Rails::Engine
2011-07-02 20:42:08 -07:00
Sam Pohlenz
a7a58af244 Fix has_migrations? check in Rails::Engine 2011-07-03 13:02:58 +09:30
José Valim
3875e449ab Merge pull request #1925 from spohlenz/refactor-asset-paths
Refactor sprockets asset paths to allow for alternate asset environments
2011-07-02 20:23:47 -07:00
Richard Hulse
c7dec1716e [asset pipeline] More updates
resources for fingerprinting, grammar,CSS
2011-07-03 14:11:41 +12:00
Richard Hulse
0dc2c57bb3 [asset pipeline] Add resources to fingerprinting 2011-07-03 13:53:39 +12:00
Sam Pohlenz
21344bc33b Add documentation for asset_prefix and asset_environment 2011-07-03 10:29:04 +09:30
Richard Hulse
cfbed13a61 [asset pipeline] what is fingerprinting section 2011-07-03 12:30:09 +12:00
Richard Hulse
870d07032f [asset pipeline] spelling ! 2011-07-03 09:44:50 +12:00
Richard Hulse
2a06de86fa [asset pipeline] Add new rationale section
This will contain details about fingerprinting.
2011-07-03 08:31:21 +12:00
Santiago Pastorino
9d6e5e64dc Merge pull request #1940 from dmathieu/missing_location
Provide a more explicit message when we try to redirect to a missing location
2011-07-02 12:51:59 -07:00
Vijay Dev
2d022f0b0f Merge pull request #50 from wader/master
Fix arguments to get plugin help
2011-07-02 12:44:17 -07:00
Vijay Dev
15f35c0ac0 Reversing the changes done in c278a2c while still resolving #1857.
The changes broke bulk migration tests and were fixed in 4d256bc6;
however that brought back the issue of #1857 and so this commit goes
back to the original scenario and just adds change_table to the list
of methods which are to be recorded in the CommandRecorder. The
method_missing now delegates all calls to the underlying connection as
before.
2011-07-02 23:43:13 +05:30
Damien Mathieu
ac15bcebf2 provide a more explicit message when using url_for with nil
This fixes the problem of having a non-explicit message when the :location option is not provided in respond_with.
2011-07-02 18:53:54 +02:00
Vijay Dev
2949e30a05 document handle_unverified_request method 2011-07-02 21:18:46 +05:30
Vijay Dev
007214cfb9 Revert "fix a typo"
Reason: Changelogs are not to be changed in docrails.

This reverts commit 0b8cdc16e0.
2011-07-02 13:58:26 +05:30
José Valim
908be47781 Merge pull request #1938 from joefiorini/master
Make to_json take a parameter to exclude root
2011-07-01 20:20:33 -07:00
Joe Fiorini
ac5e691153 Enable passing root: false to #to_json 2011-07-01 23:00:13 -04:00
Aaron Patterson
36d289ad24 a few minor performance improvements: fewer strings, fewer range objects, fewer method calls 2011-07-01 15:20:11 -07:00
José Valim
13990d50fa require 'thread' before using mutex 2011-07-01 14:52:07 -07:00
Aaron Patterson
2ed8097058 calling super is super. if the other object is exactly equal, we can return early 2011-07-01 14:38:22 -07:00
Aaron Patterson
06c72c43ba remove unused codes 2011-07-01 14:38:17 -07:00
Andrew White
2d16515e52 It's autoload all the way down 2011-07-01 21:44:16 +01:00
Ray Baxter
0b8cdc16e0 fix a typo 2011-07-01 13:35:00 -07:00
Andrew White
79924c637d Don't require ActionView::Context as it's autoloaded 2011-07-01 20:36:23 +01:00
Andrew White
505b6a43f7 Revert "Add missing require for ActionView::AssetPaths"
This reverts commit 987eb7d423.
2011-07-01 20:34:15 +01:00
Andrew White
fdaecbed84 Add missing requires for ActionView::Context and Module#instance_method_names 2011-07-01 20:17:48 +01:00
Andrew White
987eb7d423 Add missing require for ActionView::AssetPaths 2011-07-01 20:17:48 +01:00
José Valim
d74e1b1ac5 Add assets_gemfile_entry. 2011-07-01 15:21:08 -03:00
José Valim
3da608e0b4 Revert "Add method fields_for_with_index to FormHelper"
This reverts commit 7c562d5e46.

Conflicts:

	actionpack/lib/action_view/helpers/form_helper.rb
2011-07-01 14:52:18 -03:00
Aaron Patterson
441d8ec130 reduce calls to owners_by_key and to read_attribute, respond_to? etc 2011-07-01 09:55:48 -07:00
Mattias Wadman
dfabd909c6 Fix arguments to get plugin help. Otherwise a plugin named "new" is created. 2011-07-01 07:58:04 -07:00
Matt Jankowski
7896ac35c0 general grammar cleanup of cache docs 2011-07-01 10:18:23 -04:00
Matt Jankowski
894cca5cc5 general formatting cleanup, and clarify that passing true as third option for benchmarking will stop output OTHER THAN the timing output itself 2011-07-01 10:05:45 -04:00
Gabriel Sobrinho
5399471820 Create a test case for disable_referential_integrity 2011-07-01 10:04:10 -03:00
Sam Pohlenz
0613f3bcdb Add tests for alternate asset prefix/environment 2011-07-01 21:56:41 +09:30
José Valim
b31ce90e99 Merge pull request #1927 from bogdan/select_multiple_index
Fixed ActionView::FormOptionsHelper#select with :multiple => false
2011-07-01 04:31:48 -07:00
Richard Hulse
8de6ded7a5 [asset pipeline] refactor docs and add new content
This changes the document around and adds more details about
the rationale behind the pipeline. Still a WIP.
2011-07-01 22:34:17 +12:00
Tobias Schlottke
139971d3cc Now accepting css/js files in deeper directory structures by default.
This is useful for engines with own application.{js|css}-files.
See: https://github.com/rails/rails/issues/1520
2011-07-01 09:53:48 +02:00
Sam Pohlenz
d5f7253206 Refactor sprockets asset paths to allow for alternate asset environments 2011-07-01 17:08:58 +09:30
Jon Leighton
cb99c8593a Remove AssociationReflection#create_association and AssociationReflection#create_association! - they are not called from anywhere. 2011-06-30 23:39:58 +01:00
Jon Leighton
0e225ec583 Assign the association attributes to the associated record before the before_initialize callback of the record runs. Fixes #1842. 2011-06-30 23:39:58 +01:00
Aaron Patterson
6a283d598f match method signature of the superclass 2011-06-30 15:31:23 -07:00
Aaron Patterson
8e19a5dc4c call super rather than delegating to the other objects equal? method 2011-06-30 15:31:22 -07:00
Aaron Patterson
2545da6dd6 just alias eql? to == for frewer method calls 2011-06-30 15:31:22 -07:00
Aaron Patterson
f7bd07b62a only calculate method name once 2011-06-30 15:31:22 -07:00
Aaron Patterson
f261ef42cc cache the plural name on the reflection so we do not pay pluralize costs on joins 2011-06-30 15:31:22 -07:00
Santiago Pastorino
2ebc564394 Depend on edge version of sass-rails 2011-06-30 18:27:02 -03:00
Santiago Pastorino
fb44101bb2 Depend on edge version of coffee-rails 2011-06-30 18:12:49 -03:00
Vijay Dev
5fe67fa7a3 update doc about resetting the session in case of authenticity token mismatch 2011-07-01 00:00:38 +05:30
Jon Leighton
9eabbabe74 Document the change to Array.wrap's behaviour that was made in b4d8c7d148 2011-06-30 18:18:13 +01:00
José Valim
9c9ec2172e Make sure respond_with with :js tries to render a template in all cases 2011-06-30 11:47:36 -03:00
Bogdan Gusiev
0fdac01876 Fixed ActionView::FormOptionsHelper#select with :multiple => false 2011-06-30 16:27:01 +03:00
Santiago Pastorino
35cdd256c0 Master version is 3.2.0.beta 2011-06-30 10:18:36 -03:00
Santiago Pastorino
a2a7a19d26 Bump up rack-cache and tzinfo 2011-06-30 10:07:26 -03:00
Santiago Pastorino
20ffd43ab4 Allow CI to use the latest rubygems version 2011-06-30 08:32:53 -03:00
Santiago Pastorino
452922a359 Update CI config 2011-06-30 08:26:25 -03:00
José Valim
f34f0b7e08 Add has_key? and key? methods to CookieJar removed in 0ca69ca65f 2011-06-30 08:01:53 -03:00
José Valim
d1b6188316 Merge pull request #1690 from vijaydev/mattr_accessor_changes
Added instance_accessor: false to Module#mattr_accessor
2011-06-30 03:50:47 -07:00
Vijay Dev
7744177919 Revert "Included w3c_validators gem and modified Migrations file"
This reverts commit 1028226b00.

Reason: No code changes can be done in docrails.
2011-06-30 12:50:05 +05:30
Daniel Dyba
b367f961bb Merge pull request #49 from dyba/master
Separated the ActiveRecord Supported Types in a separate section
2011-06-29 23:21:09 -07:00
Daniel Dyba
1028226b00 Included w3c_validators gem and modified Migrations file 2011-06-29 23:04:02 -07:00
Santiago Pastorino
539752a54c Move Coffee generators and templates to Coffee Railtie and create javascript_engine ("js") for apps that remove Coffee gem 2011-06-29 21:16:09 -03:00
Jon Leighton
4d256bc6b1 CommandRecorder should delegate in method_missing where possible. Fixes some tests in migration_test.rb under mysql. The problem was introduced in c278a2c5e1. 2011-06-30 00:47:35 +01:00
Jon Leighton
b4d8c7d148 Array.wrap should follow Kernel#Array semantics when the object's to_ary is nil. In this case, the object should be wrapped. 2011-06-30 00:21:42 +01:00
Jon Leighton
e9fa602e1c Define to_ary on ActiveRecord::Base to return nil. Improve performance of Array#flatten under 1.9, see comment for details. 2011-06-30 00:20:54 +01:00
Xavier Noria
9378d7e213 sub suffices here 2011-06-29 23:46:58 +02:00
Aaron Patterson
1d43409d32 Revert "Delegate to @flashes with 'delegate' instead of manually."
This reverts commit 701e8554a8.
2011-06-29 13:52:44 -07:00
José Valim
3dedf5f0e2 Merge pull request #1909 from r00k/master
Use 'delegate' macro instead of writing out methods by hand
2011-06-29 12:34:16 -07:00
Ben Orenstein
701e8554a8 Delegate to @flashes with 'delegate' instead of manually. 2011-06-29 15:16:57 -04:00
José Valim
c49d1f2b26 Merge pull request #1899 from ihower/patch_rake_test
Make "rake test" display not only task name but also exception message.
2011-06-29 10:01:13 -07:00
José Valim
d677097eb6 Fix configurable cristalization and tests. 2011-06-29 13:57:59 -03:00
Wen-Tien Chang
db87e48b5e Add test to rake test for error messages 2011-06-30 00:09:00 +08:00
José Valim
c690b7124d [IMPORTANT] Make "sprockets/railtie" require explicit.
This makes "sprockets/railtie" explicit. This means that sprockets will
be loaded when you require "rails/all". If you are not using requiring
"rails/all", you need to manually load it with all other framework
railties.

In order to be complete, this commit also adds --skip-sprockets to
the rails generator.
2011-06-29 09:41:16 -03:00
José Valim
4106245530 Merge pull request #1897 from istewart/active_model_dirty_patch
ActiveModel::Dirty patch for multiple assignments to the same attribute
2011-06-29 02:48:55 -07:00
Wen-Tien Chang
89ad0629e0 Make "rake test" display not only task name but also exception message. 2011-06-29 17:15:55 +08:00
Ian Stewart
eafa174bfd changing an attribute multiple times retains the correct original value 2011-06-28 22:18:24 -07:00
Aaron Patterson
31536855ae Merge pull request #1883 from arunagw/time_zone_fix
Using not effected timezone in tests.
2011-06-28 16:53:33 -07:00
Akira Matsuda
7d3a61a0e2 correct invalid HAVING query
* GROUP BY value must appear in SELECT clause
* ("created_at < ?", 1.month.ago) wasn't a very good example for HAVING. you'd better use WHERE for such a simple condition
2011-06-29 08:36:04 +09:00
Akira Matsuda
cfab51c819 correct invalid GROUP BY query
GROUP BY value must appear in SELECT clause
2011-06-29 08:09:02 +09:00
Santiago Pastorino
ff9566caf2 Merge pull request #1886 from arunagw/fix_test_for_jruby_db
fix test when running Jruby. If Jruby Platform is available the gem will
2011-06-28 14:59:38 -07:00
Aaron Patterson
59e38803e9 Merge pull request #1574 from oriolgual/1571_ar_relation_order_no_longer_works_with_arel_nodes
Fix #1571 ActiveRecord::Relation#order no longer works with arel ordering nodes
2011-06-28 14:55:15 -07:00
Arun Agrawal
2b046e7c39 fix test when running Jruby. If Jruby Platform is available the gem will change. 2011-06-29 02:41:52 +05:30
Aaron Patterson
931cf17c33 Merge pull request #1882 from rsim/fix_test_finding_with_cross_table_order_and_limit
Fix test_finding_with_cross_table_order_and_limit for Oracle
2011-06-28 13:48:53 -07:00
Oriol Gual
56ac32ad51 Fix case 2011-06-28 22:31:24 +02:00
Oriol Gual
2e0840dd04 Update reverse order with new Arel Nodes 2011-06-28 22:22:26 +02:00
Arun Agrawal
cd48bd2478 Using not effected timezone in tests. 2011-06-29 01:47:56 +05:30
Oriol Gual
eb933f0154 Add more test cases 2011-06-28 22:10:51 +02:00
Oriol Gual
e174923d29 Add failing test 2011-06-28 22:10:50 +02:00
Raimonds Simanovskis
f838b47b87 Fix test_finding_with_cross_table_order_and_limit for Oracle
Use latest Arel syntax and pass each order by expression as separate argument to order method as otherwise invalid Oracle SQL is generated.
2011-06-28 23:04:42 +03:00
Aaron Patterson
941d5c1f40 Merge pull request #1857 from vijaydev/irreversible-migration
IrreversibleMigration is not raised when a method not supported by reversible migrations is called in the change method of a migration
2011-06-28 12:05:19 -07:00
Aaron Patterson
a5cb5a5af6 Merge pull request #1860 from dmathieu/comparison
Allow comparison on model objects - Closes #1858
2011-06-28 11:46:25 -07:00
Aaron Patterson
26caf32949 remove useless assignment 2011-06-28 10:57:56 -07:00
Aaron Patterson
13e79eb6c3 lock_optimistically is typically true, so evaluate the common failure case first 2011-06-28 10:51:23 -07:00
Aaron Patterson
02f45d6e0c reduce object allocation during AR instantiation 2011-06-28 10:22:39 -07:00
José Valim
c290900a77 Merge pull request #1878 from arunagw/mime_test_fix
Removing image/gif from this test.
2011-06-28 05:55:50 -07:00
Arun Agrawal
8c1f62acda No need to register again. As it's default now.
Removing gif from here because when it got unregister it start failing other places.
2011-06-28 18:20:28 +05:30
José Valim
71d7c52019 Update railties.gemspec 2011-06-28 09:35:46 -03:00
José Valim
e3053ee753 Copy the bin to railties so it also works if you don't have the rails gem. 2011-06-28 09:09:46 -03:00
José Valim
0a873627e4 Merge pull request #1877 from arunagw/fix_mime
Fix test to use Mime::Zip
2011-06-28 04:58:29 -07:00
Arun Agrawal
1b957177e7 Fix test to use Mime::Zip 2011-06-28 16:51:19 +05:30
José Valim
76581d0f1b Edited actionpack/CHANGELOG via GitHub 2011-06-28 02:45:27 -07:00
José Valim
4f372cf4d9 Merge pull request #1875 from esad/master
Fixed issue #1847
2011-06-28 02:44:04 -07:00
Esad Hajdarevic
2a61d47b55 Make send_file guess content-type from file extension, if type wasn't supplied (Issue #1847). Update tests & documentation. 2011-06-28 06:58:28 +02:00
Esad Hajdarevic
d73269ba53 Register some commonly used mime types (png, jpeg, pdf, zip etc.) per default 2011-06-28 06:56:47 +02:00
Aaron Patterson
9921eca51c remove the check for needs_type_condition? because ensure_proper_type will pick up the type column 2011-06-27 20:44:39 -07:00
Aaron Patterson
4006e738ed stop using && for the short circuit side effect 2011-06-27 18:16:01 -07:00
Aaron Patterson
4ec47cac10 let strings be converted to symbols inside the interpreter 2011-06-27 18:15:28 -07:00
Aaron Patterson
9152126110 avoice paying hash cost if there are no serialized attributes 2011-06-27 17:46:56 -07:00
Aaron Patterson
45b7209f1f cache column defaults for AR object instantiation 2011-06-27 17:45:34 -07:00
Aaron Patterson
06d4247f02 AR object instantiation is ~30% faster in the simple case 2011-06-27 16:15:34 -07:00
Ryan Bigg
6a1803a14f [asset pipeline] Add production assets section 2011-06-28 08:25:14 +10:00
Ryan Bigg
9959fa2d15 [asset pipeline] Add examples of javascript_include_tag and stylesheet_link_tag 2011-06-28 08:24:59 +10:00
Ryan Bigg
703b00947d [Asset pipeline] Move external assets section down to 'Adding assets to your gems' section 2011-06-28 08:22:38 +10:00
Ryan Bigg
49bb053b17 [asset pipeline] production assets covered later in the guide 2011-06-28 08:15:41 +10:00
Ryan Bigg
87a709846e [asset pipeline] sections at the bottom of the asset pipeline guide should all be toplevel 2011-06-28 08:15:04 +10:00
Ryan Bigg
fb7ea76c1b [asset pipeline] Mention that hashed files are also picked up by Sprockets 2011-06-28 08:09:04 +10:00
Ryan Bigg
22b508d961 [asset pipeline] Cascade -> Cascading 2011-06-28 07:55:14 +10:00
Aaron Patterson
5ddb60f2b3 initialize instance variables 2011-06-27 14:47:11 -07:00
Aaron Patterson
6054c092dc oops! remove debugging codes 2011-06-27 14:46:56 -07:00
Aaron Patterson
997aed24be default create_with_value to a hash so we can eliminate conditionals, add test surrounding create_with(nil) behavior 2011-06-27 14:18:49 -07:00
Aaron Patterson
506b2dad55 Merge pull request #1871 from guilleiguaran/arel-2-1-3
Bump ARel to 2.1.3
2011-06-27 14:06:00 -07:00
Santiago Pastorino
4bcb05de2d Merge pull request #1870 from chriseppstein/asset_urls_master
Asset urls master
2011-06-27 14:01:34 -07:00
Xavier Noria
a0960ec2d4 the generated ALT attribute for images no longer contains the digest, if any 2011-06-27 23:00:05 +02:00
Chris Eppstein
024bed387b Added a configuration setting:
config.action_controller.default_asset_host_protocol

It's best to leave this unset.

When unset the :request protocol is used whenever it can be and
:relative is used in the other situations.

When set to :request then assets hosts will be disabled when there
is no request in scope and will use the request protocol whenever a
request is in scope.

If set to :relative, then a relative protocol is always used except
for stylesheet link tags which must use the :request protocol to
avoid double downloads in IE6&7.

Conflicts:

	actionpack/lib/sprockets/helpers/rails_helper.rb
	actionpack/test/template/sprockets_helper_test.rb
2011-06-27 13:58:51 -07:00
Guillermo Iguaran
1c23887ab0 Bump ARel to 2.1.3 2011-06-27 15:58:40 -05:00
Chris Eppstein
2cc1bc3773 Move the config bootstrapping to initialization to minimize access to the Rails.application global. 2011-06-27 13:55:10 -07:00
Chris Eppstein
6c64e1e3a3 Stylesheet link tags should use the request protocol to avoid duplicate download of stylesheets in IE7 and IE8.
Conflicts:

	actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
	actionpack/lib/sprockets/helpers/rails_helper.rb
2011-06-27 13:54:54 -07:00
Chris Eppstein
96137e8bd0 Add asset_url helper and refactor the asset paths so that asset hosts can be used during asset precompilation.
Conflicts:

	actionpack/lib/action_view/asset_paths.rb
	actionpack/lib/sprockets/helpers/rails_helper.rb
	actionpack/test/template/sprockets_helper_test.rb
2011-06-27 13:48:36 -07:00
Vijay Dev
adf334853f fix javascript case 2011-06-28 02:16:56 +05:30
Chris Eppstein
266b80c7b2 OrderedOptions must implement respond_to? if it implements method_missing. 2011-06-27 13:44:53 -07:00
David Heinemeier Hansson
f63f0baa59 Add JavaScript Runtime name to the Rails Info properties (thanks Sam Ruby) 2011-06-27 11:59:46 +02:00
David Heinemeier Hansson
449cc3e999 Merge pull request #1481 from arunagw/lib_assets
Generating /lib/assets  for assets
2011-06-27 02:16:24 -07:00
Matt Jankowski
2fd1f2e843 clarify which url would be used to cache a page when options are not provided to #cache_page to determine that url 2011-06-26 19:44:55 -04:00
Matt Jankowski
eccd5cb610 elaborate on how web server configuration to check for static files on disk enables page caching to work without hitting the app server stack 2011-06-26 19:41:49 -04:00
Ray Baxter
8c110387f4 correct error message for failed creation 2011-06-26 15:16:29 -07:00
Vijay Dev
732690589e minor changes 2011-06-27 00:12:39 +05:30
Vijay Dev
798aa881af minor indentation fixes on a6293ff 2011-06-26 17:06:19 +05:30
Damien Mathieu
eb22c51173 comparing different classes returns nil 2011-06-26 09:41:30 +02:00
Damien Mathieu
bc743dc1ce allow comparison on model objects - Closes #1858 2011-06-26 09:41:08 +02:00
Ryan Bigg
5f5feb27b6 Update changelog for querying guide 2011-06-26 15:54:12 +10:00
Ryan Bigg
a6293ff259 Querying guide: add mention of scoped, unscoped and default_scope to querying guide 2011-06-26 15:41:11 +10:00
Ryan Bigg
1b089a083f Refer to sprockets + jammit as libraries, not gems 2011-06-26 15:41:11 +10:00
Vijay Dev
532c294dea replace find(all) with all 2011-06-26 02:24:35 +05:30
Santiago Pastorino
095f0466c8 Merge pull request #1861 from dchelimsky/fixture_path
Get the fixture_path from self.class instead of ActiveSupport::TestCase.
2011-06-25 12:12:49 -07:00
David Chelimsky
a7af1e0051 Get the fixture_path from self.class instead of ActiveSupport::TestCase.
This allows test classes that are not subclasses of
ActiveSupport::TestCase (like those in rspec-rails) to interact with
with this variable without having to reference ActiveSupport::TestCase.
2011-06-25 13:59:49 -05:00
Vijay Dev
5a79ca660a fix typo in method name 2011-06-25 18:47:51 +05:30
Vijay Dev
2332aa6e18 Revert "add missing methods supported by reversible migrations using the change method"
This reverts commit 7f91eebae3.

Reason: Incorrect documenting. The newly added methods to the list are
not actually supported by reversible migrations.
2011-06-25 18:45:41 +05:30
Xavier Noria
211fa2d28d Merge pull request #1853 from arunagw/string_parameterize
StringToParameterizeWithNoSeparator: dashed parameter will not change.
2011-06-25 06:05:11 -07:00
Vijay Dev
c278a2c5e1 record unsupported methods in CommandRecorder instead of letting the unsupported methods go through to the underlying db causing errors like duplicate columns to occur when rolling back migrations 2011-06-25 17:17:02 +05:30
Arun Agrawal
4700e1fe6e StringToParameterizeWithNoSeparator: dashed parameter will not
change.
2011-06-25 06:17:00 +05:30
Xavier Noria
7e56bf7244 registers support for acronyms in the CHANGELOG of Active Support 2011-06-24 23:28:30 +02:00
Xavier Noria
370b380306 Merge pull request #1648 from dlee/acronyms
Inflector support for acronyms (Issue #1366)
2011-06-24 14:19:42 -07:00
James Cox
d446c798a5 make the logs a little simpler to view, put the render message inline with other events, pull processing to char[0] and add a new line to the completed. looks more like a block now, which is useful for serial actions like test/dev 2011-06-24 13:10:06 -07:00
Santiago Pastorino
d6413f043c Merge pull request #1848 from raviolicode/postgresql_order_multiple_params
Fix for complex ordering of multiple columns on postgresql
2011-06-24 13:09:33 -07:00
Lucia Escanellas
9734a416fa Improve ordering of multiple columns on postgresql
* Only on postgresql, order("first asc, second asc") was invalid
* Closes #1720
2011-06-24 13:37:08 -03:00
Mohammad Typaldos
837a74bc0f Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-24 06:33:59 -07:00
Vijay Dev
7f91eebae3 add missing methods supported by reversible migrations using the change method 2011-06-24 12:31:14 +05:30
Santiago Pastorino
7ca1a3d2aa Merge pull request #1840 from wildchild/master
Minor formatting fix
2011-06-23 16:47:56 -07:00
Alexander Uvarov
e945497955 Minor formating fix 2011-06-24 03:52:39 +06:00
José Valim
4389fc9733 Merge pull request #1829 from wildchild/master
Allow to specify roles for mass-assignment as array
2011-06-23 13:37:39 -07:00
Jon Leighton
87d6865bf7 Apply the default scope earlier when doing calculations. Fixes #1682. 2011-06-23 19:57:49 +01:00
Alexander Uvarov
ee044ea547 Follow rails convention by using Array.wrap 2011-06-23 23:06:52 +06:00
Alberto Perdomo
f1d77bad26 Action Mailer Basics Guide: Added example on using mail(:template_path => ..., :template_name => ...) to specify custom template files. 2011-06-23 17:57:48 +01:00
Aaron Patterson
8a1319dec0 Merge pull request #1835 from metaskills/ss_rake_master
Update SQL Server DB Rake Tasks
2011-06-23 09:45:59 -07:00
Ken Collins
b9bfb916e4 Update SQL Server db related rake tasks.
* Uses open source smoscript since scptxfr came out in 2000.
  * Uses sqlcmd which replaces osql.
  * Takes advantage of host/user/pass passed down by TinyTDS.
2011-06-23 12:41:39 -04:00
Xavier Noria
1f505a8ef2 Merge branch 'master' of git://github.com/lifo/docrails 2011-06-23 18:08:11 +02:00
José Valim
d49622a1f2 Edited actionpack/actionpack.gemspec via GitHub 2011-06-23 07:38:41 -07:00
José Valim
5839122059 Merge pull request #1830 from arunagw/enum_fixes
Fixed Failing test : It should be Enumerable::Enumerator
2011-06-23 05:51:00 -07:00
Arun Agrawal
deb60a738c Using slice for instead of gsub to pass with 1.8.7 2011-06-23 18:17:37 +05:30
Mikhail Dieterle
06fe01a337 updated rspec link 2011-06-23 03:08:32 -07:00
Alexander Uvarov
528f405cdc Allow to specify mass-assignment roles as array 2011-06-23 12:56:39 +06:00
Santiago Pastorino
87b548ccac Minor refactor 2011-06-23 00:35:54 -03:00
Santiago Pastorino
22e86c10d8 fixtures :all is already included in test_helper.rb 2011-06-23 00:35:25 -03:00
Santiago Pastorino
7f6eed0447 Merge pull request #1796 from jdeseno/master
link_to doesn't allow rel attribute when also specifying method
2011-06-22 20:34:33 -07:00
Jon Guymon
618300f05a Log instrumentation name for exists? queries 2011-06-22 13:41:34 -07:00
Santiago Pastorino
6b3342d971 Merge pull request #1798 from jeroenj/cachesweeper-fix
Fixes an issue where cache sweepers with only after filters would have no controller object
2011-06-22 10:48:19 -07:00
Joshua Peek
a1f8421060 Revert "Bump sprockets requirement"
This reverts commit 458512c8fa.
2011-06-22 11:29:11 -05:00
Jeroen Jacobs
93ff522120 Tests only after filters in cache sweepers 2011-06-22 18:00:46 +02:00
José Valim
16894982e3 Update CHANGELOG. 2011-06-22 12:52:46 -03:00
Aaron Patterson
09866cef17 Merge pull request #1790 from ernie/reverse_sql_order_fix
Support reversal of ARel orderings in reverse_sql_order
2011-06-22 08:30:52 -07:00
Matt Jankowski
3eaed28c5f grammar changes in named routes description and clarity around possibilities for options 2011-06-22 11:00:56 -04:00
Vijay Dev
95f827f910 font style changes in perf guide 2011-06-22 19:40:51 +05:30
Xavier Noria
5654f6870a Merge pull request #1750 from dmathieu/non_string_methods
Calling unsafe methods which don't return a string shouldn't fail
2011-06-22 06:30:56 -07:00
Matt Jankowski
3cfbf544ea grammar changes to log subscriber docs 2011-06-22 09:27:22 -04:00
Damien Mathieu
9fadf385d8 calling unsafe methods which don't return a string shouldn't fail 2011-06-22 15:26:21 +02:00
Matt Jankowski
32de3b8119 move example code to be above reconfiguring discussion; add clarity about silencers and filters; misc grammar changes - for backtrace cleaners 2011-06-22 09:06:05 -04:00
José Valim
53444b861c Merge pull request #1813 from arunagw/jruby_tests
Tests Added for jdbc option added for Jruby
2011-06-22 05:02:52 -07:00
Mikhail Dieterle
98623a061e Fixed typo 2011-06-22 03:04:28 -07:00
José Valim
3c8c379848 Merge pull request #1778 from spohlenz/hash-models
Fix nested fields_for when Hash-based model is passed.
2011-06-22 02:33:12 -07:00
Arun Agrawal
3534ea8d50 Tests added when no option is given with #jruby. It should generate
sqlite3 based app
2011-06-22 08:43:34 +05:30
Arun Agrawal
b2a19ad90b Making tests according to the changes #jruby 2011-06-22 08:15:12 +05:30
Arun Agrawal
b7bce739b1 Test added for jdbc-adapter 2011-06-22 08:04:18 +05:30
Sam Pohlenz
237f87089c Use real hash model in nested fields_for with hash model test 2011-06-22 10:54:45 +09:30
Aaron Patterson
6404f8a194 Merge pull request #1811 from nicksieger/more-jruby-gem-for-database-fixes-master
More jruby gem for database fixes master
2011-06-21 13:39:18 -07:00
Nick Sieger
a85b9fafd1 Use non-'jdbc*' names so that db:create and db:drop work 2011-06-21 13:34:10 -07:00
Nick Sieger
4dd2d07d4a Convert database names to ones appropriate for JRuby 2011-06-21 13:34:07 -07:00
Nick Sieger
f12f756473 Add generic 'jdbc' database option 2011-06-21 13:34:03 -07:00
Nick Sieger
2b0b7260c7 Remove superfluous pg driver install instructions 2011-06-21 13:34:01 -07:00
Matt Jankowski
db4f0ac025 use present tense on examples 2011-06-21 15:12:11 -04:00
Caius Durling
96be08de25 Stop find_in_batches using the records after yielding.
Currently if the code that calls .find_in_batches modifies the yielded array in place then .find_in_batches can enter an infinite loop searching with ruby object ids in the database instead of the primary key of records in the database. This happens because it naively assumes the yielded array hasn't been modified before calling #id on the last object in the array. And ruby (1.8 at least) alias' #id to #object_id so an integer is still returned no matter what the last object is.

By moving finding the #id of the last object before yielding the array it means the calling code can do whatever it wants to the array in terms of modifying it in place, and .find_in_batches doesn't care.
2011-06-21 19:55:21 +01:00
José Valim
d6f1291f48 Require helpers so autoload is properly setup. 2011-06-21 15:21:21 -03:00
Aaron Patterson
ceb5bbbafc Merge pull request #1632 from tardate/pg_schema_fu
Improving PostgreSQL adapter schema-awareness
2011-06-21 10:22:20 -07:00
José Valim
e369682ef1 Merge pull request #1793 from jamesarosen/clean_images
rake assets:clean also removes directories
2011-06-21 10:00:31 -07:00
James A. Rosen
7ca14ea398 Railties: added tests for rake assets:clean 2011-06-21 09:51:18 -07:00
Joshua Peek
458512c8fa Bump sprockets requirement 2011-06-21 11:27:06 -05:00
James A. Rosen
d26cf14605 rake assets:clean also removes directories
See https://github.com/rails/rails/pull/1776#issuecomment-1402894,
2df2bfdb4b, and
7440a254c4.
2011-06-21 09:24:03 -07:00
José Valim
e1b32e701e Merge pull request #1803 from guilleiguaran/uglifier-1-0
Use uglifier from rubygems instead of git repo
2011-06-21 09:17:01 -07:00
José Valim
370b5c14ff Don't use deprecated stuff. 2011-06-21 13:06:23 -03:00
Guillermo Iguaran
d759d19507 Use uglifier from rubygems instead of git repo 2011-06-21 10:59:48 -05:00
Josh
9c1d0d88a7 Adds a test to check link_to with method & rel options 2011-06-21 07:49:10 -07:00
Matt Jankowski
620bee45fe more detail on how the flow between redirect and show works, and minor grammar 2011-06-21 10:47:37 -04:00
Joshua Peek
4a2b3275a1 Assign Rails.cache to sprockets 2011-06-21 09:39:37 -05:00
Matt Jankowski
538d2a52ce remove extra space and clarify how an exception is made for controller wide layouts 2011-06-21 10:34:31 -04:00
Matt Jankowski
20a9bddfad reorder layout selection examples to occur in the order that the code does, and provide more detail on why each selection is made 2011-06-21 10:31:16 -04:00
José Valim
5a26b88645 Create an :assets group in the Gemfile.
This group is required by default only on development and test
(you can change it on config/application.rb).

`rake assets:precompile` will automatically add the assets group
to Rails.groups (and consequently Bundler.require) and should work
transparently.
2011-06-21 11:24:06 -03:00
José Valim
354709fe89 Rename AV::Helpers::AssetPaths to AV::AssetPaths to solve autoload mess. 2011-06-21 11:24:05 -03:00
José Valim
a803aec00d Add Rails.groups to encapsulate available groups for require. 2011-06-21 11:24:05 -03:00
Matt Jankowski
100b675cba singularize module and be explicit about what is delivered 2011-06-21 10:20:01 -04:00
Matt Jankowski
f3db04f69b grammar (missing "a") and formatting 2011-06-21 09:12:34 -04:00
Matt Jankowski
4f433bcd8d clarify why the only_path => false option is needed when default :host has been set for mailers 2011-06-21 09:10:52 -04:00
Matt Jankowski
1f4fb6f635 elaborate details on why to use _url instead of _path in mailers 2011-06-21 09:04:28 -04:00
Mohammad Typaldos
c01c954c20 Added Gzip to Asset Pipeline via GitHub 2011-06-21 04:23:35 -07:00
Jeroen Jacobs
791127eee4 Fixes an issue where cache sweepers with only after filters would have no controller object
It would raise undefined method controller_name for nil
2011-06-21 12:34:00 +02:00
Mohammad Typaldos
fcebf9fd93 Sprockets itself doesn't compress 2011-06-20 23:29:39 -07:00
Mohammad Typaldos
2d4d9f1937 Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-20 23:23:55 -07:00
Josh
40e6f437e8 Allow additional link relations when using method attribute with link_to 2011-06-20 22:17:53 -07:00
José Valim
8a889dd45e Merge pull request #1786 from gazay/3-1-stable-regexp-fix
Fix regexp in generators for right catching error message
2011-06-20 14:35:30 -07:00
Alexey Gaziev
91bbb8e956 Removed tests for rescue branch for Rails 2.x compatibility 2011-06-20 22:29:30 +04:00
Ernie Miller
08f3f30994 Support reversal of ARel orderings in reverse_sql_order 2011-06-20 14:15:19 -04:00
José Valim
ac78ff76ad Merge pull request #1787 from cmeiklejohn/make_fragment_for_more_robust_for_subclasses_of_safe_buffer
fragment_for assumes ActionView::OutputBuffer.
2011-06-20 11:01:33 -07:00
Christopher Meiklejohn
a52e4189b5 Only mark the sliced buffer as safe, if it was safe to begin with. 2011-06-20 13:52:21 -04:00
Christopher Meiklejohn
d12aa483f2 Streamline fragment_for SafeBuffer logic to make it more concise. 2011-06-20 13:20:42 -04:00
Alexey Gaziev
78cd3f9ec2 Removed rescue branch for Rails 2.x compatibility 2011-06-20 20:13:52 +04:00
Alexey Gaziev
ca044113f3 Fix regexp in generators for right catching error message 2011-06-20 19:54:37 +04:00
José Valim
81f7bf55c7 Merge pull request #1785 from medwezys/master
Do not change a frozen text passed to simple_format text helper
2011-06-20 07:01:47 -07:00
Tadas Tamosauskas
f292f0971f Do not change a frozen text passed to simple_format text helper 2011-06-20 14:51:07 +01:00
José Valim
89b3293a54 Merge pull request #1784 from gazay/3-1-stable-shadowing-variables
Removing shadowing outer local variables warnings
2011-06-20 06:48:17 -07:00
Alexey Gaziev
93f488e7fa Removed shadowing variable warning in activerecord railties 2011-06-20 17:28:59 +04:00
Alexey Gaziev
87329ef67f Removed warnings about shadowing variables 2011-06-20 17:22:09 +04:00
José Valim
b7c8e0bb0c Merge pull request #1780 from dazuma/fix_missing_require_set
Add missing require 'set'
2011-06-20 04:37:37 -07:00
Arun Agrawal
d3b7f4912b Closing </yaml> 2011-06-20 15:24:41 +05:30
Daniel Azuma
140ba34aa9 Add missing require 'set' 2011-06-20 00:24:35 -07:00
Sam Pohlenz
e69eed0e10 Test for extractable_options? within nested fields_for.
This fixes an error when a record object that is a subclass of Hash is
passed to fields_for, which is incorrectly interpreted as field options.
2011-06-20 11:50:44 +09:30
Joshua Peek
2df2bfdb4b Merge pull request #1776 from jamesarosen/clean_images
assets:clean task now cleans up images
2011-06-19 19:09:50 -07:00
James A. Rosen
7440a254c4 assets:clean task now cleans up images 2011-06-19 18:40:17 -07:00
Santiago Pastorino
4131fd7c79 Call super here to allow SessionHash initialize new stuff for us 2011-06-19 22:00:22 -03:00
Vijay Dev
5eac40bb75 document Active Record's reverse_order method 2011-06-20 02:12:21 +05:30
Vijay Dev
9513474e5e AR: use where in place of find 2011-06-20 01:42:43 +05:30
Vijay Dev
d1b448ed3f minor changes in getting started guide 2011-06-20 01:24:04 +05:30
Vijay Dev
427b07baa1 document the instance_reader option for class_attribute 2011-06-20 00:36:52 +05:30
José Valim
93b7da478b Merge pull request #1770 from arunagw/require_relative_remove
Removing require_relative gem. Linecache new version 0.46 is out and it's
2011-06-19 04:51:42 -07:00
Xavier Noria
ed4be0a3a4 explains why links are gsub'ed, and changes the regexp delimiters 2011-06-19 11:45:36 +02:00
Arun Agrawal
41aba82673 Removing require_relative gem. Linecache new version 0.46 is out and it's loading rbx-require-relative > 0.0.4 2011-06-19 15:05:38 +05:30
JudeArasu
d0c4fd75f2 typo changes 2011-06-19 12:14:00 +05:30
José Valim
e6f15f0553 Ugh, the class_attribute pull request broke the build. fix it. 2011-06-19 00:06:48 -03:00
José Valim
7d4606156b Merge pull request #1763 from grantneufeld/schema_column_exists_options_hash
Fix default options argument on ActiveRecord::ConnectionAdaptors::Table#column_exists?
2011-06-18 19:34:39 -07:00
José Valim
4054435b28 Merge pull request #1764 from stevehodgkiss/master
Fix inconsistencies with serving images in production mode when ActiveRecord is loaded
2011-06-18 19:31:17 -07:00
José Valim
b1b42b55e2 Merge pull request #1765 from bensie/class_attribute_skip_reader
Add option to omit creating an instance reader method on class_attribute
2011-06-18 19:29:38 -07:00
Paul Gallagher
2b3d67fdaf Merge remote branch 'rails/master' into pg_schema_fu 2011-06-19 10:21:15 +08:00
Paul Gallagher
b0d59907f7 Make PostgreSQL adapter view-compatible
* amongst other things, allows meta_search to run against view-backed models
2011-06-19 10:14:17 +08:00
James Miller
0ce5fb8a27 Add option to omit creating an instance reader method on class_attribute 2011-06-18 15:49:11 -07:00
Mohammad Typaldos
8d64aafa98 Consistency issues with pre-processor 2011-06-18 15:13:41 -07:00
Xavier Noria
6c705e33ef Merge pull request #1762 from vijaydev/readme_links_rdoc
Solving the problem of links being broken in GitHub for the sake of api site
2011-06-18 15:02:31 -07:00
Steve Hodgkiss
50444204cc Fix inconsistencies by being polite to the wrapped body. Needed for Rack::Sendfile to function properly. See issue #1761. 2011-06-18 22:30:01 +01:00
Grant Neufeld
3cc83a8f24 Changed the default value for the options argument on ActiveRecord::ConnectionAdapters::Table#column_exists? from nil to an empty Hash {}.
That method calls through to ActiveRecord::ConnectionAdapters::SchemaStatements##column_exists? expects options to be a Hash.

When options was nil, an error would occur in cases where the column did exist because the called method attempted to perform a key lookup on options.
2011-06-18 14:38:38 -06:00
Mohammad Typaldos
04daede85d Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-18 11:57:15 -07:00
Mohammad Typaldos
8bb7c86396 Let the reader know what JS and CSS stand for. Slight rewording as well. 2011-06-18 11:48:00 -07:00
Vijay Dev
96c57d4bd0 To solve the problem of links being broken in GitHub for the sake of api site, have them replaced at runtime during rdoc generation 2011-06-18 23:45:59 +05:30
Vijay Dev
5225227110 edit assets guide for cases & minor wording changes 2011-06-18 22:19:32 +05:30
Mohammad Typaldos
618802df71 Sprockets itself doesn't do this, it's uglifier and other gems, Sprockets is just the puppet master. 2011-06-18 09:00:13 -07:00
Mohammad Typaldos
4a36817b5d Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-18 08:58:38 -07:00
Xavier Noria
add848230b Merge pull request #48 from scott-stewart/master
Fixed typos in asset_pipeline
2011-06-18 06:53:19 -07:00
Scott Stewart
a637e1dcb1 Fixed typo in asset_pipeline, jquery_rails should be jquery-rails 2011-06-18 06:40:27 -07:00
Scott Stewart
0a45e24879 Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-18 06:31:22 -07:00
Leonard Garvey
38aa153f9e Merge github.com:lifo/docrails 2011-06-18 21:20:19 +10:00
Leonard Garvey
fb9bfc2430 Fixed a typo in asset pipeline 2011-06-18 21:15:49 +10:00
Ryan Bigg
4f301b2540 Fix indentation on manifest examples in assets guide 2011-06-18 21:11:15 +10:00
Ryan Bigg
d746aea6f9 File needs to be at public/assets, not public/images 2011-06-18 21:10:21 +10:00
Vijay Dev
2fbb7504e2 Revert changes done in c56618ec, 51cb7459 and 030950a. The links are
pointing to files/*/*.html for usage in api.rubyonrails.org and as a
result are broken in GitHub blobs. This is unavoidable (at least for now).
2011-06-18 16:02:50 +05:30
Ryan Bigg
c8f046bd45 Flesh out the asset pipeline guide with information learned from today's research 2011-06-18 19:45:31 +10:00
Xavier Noria
20d7d2415f copy-edits 7c2db6c, cbf2af1, and f391f94 2011-06-18 10:22:34 +02:00
Xavier Noria
146ec2d1df Merge branch 'master' of git://github.com/lifo/docrails 2011-06-18 10:11:47 +02:00
Ryan Bigg
0fd52bb6c7 Added 'Configuring Assets' section to configuring guide 2011-06-18 11:16:10 +10:00
Jason Noble
030950a7ee Change ActiveRecord and ActionPack links to point to the right place 2011-06-17 14:13:54 -07:00
Jason Noble
51cb74596a Change ActiveRecord and ActionPack links to point to the right place 2011-06-17 14:13:30 -07:00
Jason Noble
c56618ec0d Change ActiveRecord and ActionPack links to point to the right place 2011-06-17 14:12:11 -07:00
Lucia Escanellas
144a388dec Update remove_index documentation
* Changes should better reflect present code behavior
* Related to issue: https://github.com/rails/rails/issues/1624
2011-06-17 16:30:40 -03:00
José Valim
08983fefd5 Attributes on scaffold and model generators default to string.
This allows the following: "rails g scaffold Post title body:text author"
2011-06-17 15:10:53 -03:00
Santiago Pastorino
9a64c8ec66 Merge pull request #1751 from guilleiguaran/mysql-0-3-6
Bump to mysql2 0.3.6
2011-06-17 10:22:34 -07:00
Guillermo Iguaran
301cad4476 Bump to mysql2 0.3.6 2011-06-17 11:27:37 -05:00
José Valim
0dd32e8edb Merge pull request #1748 from bogdan/select_form_helpers_refactor
Select tag helpers: remove some code dups
2011-06-17 07:09:10 -07:00
Jon Leighton
e510c2c642 Add require 'pathname' as it has not already been required in some circumstances 2011-06-17 14:55:34 +01:00
Bogdan Gusiev
69fdfab487 Select tag helpers: remove some code dups 2011-06-17 16:54:35 +03:00
Xavier Noria
248552e324 AS guide: expands safe string docs regarding destructive methods, coercion, copying, etc. 2011-06-17 10:57:33 +02:00
Aaron Patterson
ba1b88fda6 Merge pull request #1636 from metaskills/upstream/3-1-stable
Allow the connection pool's #table_exists? method to give the connections
2011-06-17 00:02:45 -07:00
Santiago Pastorino
da25aa5841 Merge pull request #1738 from gazay/3-1-stable-change-nokogiri-version
Fix several warnings: change version of nokogiri gem
2011-06-16 16:27:49 -07:00
Alexey Gaziev
171491b1eb Change version of nokogiri gem 2011-06-17 01:01:49 +04:00
José Valim
a788d4e6e9 Merge pull request #1737 from SAP-Oxygen/master-app_plugins_ordering_patch
Patch for [3.1.0.rc1] App plugins initialized before engines and plugins inside engines
2011-06-16 13:56:59 -07:00
Joseph Wong
29dfe05e07 Patch for #1458 - [3.1.0.rc1] App plugins initialized before engines
and plugins inside engines

It seems that plugins inside a Rails 3.1 application proper (i.e. in
/vendor/plugins) are initialized before engines and plugins inside
engines.

After some debugging, I found the culprit in
Rails::Application::Railties#all:

  def all(&block)
    @all ||= railties + engines + super
    @all.each(&block) if block
    @all
  end

The call to super here implicitly passes the &block argument, which
has the unfortunate side-effect of adding the plugin initializers
first (in front of other railties and engines) in the case of
Rails::Engine#initializers:

def initializers
  initializers = []
  railties.all { |r| initializers += r.initializers }
  initializers += super
  initializers
end

The solution here is to replace the super call with a call
to #plugins.
2011-06-16 13:24:33 -07:00
Jon Leighton
be99ae78c9 Perf fix - Use an instance variable instead of a class_attribute. Thanks @josevalim and @jhawthorn for the prompting. 2011-06-16 21:13:56 +01:00
José Valim
f44db45c87 safe_concat should not work on dirty buffers. 2011-06-16 17:04:31 -03:00
José Valim
594603b45f Fix safe buffer by adding a dirty status. 2011-06-16 16:49:41 -03:00
R.T. Lechow
6ca18f9037 Typo. 2011-06-16 15:44:21 -04:00
wycats
1844572fd1 Make the API for compression consistent between JS and CSS. By default, users just need to say whether they want compression or not, and a default will be chosen by a Railtie. In the case of CSS, this default is already chosen by the sass-rails gem.
Users can still explicitly choose a compressor in their application.rb if they have a preference, but will usually want to let plugins choose defaults in their Railties.
2011-06-16 12:09:36 -07:00
José Valim
b9fa32c75e Merge pull request #1733 from SAP-Oxygen/master-plugins_in_engine_patch
Cherry-picking patch for https://github.com/rails/rails/issues/1460 from 3-1-stable to master
2011-06-16 11:03:58 -07:00
Joseph Wong
245dba0c89 Cherry-picking patch for https://github.com/rails/rails/issues/1460
from 3-1-stable to master

[3.1.0.rc1] Plugins inside engines not eager-loaded properly and their
rake tasks ignored

Working with the new support for plugins inside engines in Rails 3.1,
I found that certain things that work for regular plugins don't work
for these new nested plugins. In particular, these methods in
Rails::Engine don't seem to understand that an engine could have
nested plugins:

#load_tasks
#load_generators
#load_console
#eager_load!

A solution which worked out for me is to move the calls to
railties.all { ... } from the overriding methods in Rails::Application
into Rails::Engine.
2011-06-16 10:52:05 -07:00
Vijay Dev
07d62ff719 minor clean up generators section 2011-06-16 22:49:06 +05:30
Vijay Dev
7c2db6ce37 add info that plugin installs need git or svn installed 2011-06-16 22:49:06 +05:30
Xavier Noria
885428887f Merge pull request #1731 from vijaydev/plugin_name_change
Replace dev.rubyonrails.com plugin url with a dummy url
2011-06-16 09:11:18 -07:00
Vijay Dev
d92ad224e0 replace dev.ror.com plugin url with a dummy one 2011-06-16 21:28:42 +05:30
Santiago Pastorino
eedbe1c827 Use html_safe 2011-06-16 12:46:11 -03:00
Arun Agrawal
13f8b28cdf Using lib/assets only. Javascripts/Stylesheets people can fill later. 2011-06-16 19:07:07 +05:30
José Valim
f2c0fb32c0 Remove usage of memoizable from ActionPack. 2011-06-16 08:01:35 -03:00
José Valim
8775ffa372 Update CHANGELOG, improve message. 2011-06-16 07:47:01 -03:00
José Valim
43ed24e23b Merge pull request #1727 from ihower/improve_legacy_wild_controller_route
Improve the legacy wild controller route in app templates
2011-06-16 02:11:35 -07:00
José Valim
7de3b362e3 Merge pull request #1725 from arunagw/mysql_bump
Bump mysql2 to 0.3.5
2011-06-16 01:59:34 -07:00
Vijay Dev
bfb022adae document doc:* rake tasks 2011-06-16 12:29:47 +05:30
Wen-Tien Chang
d7aac1f1e4 Also change the default route comment 2011-06-16 14:03:41 +08:00
Wen-Tien Chang
adbe7daab6 Improve the legacy wild controller route in app templates 2011-06-16 13:36:42 +08:00
Arun Agrawal
536e1566b6 Bump mysql2 to 0.3.5 2011-06-16 10:45:58 +05:30
JudeAr
cbf2af1e81 typo changes fixed 2011-06-15 22:15:53 -07:00
JudeAr
0dd9db871d fixed typo chnages 2011-06-15 22:04:20 -07:00
Santiago Pastorino and José Ignacio Costa
e445a79562 Bump mysql2 up 2011-06-16 01:05:45 -03:00
José Valim
36253916b0 Deprecate memoizable. 2011-06-15 17:08:08 -03:00
José Valim
6c3e80af68 load_generators from engine should also handle self automatically. 2011-06-15 15:53:58 -03:00
Vijay Dev
406d61ee8c add details on how to use specific annotations in rake:notes 2011-06-15 23:26:19 +05:30
Vijay Dev
3e44159650 document how rake notes work 2011-06-15 22:53:57 +05:30
Jason Fox
1adb38b6c3 Merge pull request #47 from jasonfox/master
Fixed two errors in the doc
2011-06-15 09:39:59 -07:00
Jason Fox
b62c5493d1 The name for the plain text template in Rails3 appears to be method.text.erb, not, method.text.plain.erb. Updated the doc to reflect this change. Also fixed a reference to an example that was incorrect. 2011-06-15 12:38:01 -04:00
Vijay Dev
77c8cd7516 form => form_for 2011-06-15 18:56:22 +05:30
José Valim
078bdc6ded Merge pull request #1711 from daeltar/master
Use assert_equal instead of assert in uploaded file test.
2011-06-15 03:19:21 -07:00
Christine Yen
0a67b745be Tweak linebreak in ActionController::Redirecting doc 2011-06-15 03:18:28 -07:00
Christine Yen
c6381657b7 Clarify importance of *_attributes= writer methods for nested fields 2011-06-15 03:15:58 -07:00
thoefer
6d96535524 Updated rails´s guides on the config.serve_static_assets and it´s settings in production mode using WEBrick. This documentation has it´s roots in #issue1657. You have to set config.serve_static_assets to true in production mode with WEBrick as only this includes ActionDispatch::Static. 2011-06-15 12:14:17 +02:00
Lukáš Konarovský
c0d82ba030 Use assert_equal instead of assert in uploaded file test. 2011-06-15 03:09:27 -07:00
José Valim
6ab3da6208 Merge pull request #1707 from dmathieu/memoize
Allow last argument to be a boolean in memoized methods
2011-06-15 02:52:12 -07:00
Vijay Dev
28508d52a9 Merge pull request #45 from christineyen/redirect_to_docs
Documentation tweak - add a helpful reminder to redirect_to
2011-06-15 02:12:12 -07:00
Christine Yen
8da91036c0 Improve documentation around status code argument of redirect_to 2011-06-15 01:55:57 -07:00
Damien Mathieu
0438e92ae7 simplify to only one condition
Signed-off-by: Andrew White <andyw@pixeltrix.co.uk>
2011-06-15 09:51:36 +01:00
Damien Mathieu
9791e3e252 allow boolean last argument in memoized methods - Closes #1704
If in the memoized method, the last argument is a boolean, it's considered as the reload method.
Don't consider it like that if that's a normal method argument.
2011-06-15 09:46:53 +02:00
Brian Underwood
10cfd14649 Failing test to show problem when last argument of a memoized method is true
Signed-off-by: Damien Mathieu <42@dmathieu.com>
2011-06-15 09:44:21 +02:00
Vijay Dev
045d9d2bae minor copy edit 0bdeddb 2011-06-15 11:44:31 +05:30
Arun Agrawal
0bdeddb97e Jruby => JRuby, Mysql => MySQL 2011-06-15 10:45:05 +05:30
Arun Agrawal
57ace9868a Moving hint down. As required after all database examples. 2011-06-15 07:40:49 +05:30
Arun Agrawal
8f05a2f7ae Using "Finally" at the end of database section. 2011-06-15 07:39:24 +05:30
Arun Agrawal
900dbca965 Added Doc for Postgresql database with Jruby Platform. #jruby 2011-06-15 07:38:08 +05:30
Arun Agrawal
aed85375ca Added doc for Mysql database with Jruby platform #jruby 2011-06-15 07:36:52 +05:30
Arun Agrawal
d5b1cf592b Adding doc for Sqlite3 database for Jruby platform #jruby 2011-06-15 07:36:04 +05:30
Andrew White
0ac0d7a0f0 Make MissingTranslation exception handler respect :rescue_format 2011-06-15 01:21:04 +01:00
Joshua Peek
56b301fa7a Fix appending sprockets paths 2011-06-14 14:39:34 -05:00
JudeArasu
f391f94428 typo changes 2011-06-14 23:16:05 +05:30
Jon Leighton
411435a71c Merge pull request #1698 from bagwanpankaj/master
Removed warnings from while running tests in Ruby 1.9.2
2011-06-14 09:56:51 -07:00
bagwanpankaj
c424fb29ab Removed warning while running test with ruby 1.9.2 2011-06-14 21:56:27 +05:30
José Valim
deff5977d4 Merge pull request #1689 from dmathieu/utf8-filename
Encode the uploaded file's name in utf8 - Closes #869
2011-06-14 08:13:15 -07:00
Damien Mathieu
383fd143bf all requests are utf-8. Don't use the external encoding. 2011-06-14 17:01:33 +02:00
Sebastian Martinez
0c1e630d18 Prefer Time.current over Time.now on example code 2011-06-14 11:01:00 -03:00
Sebastian Martinez
10c2035084 Add Time#all_* to AS guides. 2011-06-14 10:53:38 -03:00
Damien Mathieu
383d56b5ee encode the uploaded file's name in the default external encoding - Closes #869 2011-06-14 14:34:30 +02:00
Vijay Dev
bf526c2dbe Added instance_accessor: false to Module#mattr_accessor 2011-06-14 14:56:58 +05:30
Jon Leighton
954359b9c2 Add Gemfile dependency for require_relative on mri18. This is a dependency of linecache which is a dependency of ruby-debug. However, the latest release of linecache (0.45) omits the dependency from its gemspec, causing the build to fail. I have emailed the maintainer so we should remove this when it's fixed upstream. 2011-06-13 22:18:31 +01:00
Vijay Dev
9db268db65 fix minor errors in nested model guide 2011-06-14 00:30:13 +05:30
Vijay Dev
3b4f04ab83 document the instance_accessor option for cattr_accessor 2011-06-13 23:14:15 +05:30
Andrew White
190677d0f2 Remove obsolete compatibility module 2011-06-13 18:25:26 +01:00
David Heinemeier Hansson
a6467802ff Rename Time#whole_* to Time#all_* [thanks Pratik!] 2011-06-13 19:09:11 +02:00
David Heinemeier Hansson
d6cc0e56bd Added Time#whole_day/week/quarter/year as a way of generating ranges (example: Event.where(created_at: Time.now.whole_week)) [DHH] 2011-06-13 18:56:06 +02:00
David Heinemeier Hansson
b12c2e4ebb Added instance_accessor: false as an option to Class#cattr_accessor and friends [DHH] 2011-06-13 18:56:06 +02:00
Santiago Pastorino
276618c652 Merge pull request #1676 from neerajdotname/make_test_name_meaningful
Remove "is_assed" with something more meaningful
2011-06-13 05:49:00 -07:00
Santiago Pastorino
5599e3fa0c Merge pull request #1654 from ganeshkumar/test_cases
removed duplicate code in tests
2011-06-13 05:45:47 -07:00
Lukas Stejskal
67a705f952 fix two typos: and array -> an array 2011-06-13 14:21:17 +02:00
Andrew White
5d655aabcb Pass mass-assignment options to nested models - closes #1673. 2011-06-13 13:02:51 +01:00
Andrew White
987afa583e Rename tests to reflect associations 2011-06-13 10:01:38 +01:00
Neeraj Singh
54c651a6bb Remove "is_assed" with something more meaningful 2011-06-13 04:34:09 -04:00
José Valim
c41c4425ee Merge pull request #1672 from ryanb/namespace_engine_assets
Namespace engine assets
2011-06-13 00:45:32 -07:00
Robert Massaioli
d7a2431408 cycle: make an odd number be marked as odd.
Just a minor issue that was annoying me so I thought that I would jump in and fix it.
2011-06-13 14:58:56 +10:00
Ryan Bates
4dc3bb9cbd namespace engine assets 2011-06-12 18:29:14 -07:00
Jon Leighton
86bbba1ffb Add support for using an ARCONFIG environment variable to specify the location of the config.yml file for running the tests 2011-06-12 19:08:16 +01:00
Jon Leighton
15e289147e Oops, this should have been in the last commit 2011-06-12 19:05:29 +01:00
Jon Leighton
c52520166b Make assert_no_queries literally enforce that there are no queries. As in, not a single line of SQL should be sent to the database, not even stuff that is ignored by assert_queries. The argument being that if you write assert_no_queries, you really do not want there to be any queries. 2011-06-12 18:50:24 +01:00
Jon Leighton
232c66a1ba If we're going to use a global variable, let's at least namespace it 2011-06-12 18:38:39 +01:00
Jon Leighton
b09bbdb8bf Replace inline lambdas with named methods 2011-06-12 18:19:22 +01:00
Jon Leighton
14e6bbb149 Refactor tests to be less brittle 2011-06-12 18:19:21 +01:00
Jon Leighton
de01a64102 Move BEGIN and COMMIT into IGNORED_SQL rather than having them as a special case in assert_queries 2011-06-12 18:19:21 +01:00
benedikt
fa8dfad765 Don't wrap operations on collection associations in transactions when they are not needed, so the connection adapter does not send empty BEGIN COMMIT transactions blocks to the database. 2011-06-12 18:19:21 +01:00
Guillermo Iguaran
657ba2a9f0 Remove trailing whitespaces 2011-06-12 10:31:21 -05:00
Andrew White
1fa059cd01 Define ActiveSupport#to_param as to_str - closes #1663 2011-06-12 15:32:46 +01:00
Xavier Noria
cd99784d99 Merge branch 'master' of github.com:rails/rails 2011-06-12 15:04:15 +02:00
Xavier Noria
caadef9dd4 backslash insertion for RDoc main page ignores code blocks, also adds comments to explain what's this hack about 2011-06-12 15:03:28 +02:00
Vijay Dev
00b4756790 assets are in app now and not in public 2011-06-12 16:17:34 +05:30
José Valim
04407a7b8a Make i18n tests more robust. 2011-06-12 12:45:09 +02:00
Xavier Noria
de757af8b0 revises the pattern that excludes generator templates in API generation
With the previous pattern RDoc processed

    railties/lib/rails/generators/rails/plugin_new/templates/test/%name%_test.rb

and that resulted in a spurious "<" class.
2011-06-12 12:09:08 +02:00
Sebastian Martinez
d48bbc895f Add example for rails server port option. 2011-06-11 19:32:01 -03:00
thoefer
04c31e2a10 fixed typo for a methodname 2011-06-11 23:56:29 +02:00
Uģis Ozols
70cafa2bff with -> will 2011-06-12 00:41:42 +03:00
Vijay Dev
07bf608644 document server options 2011-06-12 02:16:08 +05:30
Vijay Dev
d91ee6cba4 more command guide changes 2011-06-12 01:30:40 +05:30
Vijay Dev
940552ef42 make some changes to the command line guide 2011-06-11 22:11:16 +05:30
Piotr Sarnacki
e591d14b9c Update changelog with #1552 feature: add hidden field before select[multiple=true] 2011-06-11 18:24:05 +02:00
ganesh
7c3094626d removed duplicate code 2011-06-11 21:49:12 +05:30
José Valim
82568bedae Update CHANGELOG. 2011-06-11 18:03:13 +02:00
Vijay Dev
db027aa47e minor changes in templates guide 2011-06-11 21:31:45 +05:30
José Valim
410a42860b Get rid of the alternate namespace lookup. 2011-06-11 18:01:26 +02:00
Piotr Sarnacki
f5e1548c1b Merge pull request #1552 from bogdan/select
Fixing select[multiple] html specification problem.
2011-06-11 08:21:22 -07:00
José Valim
e294009b07 No need for a configuration option here. 2011-06-11 17:10:16 +02:00
José Valim
28f2b981fc Merge pull request #549 from dlee/utf8_enforcer
Utf8 enforcer param customization
2011-06-11 08:04:06 -07:00
José Valim
1829dd9175 Merge pull request #1647 from neerajdotname/make_tests_stronger
Make tests stronger, cleaner and slimmer
2011-06-11 08:01:52 -07:00
Vijay Dev
53a9849551 add missing end in example 2011-06-11 19:20:54 +05:30
Vijay Dev
3c06d25cf9 favor includes over old AR way 2011-06-11 19:20:54 +05:30
Vijay Dev
83289beddd fixed incorrect command usage. (This section needs to be updated in any case). 2011-06-11 19:20:54 +05:30
Vijay Dev
94c52e8bd7 minor fixes in action view guide 2011-06-11 19:20:54 +05:30
Paul Gallagher
f8c4b374c8 make extract_schema_and_table a private method 2011-06-11 18:34:09 +08:00
David Lee
9b305983e3 Remove utf8_enforcer_param config option 2011-06-11 01:58:26 -07:00
David Lee
91e3046b71 Make utf8_enforcer_tag an overrideable method 2011-06-11 01:58:26 -07:00
David Lee
fa3fc52069 Make utf8 enforcer param customizeable 2011-06-11 01:58:26 -07:00
David Lee
1cbe917237 There are no snowmen here 2011-06-11 01:58:26 -07:00
David Lee
d38ca78dbd Add acronym support to Inflector; Issue #1366 2011-06-11 01:43:24 -07:00
David Lee
51cd6bb829 Refactor 2011-06-11 01:35:16 -07:00
David Lee
f3e8bb8394 Test retain delimiter in parameterization inflector 2011-06-11 01:35:16 -07:00
Neeraj Singh
f3c9f32664 remove meaningless assert true 2011-06-11 03:11:06 -04:00
Neeraj Singh
6688b6393a expected message should come first 2011-06-11 03:11:06 -04:00
Neeraj Singh
5da89af6f6 try not to use assert_blank when nil will would
be considered as failure

Test for specific value to the extent possible
2011-06-11 03:11:05 -04:00
Santiago Pastorino and José Ignacio Costa
94df84a8a4 Revert "Make sure that we don't perform in-place mutation on SafeBuffer string"
This reverts commit 115e80dccc.
2011-06-10 23:08:00 -03:00
Santiago Pastorino
adef9764ae Merge pull request #1644 from smartinez87/warns
Remove unused variable causing warning in 1.9.3
2011-06-10 18:35:14 -07:00
Sebastian Martinez
c4ddc6f693 Remove unused variable causing warning in 1.9.3 2011-06-10 21:10:06 -03:00
Aaron Patterson
a4ee5038c1 Merge pull request #1642 from sikachu/master-render-inline
Render inline fix for master
2011-06-10 16:29:58 -07:00
Xavier Noria
ca312b6612 s/Bundle/Bundler/ 2011-06-11 01:18:08 +02:00
Xavier Noria
4699c93301 Merge branch 'master' of git://github.com/lifo/docrails 2011-06-11 00:59:46 +02:00
thoefer
029290f3de Fixed minor typo: 'Arraw' to 'Array' 2011-06-11 00:54:42 +02:00
Prem Sichanugrist
115e80dccc Make sure that we don't perform in-place mutation on SafeBuffer string
This will make sure `render :inline` is working.

Closes #1633
2011-06-10 18:51:48 -04:00
Prem Sichanugrist
3757798856 Update CHANGELOG to mention the json_escape change, and rearrange stuff a bit. 2011-06-10 18:50:57 -04:00
Xavier Noria
6c58585ff5 shell out to run bundler on app generation, see rationale in the comment 2011-06-10 23:43:24 +02:00
Paul Gallagher
1d7c751bf7 remove table quoting in primary_key method
* add/cleanup tests
2011-06-11 02:21:24 +08:00
Ken Collins
c791e2d034 Allow the connection pool's #table_exists? method to give the connections #table_exists? method a chance. 2011-06-10 13:15:58 -04:00
Paul Gallagher
019c263633 apply private method indentation convention
* tidy test code and fix my typo
2011-06-10 22:48:58 +08:00
Paul Gallagher
5c7f8c929b Improve PostgreSQL adapter schema-awareness
* table_exists? scoped by schema search path unless schema is explicitly named. Added tests and doc to clarify the behaviour
* extract_schema_and_table tests and implementation extended to cover all cases
* primary_key does not ignore schema information
* add current_schema and schema_exists? methods
* more robust table referencing in insert_sql and sql_for_insert methods
2011-06-10 21:52:25 +08:00
José Valim
8eb2b519f2 Merge pull request #1631 from vijaydev/runner-help
rails runner without any options should show usage information
2011-06-10 06:45:52 -07:00
Vijay Dev
880371ef2b make 'rails runner' show usage when run without any options 2011-06-10 18:48:50 +05:30
José Valim
78acd17f31 Merge pull request #1567 from BDQ/engine_migrations
Ensure engine migrations are copied in correct sequence
2011-06-10 04:43:43 -07:00
Brian Quinn
25ad43015c Updated test to ensure correct sequence when copying engine/plugin migrations. 2011-06-10 12:12:50 +01:00
Brian Quinn
9f2e91414f Ensure engine migrations are copied in the same sequence that they are required. 2011-06-10 12:11:45 +01:00
Andrew White
0bcbcdfdad Ensure number helpers can handle HTML safe strings - closes #1597. 2011-06-10 11:32:28 +01:00
Xavier Noria
90c4885766 Merge pull request #1523 from raghunadhd/refactor_regex
rafactored the regex related code in the mapper class
2011-06-10 03:27:45 -07:00
ganesh
262a42b12e shallow_path example updated 2011-06-10 15:53:55 +05:30
Raghunadh
46ecb53fc2 removed the unnecessary back slashes from the regular expression 2011-06-10 13:39:24 +05:30
José Valim
2bda229c2f Merge pull request #1625 from neerajdotname/page_caching
Three minor fixes to tests
2011-06-10 00:29:50 -07:00
Neeraj Singh
06d772c0ce add missing ensure 2011-06-10 02:48:44 -04:00
Neeraj Singh
fdbe8eb08c replaced and with && as per coding guidelines 2011-06-10 02:27:57 -04:00
Neeraj Singh
49d032929b The test name is misleading. It says
test_should_cache_with_trailing_slash_on_url

A trailing slash is removed when a page is cached.

What the test meant to say was : a url with trailing slash
should be cached and the cached page should not have any
trailing slash.

This patch clarifies the name a bit.
2011-06-10 02:24:37 -04:00
Aaron Patterson
0b02284545 ensuring that json_escape returns html safe strings when passed an html safe string 2011-06-09 15:29:17 -07:00
Damien Mathieu
84f71e42b7 don't reinitialize the arel_table unless the table_name changes 2011-06-09 14:56:07 -07:00
Jacob Poulsgaard Tjoernholm
35ae29f305 Fix issue #1598 by adding a dependency to the RDoc gem. 2011-06-09 14:37:54 -07:00
Jon Leighton
4b371b602b Print out information about whether the identity map is on or off when running unit tests 2011-06-09 20:20:51 +01:00
Jon Leighton
e48829946d Update the RUNNING_UNIT_TESTS file 2011-06-09 20:20:51 +01:00
Aaron Patterson
d0a1e37d70 Merge pull request #1609 from sikachu/master-javascript
Make sure `escape_javascript` return `SafeBuffer` if the incoming argumen
2011-06-09 11:37:06 -07:00
Prem Sichanugrist
8c8652c37f Make sure escape_javascript return SafeBuffer if the incoming argument is already html_safe 2011-06-09 14:30:02 -04:00
John Hinnegan
1395b30803 update palmist link on performance_testing 2011-06-09 10:22:44 -07:00
Dingding Ye
c2aacdf2eb MemcacheStore: deserialize the entry reading from local_cache when using raw 2011-06-10 01:15:37 +08:00
José Valim
834bebf9cc Merge pull request #1606 from neerajdotname/remove_users_controller_from_test
remove unused UserController from test
2011-06-09 08:30:45 -07:00
Mohammad Typaldos
79647c6fdf Merge branch 'master' of github.com:lifo/docrails 2011-06-09 03:58:22 -04:00
Mohammad Typaldos
45a5201b86 Match tone already established 2011-06-09 03:57:55 -04:00
José Valim
eb8c0a7b1a Merge pull request #1356 from flippingbits/fix_engine_generator
Fix engine's generator
2011-06-09 00:01:00 -07:00
José Valim
af3f0b6204 Merge pull request #1591 from smartinez87/unused
Fix "warning: assigned but unused variable" on AR tests
2011-06-08 23:36:49 -07:00
José Valim
077f65c36f Merge pull request #1588 from neerajdotname/remove_unused_class_with_symbol_returning
class WithSymbolReturningString is not used anywhere in the test.
2011-06-08 23:35:46 -07:00
José Valim
0ad228027d Merge pull request #1579 from bradleybuda/master
Date#freeze fails when called more than once in 1.8
2011-06-08 23:34:30 -07:00
José Valim
12245a3325 Merge pull request #1577 from reu/useless-variable-set
Instance variable not used.
2011-06-08 23:33:42 -07:00
Aaron Patterson
9295053d9d Merge pull request #1593 from r00k/master
Simplify boolean logic into ternary
2011-06-08 20:29:12 -07:00
Ben Orenstein
4f9e242521 Describe the user name 'variable' in a way that doesn't confuse the textile parser. 2011-06-08 23:20:13 -04:00
Ben Orenstein
f87888066a Simplify boolean logic into ternary. 2011-06-08 23:11:19 -04:00
Neeraj Singh
fa5b34ed22 remove unused user_controller from test 2011-06-08 22:49:38 -04:00
Sebastian Martinez
9af4e803ec Remove unused 'y' variable. 2011-06-08 23:13:59 -03:00
Sebastian Martinez
0b86ac244c Remove unused 'quoted_column_names' variable. 2011-06-08 23:13:43 -03:00
Neeraj Singh
277eb05733 class WithSymbolReturningString is not used anywhere in the test.
Secondly it seemed from the method that the intent was to test a case
where layout was declared in a symbol and the method named mention in
layout returns nil.

That case is already covered with class     class WithSymbolReturningNil .

Also the case of SymbolReturningString is covered with the class
WithSymbol.
2011-06-08 20:22:13 -04:00
David Heinemeier Hansson
54b0aeba64 Indention style + whitespace for readability 2011-06-09 01:31:06 +02:00
David Heinemeier Hansson
93f30f0536 If you set a js_compressor, it means that you want shit compressed -- we dont need a second option to turn that on 2011-06-09 01:30:58 +02:00
Mohammad Typaldos
fe2482e50b require_tree is pretty simple 2011-06-08 18:50:55 -04:00
Bradley Buda
dd3e7a6a34 Allow a Date to be frozen more than once without an error in Ruby 1.8.x 2011-06-08 13:54:48 -07:00
Rodrigo Navarro
8166e4b0c3 No need to create a new Arel::Table, as the arel_table method already creates a new one 2011-06-08 16:56:01 -03:00
Bratish Goswami
266b1bd9b4 Added acronym and reference link for Model–view–controller 2011-06-08 22:47:25 +05:30
Aaron Patterson
7d537b2106 Merge pull request #1564 from sikachu/master-changelog
Update CHANGELOG to mention the new SafeBuffer change
2011-06-08 09:01:45 -07:00
Prem Sichanugrist
7ab06004da Update CHANGELOG to mention the new SafeBuffer change 2011-06-08 11:47:27 -04:00
José Valim
8bc4771291 Merge pull request #1560 from sikachu/master-escapejs
Make escape_javascript happy to handle SafeBuffers
2011-06-08 08:08:59 -07:00
Paul Gallagher
bf2f039a93 Make escape_javascript happy to handle SafeBuffers
* see GH#1553
* allow for the fact that gsub on SafeBuffer does not pass match variables $1, $2 etc to a block
2011-06-08 11:05:15 -04:00
José Valim
b937c76f0d Merge pull request #1559 from neerajdotname/before_filter_test
Make test meaningful
2011-06-08 08:05:04 -07:00
Neeraj Singh
7fff2f9fe3 Make test meaningful
If before_filter list was being called mistakenly then
the test should fail. However test will not fail because
second filter is assigning new values to @list. To truly
test that first before_filter is not called when it should
not be called then @list should not assigned value unconditionally.

This patch will make the test fail if first filter is called.
2011-06-08 10:51:10 -04:00
Vijay Dev
3dacc85278 minor corrections in configuring guide 2011-06-08 19:42:18 +05:30
José Valim
b64524d6fd Merge pull request #1556 from thoefer/master
Brought back alternative convention for namespaced models in i18n
2011-06-08 05:01:24 -07:00
thoefer
0831b7e076 Brought back alternative convention for namespaced models in i18n. 2011-06-08 13:40:17 +02:00
Bogdan Gusiev
faba406fa1 Fixing select[multiple] html specification problem.
Generating hidden input with same name before each multiple select
2011-06-08 12:59:54 +03:00
Vijay Dev
def4a538cc remove generators section from command line guide in favor of the separate generator guide 2011-06-08 15:01:19 +05:30
Xavier Noria
8c1762f11e Merge pull request #1550 from rsim/fix_test_has_many_with_pluralize_table_names_false
Do not hardcode :id as it was ignored by mass assignment filter
2011-06-08 02:13:52 -07:00
Raimonds Simanovskis
e58ee1dccc Do not hardcode :id as it was ignored by mass assignment filter
As a result test was failing on Oracle where ids are assigned by default from 1000
2011-06-08 11:56:23 +03:00
José Valim
47ac896936 Merge pull request #1549 from neerajdotname/rename_to_method_for_action
test name should reflect the name of the method
2011-06-08 00:41:55 -07:00
José Valim
2bf686f4db Merge pull request #1548 from neerajdotname/remove_class_me5
remove unused class from test
2011-06-08 00:30:11 -07:00
Neeraj Singh
8f3c9e87d9 test name should reflect the name of the method
that is actually being called
2011-06-08 03:17:27 -04:00
Neeraj Singh
cbfdd0df33 remove unused class from test 2011-06-08 02:54:19 -04:00
José Valim
c6503f48bd Merge pull request #1547 from sikachu/safebuffer
Fix ActionPack tests on `master`
2011-06-07 23:39:49 -07:00
José Valim
185235333c Merge pull request #1542 from cmeiklejohn/dont_gsub_on_safebuffer
Don't operate on the safebuffer, operate on a string and convert.
2011-06-07 23:32:03 -07:00
Prem Sichanugrist
1bbc51e5a7 Fix failing test on uninitialized Rails.config.assets.prefix
This was introduced in [2684f17a17] 💣
2011-06-08 02:30:50 -04:00
Prem Sichanugrist
9e2e242655 Add proper fix to mail_to helper.
* Fix the problem on manipulating on the `ActiveSupport::SafeBuffer`
* Make sure that we run `escape_javascript` on the `String`, to avoid unexpected behavior.
2011-06-08 02:30:50 -04:00
Prem Sichanugrist
07f2481e15 Adapt [823aa223ef] to make sure we perform cloning before manipulation only on OutputBuffer.
After the fragment rendering, `Builder` returns the `String` object instead of `ActionView::OutputBuffer`. Somehow the same procedure which was in [823aa223ef] does not play nice with the String, and result in the fragment got lost.
2011-06-08 02:30:50 -04:00
José Valim
fcccfd7b6d Merge pull request #1535 from smartinez87/each
Prefer 'each' over 'for in' syntax.
2011-06-07 23:13:10 -07:00
Santiago Pastorino
1d3618a9b4 remove warning: assigned but unused variable 2011-06-08 00:26:09 -03:00
Santiago Pastorino
f2f63bf2ff ruby-prof doesn't work in 1.9.3 2011-06-08 00:25:57 -03:00
Aaron Patterson
80edbad786 Merge pull request #1539 from cmeiklejohn/fix_safe_buffer_in_fragment_caching
Fragment caching needs to operate on the pure output, not the safebuffer.
2011-06-07 20:25:11 -07:00
Christopher Meiklejohn
ef8b12a29e Don't operate on the safebuffer, operate on a string and convert. 2011-06-07 23:07:07 -04:00
Christopher Meiklejohn
823aa223ef Fragment caching needs to operate on the pure output, not the
safebuffer.
2011-06-07 22:36:51 -04:00
Vijay Dev
5c53754f33 fix generators guide url 2011-06-08 06:47:22 +05:30
Sebastian Martinez
49dcc4ff0c Prefer 'each' over 'for in' syntax. 2011-06-07 21:45:14 -03:00
Michael Koziarski
1300c03477 Ensure that the strings returned by SafeBuffer#gsub and friends aren't considered html_safe?
Also make sure that the versions of those methods which modify a string in place such as gsub! can't be called on safe buffers at all.

Conflicts:

	activesupport/test/safe_buffer_test.rb
2011-06-07 17:02:48 -07:00
Vijay Dev
18d84e50a2 use git: rather than https: in git remote urls; else, github asks for passwords everytime we push 2011-06-08 05:06:58 +05:30
Jon Leighton
7d1782a2c1 Allow polymorphic has_one to work when the association is set before the owner has been saved. Fixes #1524. 2011-06-08 00:32:49 +01:00
Jon Leighton
4f5f6a3257 When you add a record to a polymorphic has_one, you should be able to access the owner from the associated record 2011-06-08 00:32:49 +01:00
Vijay Dev
e89a253705 minor fixes from 5acf76d 2011-06-08 04:53:09 +05:30
Vijay Dev
7fd8f71ce0 fix incorrect validation examples 2011-06-08 04:48:42 +05:30
Xavier Noria
f8cfa7afdb Merge branch 'master' of github.com:lifo/docrails 2011-06-08 00:30:07 +02:00
Xavier Noria
a1e78cfc36 Merge branch 'master' of git://github.com/lifo/docrails 2011-06-08 00:22:36 +02:00
Vijay Dev
a4679839ad fix typo 2011-06-08 03:52:33 +05:30
Vijay Dev
645f003be7 fix spacing 2011-06-08 03:43:53 +05:30
Xavier Noria
97036eb5ba Merge pull request #1533 from alexandrz/master
Fix typo
2011-06-07 14:45:36 -07:00
Alexandr Zykov
4c3ec9889a fix typo 2011-06-08 03:31:33 +06:00
Joshua Peek
2684f17a17 Update asset helpers to use config.assets.prefix
Fixes #1489
2011-06-07 14:27:57 -07:00
Paco Guzman
5acf76d173 Add action_mailer observer and interceptors configuration options 2011-06-07 23:27:09 +02:00
Vijay Dev
366ffd8164 add missing generator configs 2011-06-08 02:25:19 +05:30
Vijay Dev
dc15a0f7d0 proof reading and fixes in configuring guide 2011-06-08 02:25:19 +05:30
Vijay Dev
0b09f84c91 fix indents and a code error in caching guide 2011-06-08 02:25:19 +05:30
Xavier Noria
c00da252b8 mention assets:clean in railties CHANGELOG 2011-06-07 22:03:15 +02:00
Xavier Noria
2d4115528f sprockets gzips assets now 2011-06-07 21:58:40 +02:00
Dmitriy Kiriyenko
8aabefb0b7 This way asserting that updated_at was changed in touch look more obvious. 2011-06-07 18:42:40 +01:00
Dmitriy Kiriyenko
7c1f73c843 Do not use default_scope in ActiveRecord::Persistence#touch. 2011-06-07 18:42:40 +01:00
José Valim
050d6ef060 Merge pull request #1516 from guilleiguaran/rack-urlmap-fix
Rails::Server#app should be nice with Rack::URLMap
2011-06-07 09:08:51 -07:00
Guillermo Iguaran
8496be7e11 Fixing Rails::Server#app under Rack::URLMap 2011-06-07 11:03:02 -05:00
Raghunadh
2e07c71106 rafactored the regex related code in the mapper class 2011-06-07 19:02:08 +05:30
Stefan Sprenger
331d58fb04 Prepend bundle exec to get the correct Rake version 2011-06-07 14:07:32 +02:00
Stefan Sprenger
246c367570 Use RAILS_ISOLATED_ENGINE and fix namespaced generators tests 2011-06-07 12:16:05 +02:00
Xavier Noria
72cca79d36 adds missing require 2011-06-07 12:06:02 +02:00
Stefan Sprenger
8ea90ffdb8 Use mattr_accessor :namespace 2011-06-07 11:36:11 +02:00
Stefan Sprenger
64f337eeb0 Don't create full Rails application if RAILS_ISOLATION_COMMAND equals engine 2011-06-07 11:26:38 +02:00
Stefan Sprenger
f18283194b Use namespace if it's a mountable engine 2011-06-07 11:21:38 +02:00
Stefan Sprenger
1a06530aa5 Added regression tests 2011-06-07 10:23:45 +02:00
Jon Leighton
ad9586bf38 Fix a couple of helper requires that were missed. This was causing the tests to fail to run on 1.8.7. 2011-06-07 08:35:55 +01:00
Stefan Sprenger
402163916b Move test/engine/generators_test.rb to test/railties/generators_test.rb 2011-06-07 09:33:17 +02:00
Stefan Sprenger
5afd83c03b Add test for helper generator 2011-06-07 09:31:07 +02:00
Stefan Sprenger
a60624d6c0 Clean up engine's generator test and use bundle exec for invoking generators 2011-06-07 09:16:15 +02:00
José Valim
e32e8ed966 Merge pull request #1474 from ganeshkumar/update_column_changes
added  tests for update_column
2011-06-07 00:14:42 -07:00
Ryan Bigg
77616702df Clean up engine generators_test code and add test for models correctly namespaced 2011-06-07 08:32:03 +02:00
Ryan Bigg
32d35bac09 Add beginnings of test for generators within the context of an engine 2011-06-07 08:31:19 +02:00
Aaron Patterson
80451a1fa6 make sure AR isolated tests set the environment variable 2011-06-06 18:01:45 -07:00
Piotr Sarnacki
a6c5cc2377 Added missing assert to test checking form with namespaced isolated model and fixed helpers to work correctly in such case 2011-06-07 02:40:41 +02:00
Aaron Patterson
cd27cd5e49 oops! add parens so the block is properly bound 2011-06-06 17:00:08 -07:00
Aaron Patterson
8392f10b58 set the environment variable from the rake file 2011-06-06 16:51:45 -07:00
Aaron Patterson
424cf3b050 more oracle fixes 2011-06-06 15:47:29 -07:00
Aaron Patterson
517ca8771c do not muck with the load path, that is the test task responsibility 2011-06-06 15:47:26 -07:00
Aaron Patterson
841d29639b updating configs for oracle 2011-06-06 15:47:22 -07:00
Aaron Patterson
c8d124c0fc add test to the include path 2011-06-06 15:47:17 -07:00
Aaron Patterson
61774e0d49 please use ruby -I lib:test path/to/test.rb, or export RUBY_OPT 2011-06-06 15:47:13 -07:00
Xavier Noria
6cf458823f Merge branch 'master' of git://github.com/lifo/docrails 2011-06-06 22:50:09 +02:00
Vijay Dev
1f272538bd add info about docrails policy on changelogs 2011-06-07 02:03:48 +05:30
Jon Leighton
445c0607f7 Don't ensure all keys in build_results are only written once, otherwise we get false positive builds reported. 2011-06-06 21:27:29 +01:00
Jon Leighton
499dec0102 Make sure that the build/drop database rake tasks take account of the test/config.yml config 2011-06-06 21:27:28 +01:00
Xavier Noria
5e21247131 Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	activerecord/RUNNING_UNIT_TESTS
2011-06-06 22:23:30 +02:00
Xavier Noria
689e12b828 Revert "updated Changelog "
This reverts commit 79990505e5.

Conflicts:

	activerecord/CHANGELOG

Reason: Sorry, CHANGELOGs can't be edited via docrails.
2011-06-06 22:12:34 +02:00
Vijay Dev
5d8df14d6d comment the recorder methods 2011-06-07 01:38:03 +05:30
Vijay Dev
428883b579 up and down are no longer class methods in a migration 2011-06-07 01:23:08 +05:30
Vijay Dev
c5786a951e rearrange sections of the commandline guide giving more importance to rake tasks 2011-06-07 01:00:07 +05:30
Vijay Dev
660fb143fb document assets related rake tasks 2011-06-07 00:16:43 +05:30
Jon Leighton
38ad6bb2f5 Fix double definition of #teardown. Thanks @mike-burns 👍 2011-06-06 17:57:02 +01:00
Jon Leighton
afe1911228 Fix another CIfail 🔥 Deleting RAILS_ENV from ENV doesn't produce the desired result if RACK_ENV is still defined. And in any case it's better to be explicit here, so just set RALS_ENV=development. 2011-06-06 17:57:02 +01:00
Aaron Patterson
fe5a6ec45f remove call to source index 2011-06-06 09:52:40 -07:00
David Heinemeier Hansson
73b64bcd15 Use Latest Sprockets beta 2011-06-06 18:37:35 +02:00
Jon Leighton
62570e8626 Solve the RAILS_ENV problem in the railties tests in a more generic way 2011-06-06 13:54:05 +01:00
José Valim
2d3ba54b86 Merge pull request #1504 from arunagw/console_test_for_ci_server
Fix for CI server. Dependent on RAILS_ENV=development
2011-06-06 03:52:34 -07:00
Arun Agrawal
5d78d81222 Fix for CI server. Dependent on RAILS_ENV=development 2011-06-06 16:13:22 +05:30
Mariusz Pękala
c0c0a64ce6 Validations guide: order of :after_save callback was incorrect.
The guide was contracting itself. First it stated that 'there is a list
of callbacks in order of execution', on the list 'after_save' was placed
before 'after_create', and then there was a warning that 'after_save'
runs after them. I am not sure about 'around_' callbacks, but let's
leave that for another patch.
2011-06-06 11:51:18 +02:00
José Valim
38b97d289c Merge pull request #1497 from arunagw/framework_test
framework_test.rb also dependent on RAILS_ENV=development
2011-06-06 02:43:32 -07:00
Guillermo Iguaran
d3d5b048f9 Change http://api.rubyonrails.com to http://api.rubyonrails.org 2011-06-05 20:36:09 -07:00
Mohammad Typaldos
a620e65053 Edited railties/guides/source/asset_pipeline.textile via GitHub 2011-06-05 14:49:50 -07:00
Vijay Dev
a2cf91a1a4 minor edits in migrations guide 2011-06-06 02:10:38 +05:30
Arun Agrawal
8e51383a6b loading_test.rb with RAILS_ENV=development 2011-06-06 00:55:24 +05:30
Arun Agrawal
11d41e8b20 framework_test.rb also dependent on RAILS_ENV=development 2011-06-06 00:43:49 +05:30
Jon Leighton
f9b41237c8 load_path_test.rb is also dependent on RAILS_ENV=development 2011-06-05 18:27:52 +01:00
Vijay Dev
e1b202fc70 annotate class_eval method for active resource schema attributes 2011-06-05 21:44:04 +05:30
Guillermo Iguaran
c2c8ef57d6 Remove trailing white-spaces 2011-06-05 10:34:40 -05:00
Anil Wadghule
3fc53e5ea1 Fix failing test because of Timezone difference. 2011-06-05 19:36:37 +05:30
Andrew White
4ecca0f985 Move CHANGELOG entry to future version 2011-06-05 12:52:14 +01:00
Andrew White
e864ff7259 Add backward compatibility for testing cookies
This commit restores the ability to assign cookies for testing via
@request.env['HTTP_COOKIE'] and @request.cookies, e.g:

    @request.env['HTTP_COOKIE'] = 'user_name=david'
    get :index
    assert_equal 'david', cookies[:user_name]

and

    @request.cookies[:user_name] = 'david'
    get :index
    assert_equal 'david', cookies[:user_name]

Assigning via cookies[] is the preferred method and will take precedence
over the other two methods. This is so that cookies set in controller
actions have precedence and are carried over between calls to get, post, etc.
2011-06-05 12:34:27 +01:00
Andrew White
0a9270417c Ensure cookie keys are strings 2011-06-05 12:03:31 +01:00
Jon Leighton
523c7c2330 Fix adapter_test.rb to make no assumptions about the database name 2011-06-05 11:28:17 +01:00
Jon Leighton
3b7d100b51 Fix typo 2011-06-05 11:28:17 +01:00
José Valim
cc2851b848 Merge pull request #1426 from arunagw/sprockets_gem_update
sprockets gem update to beta9
2011-06-05 01:55:24 -07:00
José Valim
b5b31658bc Merge pull request #1462 from arunagw/test_added_for_namedscope
Test added for namedscope target.
2011-06-05 00:12:05 -07:00
José Valim
9cdd606a9b Merge pull request #1488 from guilleiguaran/multiple_sources_in_sprocket_helpers
Allow multiple sources in Sprockets helpers
2011-06-05 00:10:18 -07:00
Guillermo Iguaran
db8eeaff06 Allow multiple sources in Sprockets helpers 2011-06-05 01:01:35 -05:00
Jon Leighton
75e56101d4 Bring back oracle specific crap 2011-06-04 23:49:54 +01:00
Jon Leighton
253bb6b926 Refactor Active Record test connection setup. Please see the RUNNING_UNIT_TESTS file for details, but essentially you can now configure things in test/config.yml. You can also run tests directly via the command line, e.g. ruby path/to/test.rb (no rake needed, uses default db connection from test/config.yml). This will help us fix the CI by enabling us to isolate the different Rails versions to different databases. 2011-06-04 23:47:03 +01:00
Jon Leighton
cdce7ff191 Force RAILS_ENV=development in rackup_test.rb. This fixes a problem on the CI server. For some reason the RAILS_ENV on the CI server is production, which means that the ActionDispatch::Static middleware is not used, and so the request in 'config.ru can be racked up' returns a 404 rather than a 200. 2011-06-04 23:47:03 +01:00
Xavier Noria
1c527afe87 adds Vijay Dev to the new Rails Guides Reviewers team
See http://weblog.rubyonrails.org/2011/6/2/news-from-the-documentation-front
2011-06-05 00:13:50 +02:00
Vijay Dev
9f19322b1f correct code indendation in the initialization guide 2011-06-05 00:58:21 +05:30
Vijay Dev
087f8e16a6 s/ActiveRecord/Active Record according to api guidelines 2011-06-04 23:51:00 +05:30
Vijay Dev
9d15a35981 minor corrections in generators guide 2011-06-04 20:44:11 +05:30
Vijay Dev
50487bd0ef fix incorrect module name for wrap parameters 2011-06-04 20:28:16 +05:30
Vijay Dev
fc9ff8cf41 some grammatical corrections 2011-06-04 20:12:25 +05:30
Vijay Dev
82aedbb96d fix incorrect output 2011-06-04 20:12:25 +05:30
Alberto Perdomo
2eac4e2e2f Fixed order of parameters in assert_equal call examples, first expected, then actual object. 2011-06-04 14:26:40 +01:00
Xavier Noria
bcc0a297d7 move Ryan up, since the list is ordered by surname 2011-06-04 14:35:12 +02:00
Xavier Noria
6a2863e78e adds Ryan Bigg to the credits page of the guides, he is the author of the new configuring guide 2011-06-04 14:26:39 +02:00
Xavier Noria
cd8ecec31f specify image dimensions for pictures in the guides credits page 2011-06-04 14:25:54 +02:00
Andrew White
a50865c7dc Add missing require for cookies middleware 2011-06-04 09:35:48 +01:00
Andrew White
d4658d86fe Refactor ActionController::TestCase cookies
Assigning cookies for test cases should now use cookies[], e.g:

  cookies[:email] = 'user@example.com'
  get :index
  assert_equal 'user@example.com', cookies[:email]

To clear the cookies, use clear, e.g:

  cookies.clear
  get :index
  assert_nil cookies[:email]

We now no longer write out HTTP_COOKIE and the cookie jar is
persistent between requests so if you need to manipulate the environment
for your test you need to do it before the cookie jar is created.
2011-06-04 07:09:11 +01:00
Rohit Arondekar
3035f72d17 Upcoming version of Rails is upon us so no need to refer to it. [API DOCS] 2011-06-03 21:54:33 -07:00
Vijay Dev
ced2b25036 use clearer variable name in examples 2011-06-04 02:11:43 +05:30
Waynn Lue
6fbd548b5f add a missing "the" and normalize the use of periods. 2011-06-03 12:26:53 -07:00
Prem Sichanugrist
74f9a4629b Revise documentation indentation from [79990505e5] 2011-06-03 15:06:03 -04:00
ganesh
79990505e5 updated Changelog 2011-06-04 00:31:45 +05:30
ganesh
5f66f7a9a2 added more tests for update_column 2011-06-04 00:04:59 +05:30
José Valim
64325a8242 Merge pull request #1468 from castlerock/fix_issue_1467
Double assignment of attributes on a collection association occurs fixed #1467
2011-06-03 06:22:35 -07:00
Raghunadh
7ef2f6fc04 Double assignment of attributes on a collection association occurs fixed for the issue issue #1467 2011-06-03 18:52:43 +05:30
Andrew White
54883682de Don't double assign attributes - closes #1467. 2011-06-03 13:57:00 +01:00
Linux on Rails
72f51990b7 FIXED: error with url_for & link_to when we have nested resources. 2011-06-03 03:01:41 -07:00
Vijay Dev
caa8ab09f7 remove stray ( 2011-06-03 14:25:13 +05:30
Vijay Dev
b688f44390 use 'bundle exec rake' 2011-06-03 14:14:23 +05:30
Vijay Dev
b4af5b9d49 fix indentation, fixed-width for nils 2011-06-03 14:13:04 +05:30
Nate Mueller
f449da53ac Make String.to_time respect timezones 2011-06-02 20:51:09 -07:00
Arun Agrawal
0695eb6dac Test added for namedscope target. 2011-06-03 08:28:00 +05:30
brianp
a632746a6a Fixed sections regarding validations and callbacks to mention the touch method does not fire either validations or callbacks as stated in the docs. 2011-06-02 15:03:36 -07:00
Ben Orenstein
8e071bc068 Change hashrocket spacing to match conventions. 2011-06-02 17:33:48 -04:00
Jon Leighton
f064664de7 Fix broken test. You know, the merge button will be the end of us... 2011-06-01 23:13:40 +01:00
Piotr Sarnacki
04593742c4 Merge pull request #1447 from dmathieu/empty_route
Fix creating an empty route on 1.8. Closes #1210
2011-06-01 12:47:19 -07:00
Vijay Dev
d0355ed5a9 add alias info for runner command 2011-06-02 01:10:11 +05:30
Vijay Dev
6e02164e02 styling changes 2011-06-02 01:08:14 +05:30
Ayose
196c8f13bf Edited activerecord/lib/active_record/transactions.rb via GitHub 2011-06-01 12:36:16 -07:00
Aaron Patterson
63665f6c9f Merge pull request #1385 from smartinez87/drop
#drop_table accepts no options now.
2011-06-01 10:52:41 -07:00
Arun Agrawal
7d447c4726 Adding comment 2011-06-01 18:50:43 +01:00
Vishnu Atrai
230f788759 AttributeMethodTest test fix #jruby 2011-06-01 18:50:26 +01:00
Brian Mathiyakom
1e43bd9f35 Fix issue #1272
Set reverse_order_value when asked to reverse_order().
Do the actual reversal in build_arel.
2011-06-01 18:29:29 +01:00
Ayose
3523144ea4 The URL http://dev.mysql.com/doc/refman/5.0/en/savepoints.html is no longer available 2011-06-01 08:47:06 -07:00
José Valim
fba977dfa3 Merge pull request #1448 from ernie/attr_internal_require
Require attr_internal before using in ActionView::Helpers
2011-06-01 07:49:25 -07:00
Ernie Miller
3a2ef52ad6 Require attr_internal before using in ActionView::Helpers 2011-06-01 10:30:54 -04:00
Damien Mathieu
8a0ffa7c95 fix creating an empty route on 1.8. Closes #1210 2011-06-01 15:51:36 +02:00
Akira Matsuda
90887cbb35 s/a/an/ 2011-06-01 17:48:09 +09:00
Akira Matsuda
6014e1d325 s/an/a/ 2011-06-01 17:20:02 +09:00
José Valim
1ff4bfc147 Merge pull request #1441 from guilleiguaran/no_rb_require
Don't add .rb in requires
2011-06-01 01:13:26 -07:00
Jon Leighton
69c52b0e9a Add missing require to fix the CI 2011-06-01 08:58:50 +01:00
Guillermo Iguaran
529d2deb5e Removing trailing white-spaces 2011-05-31 20:55:50 -07:00
Guillermo Iguaran
698b600719 Don't add .rb in requires 2011-05-31 21:43:04 -05:00
Aaron Patterson
a48b0e5783 Merge pull request #1439 from sikachu/isolated_pg_test
Isolated PostgreSQL test into PostgreSQL folder
2011-05-31 19:29:30 -07:00
Prem Sichanugrist
2aaeac9a0a Isolated PostgreSQL test into PostgreSQL folder 2011-05-31 20:56:07 -04:00
Andrew White
cf3364a03c Raise NameError instead of ArgumentError in ActiveSupport::Dependencies
ActiveSupport::Dependencies now raises NameError if it finds an existing
constant in load_missing_constant. This better reflects the nature of
the error which is usually caused by calling constantize on a nested constant.

Closes #1423
2011-06-01 01:16:20 +01:00
Josh Kalderimis
eb7ef2ccd6 added an alias for new to build to the AR collection proxy, this corrects an issue where the collection proxies were not consistent 2011-06-01 00:01:35 +01:00
Mark Roghelia
cd03204167 The example in the API docs incorrectly indicated that form_for would use the same default route for both new and previously persisted records. The default path given in the example would have generated a routing error for new records. form_for actually uses polymorphic_path to determine which route to use based on the state of the record. The example has been updated to reflect the method's actual behavior. 2011-05-31 18:41:20 -04:00
Andrew White
1f34a79373 Make MemCacheStore work with Ruby 1.9 and -Ku 2011-05-31 23:31:35 +01:00
José Valim
87762245e9 Merge pull request #1434 from dmathieu/mass_assignment
Mass assignment
2011-05-31 14:52:20 -07:00
Jon Leighton
4067d88df5 Revert "[activerecord][postgresql] verify if table has a schema(not public)". This caused a test breakage. See #1410 for details.
This reverts commit c44418ea4e.
2011-05-31 22:46:13 +01:00
Damien Mathieu
70381cf507 no need for .rb 2011-05-31 23:38:51 +02:00
Damien Mathieu
bb828990bd string inflections are needed for running tests in isolation 2011-05-31 23:38:39 +02:00
Xavier Noria
576f712380 standarize documentation (and indirectly code) to use American English as discussed in 4f234bf
Please do not perform monster patches for this until 3.1 is out.
Also, no existing API should be affected by this. New code, local
variables, etc. would follow this guideline to have a consistent
project tree in this regard.
2011-05-31 22:56:31 +02:00
Xavier Noria
5888507d6c revises commit from pull request 1408 2011-05-31 22:45:32 +02:00
Xavier Noria
daf4a4f747 revises commit from pull request 1409 2011-05-31 22:45:31 +02:00
Noel Gomez
7b4cd4bb5b Modified generated text to explain where .js and .coffee files can be located and that there shouldn't be blank lines in manifest per this issue http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/effb868290c2c0b8 2011-05-31 22:45:31 +02:00
Noel Gomez
2183f05864 changed text to be more explicit about where stylesheets can be located 2011-05-31 22:45:31 +02:00
Jon Leighton
fbe012e92d Ensure that calculations properly override the select value even if it's set in the default scope. Fixes #1395. 2011-05-31 21:12:20 +01:00
Erik Fonselius
a5806fa409 Failing test for aggregating on default_scope with select 2011-05-31 20:47:30 +01:00
Jon Leighton
dfaad4f5a7 Only save the record once when calling create! on a collection association. Fixes #1360. 2011-05-31 20:32:09 +01:00
Farley Knight
aa316e27b7 Tests for issue #1360 2011-05-31 19:47:34 +01:00
Jon Leighton
60cb96abea Implementing @dmathieu's cleaner fix from #1425. Unfortunately he deleted the branch so I cannot just merge it. 2011-05-31 18:34:27 +01:00
Jon Leighton
0bb8429e71 Reduce test noise 2011-05-31 18:18:14 +01:00
Arun Agrawal
85f9a5c29f sprockets gem update to beta9 2011-05-31 21:41:22 +05:30
Aaron Patterson
021e4f16b7 Merge pull request #1417 from arunagw/nested_attributes_fix
Fix nested attribute for memory record.
2011-05-31 08:46:27 -07:00
José Valim
12786518f1 Update CHANGELOG. 2011-05-31 12:26:32 +02:00
José Valim
139a9f7011 Transform the symbol into a constant lookup. 2011-05-31 12:24:30 +02:00
José Valim
1638435152 Merge pull request #1403 from bogdan/config
ActiveModel::MassAssignmentSecurity.mass_assignment_sanitizer method
2011-05-31 03:09:23 -07:00
Hendy Tanata
b13a0ceb5f Fix punctuation. 2011-05-31 17:09:33 +08:00
Hendy Tanata
bdd7ecb34e Update Rails coding conventions link. 2011-05-31 16:53:53 +08:00
Arun Agrawal
e04f2c1d42 Opening class CascadedEagerLoadingTest at once. 2011-05-31 12:35:37 +05:30
José Valim
752dec941e Merge pull request #1415 from brainopia/master
Remove autoload for non-existing constants
2011-05-30 23:56:49 -07:00
Arun Agrawal
2e57b66931 Adding comment to work with 1.8.7. Nested Attribute fix. 2011-05-31 12:12:19 +05:30
Arun Agrawal
cfb5f1b608 Fix nested attribute for memory record. 2011-05-31 11:31:10 +05:30
brainopia
c2687c390f Remove autoload for a couple of constants which don't exist anymore 2011-05-31 06:22:09 +04:00
Aaron Patterson
7278547a5d Merge pull request #1410 from lucasts/pg_schema
a little step to better postgresql schema support in rails
2011-05-30 13:30:07 -07:00
José Valim
65858a4bed Merge pull request #1404 from commuter/plugin_new_generator_should_properly_require_js
properly require javascript libraries when generating mountable engine
2011-05-30 08:17:13 -07:00
Joshua Peek
862390542d Merge pull request #1355 from gnufied/master
Adds rake task to cleanup compiled assets
2011-05-30 06:46:50 -07:00
Mohammad Typaldos
910ebe1193 Stubbing and some content addition and changes 2011-05-30 08:38:11 -04:00
Mohammad Typaldos
d0082bfa87 What is the asset pipeline? 2011-05-30 08:12:27 -04:00
J. Edward Dewyea
baf2a9cb7f properly require javascript libraries when generating mountable engine 2011-05-30 05:58:39 -04:00
Bogdan Gusiev
aa2639e746 ActiveModel::MassAssignmentSecurity.mass_assignment_sanitizer method
In order to specify your own sanitize method
Implemented .mass_assignment_sanitizer configuration option
2011-05-30 11:34:00 +03:00
Vishnu Atrai
f4a2b9ee85 refectored assets:clean task 2011-05-30 11:26:11 +05:30
Evan Farrar
91b19186f7 Spelling corrections in the guides. 2011-05-29 22:08:41 -04:00
Mohammad Typaldos
ace7508715 Adding assets to a gem 2011-05-29 20:39:33 -04:00
Aaron Patterson
96525d632d avoid creating range objects 2011-05-29 13:37:42 -07:00
Aaron Patterson
eb3f81f9dc Merge pull request #1398 from leereilly/my_new_branch
Corrected some typos and American vs. Queen's English issues
2011-05-29 12:46:35 -07:00
Lee Reilly
4f234bfd79 Corrected some typos and American vs. Queen's English issues 2011-05-29 12:40:24 -07:00
Evan Farrar
bfce2a4cd3 Typo and sentence restructuring 2011-05-29 11:25:37 -04:00
Evan Farrar
8314c8ebb9 Typo in the asset pipeline guide. 2011-05-29 10:37:07 -04:00
Vijay Dev
1962217e42 removed references to old remote_* helpers; add info about 3.1 adding multipart option to a form with file_field automatically 2011-05-29 18:35:42 +05:30
Mohammad Typaldos
07dcae093b Fixes spelling mistakes pointed out by @vijaydev 2011-05-29 06:45:57 -04:00
Mohammad Typaldos
9342ad6748 Changes wording to make it a bit eaiser to understand 2011-05-29 06:43:35 -04:00
Mohammad Typaldos
4967b35e00 Why should you use the asset pipeline? 2011-05-29 06:37:08 -04:00
Sebastian Martinez
802555a5cd #drop_table accepts no options now. 2011-05-28 18:19:32 -03:00
Aaron Patterson
18b153d15d Merge pull request #1384 from amatsuda/simplify_drop_table
Remove unused options from drop_table
2011-05-28 13:36:40 -07:00
Vijay Dev
fc381a3a42 fix typo 2011-05-29 01:33:30 +05:30
José Valim
a1b1f91e06 Merge pull request #1380 from vijaydev/session_migration
Use 3.1 style migration for sessions table
2011-05-28 12:45:14 -07:00
José Valim
a46b03e728 Merge pull request #1203 from dchelimsky/stringify-parameter-values-in-tests
Stringify param values in controller tests.
2011-05-28 12:43:13 -07:00
Akira Matsuda
bcb466c543 No need to pass options which is never used 2011-05-29 04:30:22 +09:00
Akira Matsuda
d8f4988867 No need to override for just calling super 2011-05-29 04:29:19 +09:00
Vijay Dev
7d7b2009bb document aliases for commands and update rails versions 2011-05-28 23:18:08 +05:30
Vijay Dev
995ea00328 Use change in place of up and down in sessions table migration 2011-05-28 21:59:54 +05:30
José Valim
2fd7ea97ec Merge pull request #1378 from AndrewRadev/master
Add changelog entry for pull request #1359
2011-05-28 07:51:43 -07:00
Andrew Radev
1cd235ecdd ActiveSupport CHANGELOG entry moved to correct place 2011-05-28 17:23:45 +03:00
Andrew Radev
07a353dde1 Update CHANGELOG for ActiveSupport::OrderedHash change 2011-05-28 16:21:16 +03:00
José Valim
429a1f2d4a Merge pull request #1373 from anbotero/master
Minor typo corrected
2011-05-28 00:53:50 -07:00
Andrés Botero
5a5736d735 Fix typo in test. 2011-05-28 00:51:00 -07:00
José Valim
f07ff6b8fb Merge pull request #1372 from jacott/master
Fix for relative_url_root when used with sprockets
2011-05-27 23:46:39 -07:00
jacott
db5adf2d42 fixed asset_paths when called from sprockets for relative_url_root 2011-05-28 18:19:11 +12:00
Xavier Noria
6a3eabe96b Merge pull request #1371 from FLOChip/typo
Typo in ActionMailer::Base
2011-05-27 23:14:45 -07:00
Teng Siong Ong
9a67a117b3 minor typo in the rdoc about Interceptor. 2011-05-28 13:58:47 +08:00
Teng Siong Ong
0f0213f490 minor spacing fix in code example in ActionMailer::Base. 2011-05-28 13:58:02 +08:00
Ben Orenstein
4a376e48b9 Fix incorrect description of the returned results. 2011-05-27 22:05:22 -04:00
Aaron Patterson
b7baf1211f Merge pull request #1368 from amatsuda/disable_im_by_default_on_test
Disable IdentityMap by default for ActiveRecord testing
2011-05-27 18:07:50 -07:00
Akira Matsuda
9fb51e76fd Disable IdentityMap by default for ActiveRecord testing
because enabling IM by default will possibly hide some bugs on 3.1 default behavior
2011-05-28 09:08:13 +09:00
Aaron Patterson
c122c7b271 stop using boolean expressions because of the side effects 2011-05-27 14:53:20 -07:00
Aaron Patterson
4b536f7591 Merge pull request #1365 from gnufied/sqlite3
close statment only if its not closed
2011-05-27 14:40:32 -07:00
Aaron Patterson
2a9b3abe19 Merge pull request #1229 from workmad3/master
Fix for Issue #1205
2011-05-27 14:34:05 -07:00
Hemant Kumar
ed1a0672ab delegate connection and column_hash calls directly to model 2011-05-28 03:00:11 +05:30
Hemant Kumar
d48add714d close statment only if its not closed 2011-05-28 02:57:36 +05:30
Aaron Patterson
985ace4d7f work around bug in the sqlite3 bindings. fixes #1289 2011-05-27 14:12:28 -07:00
Lucas Stephanou
c44418ea4e [activerecord][postgresql] verify if table has a schema(not public) 2011-05-27 17:48:34 -03:00
Lucas Stephanou
055c6fb010 find sequences with pg schemas properly 2011-05-27 16:39:19 -03:00
Aaron Patterson
62d5ef0c17 Merge pull request #1346 from arunagw/jdom_file_from_xml_fix
Jdom file from xml fix
2011-05-27 11:52:43 -07:00
Aaron Patterson
8628948e2a fixing test for mysql2 2011-05-27 11:44:14 -07:00
José Valim
4ae8381e3a Merge pull request #1359 from AndrewRadev/master
Fix for ruby 1.8 bug with ActiveSupport::OrderedHash
2011-05-27 09:43:09 -07:00
Vishnu Atrai
008a0ecdb1 rename task and Rake::FileList used 2011-05-27 20:12:11 +05:30
Stefan Sprenger
fd59a3a1d7 We moved engine commands to rails/engine/commands 2011-05-27 13:56:39 +02:00
Stefan Sprenger
0ac5c03f16 Add destroy to engine's commands 2011-05-27 13:50:42 +02:00
Stefan Sprenger
e38d3752c3 Generate script/rails only if --full is given 2011-05-27 13:44:10 +02:00
Stefan Sprenger
5f00592466 Refactor identifying generator's destination root 2011-05-27 13:29:22 +02:00
Stefan Sprenger
a0ee2270d3 Fix appending ' 2011-05-27 13:29:22 +02:00
Andrew Radev
c9cc36bde9 Fixes minor ruby 1.8 inconsistency
ActiveSupport::OrderedHash did not behave identically to Hash when given
a block with a splat.
2011-05-27 14:04:39 +03:00
Stefan Sprenger
d111de8139 We're using module not class for namespacing 2011-05-27 11:52:45 +02:00
Bhavin Kamani
9d10c2a03d Add rake task to implement assets:cleanup, fixes Github Issues # 1284 2011-05-27 14:00:20 +05:30
Stefan Sprenger
b7476767e6 Move requiring engine out of the switch case 2011-05-27 08:46:57 +02:00
Stefan Sprenger
9935c308f1 Fix and test ENGINE_PATH and ENGINE_ROOT 2011-05-27 08:25:56 +02:00
Ben Orenstein
5b6a423d6b Copy edits 64148ab96b (previous commit). Please squash at will. 2011-05-26 22:22:10 -04:00
Ben Orenstein
64148ab96b Improve 'Joining Tables' section with additional examples and explanation. 2011-05-26 22:19:10 -04:00
Ben Orenstein
4807088fda Don't you lie to me! 2011-05-26 20:54:46 -04:00
Aaron Patterson
d1c74706c3 adding a test for #1322 2011-05-26 16:16:57 -07:00
Sebastian Martinez
dfba8f544b Fix font styling on associations.rb 2011-05-26 17:51:20 -03:00
Jon Leighton
602fff1f58 Merge pull request #1323 from fx/association_primary_key
use association_primary_key in AssociationScope#add_constraints
2011-05-26 13:08:10 -07:00
Jon Leighton
09e431aa89 Merge pull request #1318 from TheEmpty/master
Resolve issue #534
2011-05-26 12:54:38 -07:00
Arun Agrawal
0094351a24 Adding tests for file_from_xml for XmlMini_JDOM #jruby 2011-05-27 00:48:59 +05:30
Arun Agrawal
d16466388e Adding __content__ into XmlMini_JDOM 2011-05-27 00:47:57 +05:30
Mohammad Typaldos
ded7e35cb0 Removes a now needless test - via Github 2011-05-26 12:17:20 -07:00
José Valim
0731945e74 Merge pull request #1334 from bogdan/callback
MassAssignmentSecurity: add ability to specify your own sanitizer
2011-05-26 11:47:35 -07:00
José Valim
d341d16677 Merge pull request #1344 from jmileham/serialization_includes
AR Serialization shouldn't fall back to base opts for includes
2011-05-26 11:21:05 -07:00
Stefan Sprenger
835c9cee3e Introducing engine commands 2011-05-26 17:59:00 +02:00
Stefan Sprenger
60281af200 Move load_generators from Rails::Application to Rails::Engine 2011-05-26 17:57:46 +02:00
Stefan Sprenger
6ee461237a We're now using generators directly 2011-05-26 17:54:31 +02:00
John Mileham
043b624390 Don't merge base opts into includes when serializing ARs
Conflicts:

	activerecord/lib/active_record/serialization.rb
2011-05-26 11:40:57 -04:00
Tekin
52f0437af1 Correct TESTOPTS specification in activerecord/RUNNING_UNIT_TESTS 2011-05-26 16:24:44 +01:00
John Mileham
294e2a8c2e Failing test - JSON serialization shouldn't merge base opts into include opts. 2011-05-26 11:24:25 -04:00
diego
3ffe1cd27b Added missing quote in grouped_options_for_select example 2011-05-26 15:24:33 +02:00
Bogdan Gusiev
c7567c9a6d MassAssignmentSecurity: add ability to specify your own sanitizer
Added an ability to specify your own behavior on mass assingment
protection, controlled by option:
ActiveModel::MassAssignmentSecurity.mass_assignment_sanitizer
2011-05-26 15:58:43 +03:00
José Valim
5083d70f6f Merge pull request #1328 from flippingbits/cleanup_engine_generator
Cleanup engine generator
2011-05-26 03:44:14 -07:00
Marian Rudzynski
f4ed56df43 added assertion for non-standard primary_key on models used in the primary_key test 2011-05-26 12:40:09 +02:00
Stefan Sprenger
4686ace999 Use global namespace Rails 2011-05-26 12:06:17 +02:00
Stefan Sprenger
11862932ec Use plugin name consistently 2011-05-26 12:01:59 +02:00
José Valim
ec08bfc035 Merge pull request #1324 from dmathieu/no_error_on_invalid_format
Don't raise an exception if the format isn't recognized
2011-05-26 02:29:23 -07:00
dmathieu
16571f9c42 don't raise an exception if the format isn't recognized
Fixed while traveling to heuruko
2011-05-26 11:18:30 +02:00
Marian Rudzynski
1f7c3d0264 use association_primary_key in AssociationScope#add_constraints 2011-05-26 11:00:27 +02:00
José Valim
badc72f3e6 Merge pull request #1315 from ardavis/master
Removed unnecessary space in application.rb
2011-05-25 22:46:53 -07:00
Mohammad El-Abid
ec44763f03 Removes the restriction on primary key when joining in a habtm && test that it was properly removed 2011-05-26 00:54:51 -04:00
Thais Camilo
ec080f98a2 Stop linking Rails guidelines to GitHub wiki 2011-05-25 20:45:44 -04:00
Thais Camilo
4da4856f50 Stop linking API Guidelines to GitHub wiki 2011-05-25 20:38:55 -04:00
Aaron Patterson
bf9272b9d4 Merge pull request #1316 from guilleiguaran/railties-changelog
Updating Railties changelog
2011-05-25 17:32:40 -07:00
Thais Camilo
2cd26b7679 On "contribute" guide: remove mention of LH 2011-05-25 20:19:35 -04:00
Guillermo Iguaran
433390de2d Updating Railties changelog 2011-05-25 18:49:17 -05:00
Andrew Davis
60ca8d9593 Added a space to the comment_if helper for formatting purposes 2011-05-25 19:18:29 -04:00
Sebastian Martinez
ab3c87a2d2 Revert this, commited by mistake. 2011-05-25 20:13:49 -03:00
Sebastian Martinez
4c566940a4 Fix grammar mistake. Lets vs let's. 2011-05-25 20:09:06 -03:00
Andrew Davis
063229525f Accidentally added extra IDE files, removed them. 2011-05-25 19:04:15 -04:00
Andrew Davis
3b23759a74 Removed unnecessary space in application.rb for formatting 2011-05-25 19:03:29 -04:00
Sebastian Martinez
0f7a52d920 Fix fixed-fonts stlye on rails_on_rack guide. 2011-05-25 20:03:06 -03:00
José Valim
9b6791870b Merge pull request #1312 from joshk/remove_active_support_deprecations
Removed deprecated methods and related tests from ActiveSupport
2011-05-25 14:55:04 -07:00
Josh Kalderimis
9cafc28874 Removed deprecated methods and related tests from ActiveSupport 2011-05-25 23:39:34 +02:00
José Valim
7fd0a6de84 Merge pull request #1311 from kuldarkrabbi/master
action_view/template/handler.rb has been removed
2011-05-25 14:15:00 -07:00
Kuldar Krabbi
9a6833378a action_view/template/handler has been removed 2011-05-25 16:59:04 -04:00
Xavier Noria
b7921f50e7 Merge branch 'master' of github.com:rails/rails 2011-05-25 22:49:23 +02:00
Xavier Noria
00e1d0832e Merge branch 'master' of git://github.com/lifo/docrails
Conflicts:
	actionmailer/lib/action_mailer/base.rb
	activesupport/lib/active_support/core_ext/kernel/requires.rb
2011-05-25 22:48:47 +02:00
Aaron Patterson
6b436c23a9 Merge pull request #1285 from joshk/remove_active_record_deprecations
removed deprecated methods, and related tests, from ActiveRecord
2011-05-25 13:48:35 -07:00
José Valim
d25b7c2eee Merge pull request #1305 from amatsuda/require_rdoc_task_fail2
Ensure RDoc::Task exists even if 'rdoc/task' was not required
2011-05-25 13:43:55 -07:00
José Valim
89d06eacf6 Merge pull request #1308 from vijaydev/fix-codestat-indent
Minor indentation fix in code_statistics
2011-05-25 13:38:37 -07:00
Lee Reilly
03f418370a Typo; changed 'Febuary' to 'February' 2011-05-25 13:15:59 -07:00
Lee Reilly
1d637d2f48 Typo; changed 'colour' to 'color' & 'analysed' to 'analyzed' 2011-05-25 13:15:18 -07:00
Lee Reilly
29ff12b738 Typo; changed 'enviroment' to 'environment' 2011-05-25 13:14:00 -07:00
Vijay Dev
2c29c40a0d prefer validates :x in place of validates_x_of 2011-05-26 00:31:29 +05:30
Vijay Dev
ffaefe2681 fixed minor errors 2011-05-26 00:16:09 +05:30
wycats
e144b3e3cf Renaming helper in the Rake task, but why is this needed in the first place? (paging JP) 2011-05-25 11:35:18 -07:00
Vijay Dev
548e5bafad fix indentation 2011-05-25 23:47:31 +05:30
Vijay Dev
492f60672c changes validates_format & numericality to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
f69d5cddf0 changes validates_inclusion & exclusion to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
34a05a701b changes validates_length_of to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
cc10dff1ad changes validates_confirmation_of to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
084750c2d0 changes validates_acceptance_of to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
deffc9d048 changes validates_uniqueness_of to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
45989b816e changes validates_presence_of to newer syntax 2011-05-25 22:17:36 +05:30
Vijay Dev
542cee3af6 fix incorrect textile syntax 2011-05-25 22:17:36 +05:30
Akira Matsuda
05adf524c6 Ensure RDoc::Task exists even if 'rdoc/task' was not required 2011-05-26 01:37:34 +09:00
Xavier Noria
ee46bb73d4 Merge pull request #1301 from amatsuda/require_rdoc_task_fail
require 'rake/rdoctask' if failed to require 'rdoc/task'
2011-05-25 08:26:09 -07:00
Akira Matsuda
24b28a2a0c require 'rake/rdoctask' if failed to require 'rdoc/task'
fixes a regression introduced by b921679d0d
require 'rdoc/task' fails if the system RDoc version is below 2.4.2 (e.g. CRuby 1.8.7)
2011-05-26 00:15:23 +09:00
José Valim
f116a4835b Merge pull request #1299 from cesario/mit-license
Ensure MIT-LICENSE is included in all the gemspec's
2011-05-25 06:42:46 -07:00
Franck Verrot
4633772a12 Add the MIT-LICENSE to the Active Support gemspec 2011-05-25 15:32:15 +02:00
Franck Verrot
85283f0592 Add the MIT-LICENSE to the Active Resource gemspec 2011-05-25 15:32:10 +02:00
Franck Verrot
64d977359d Add the MIT-LICENSE to the Active Record gemspec 2011-05-25 15:32:04 +02:00
José Valim
903f1f9035 Merge pull request #1298 from flippingbits/add_test_files_to_gemspec
Add test files to engine's gemspec
2011-05-25 06:29:00 -07:00
Stefan Sprenger
22be5ca8b9 Improve test assertion 2011-05-25 15:12:54 +02:00
Stefan Sprenger
360b98f061 Remove whitespaces from empty line 2011-05-25 15:03:42 +02:00
Stefan Sprenger
5cf934eab5 Add test files to engine's gemspec 2011-05-25 15:03:07 +02:00
José Valim
41eac9b3f6 Merge pull request #1260 from flippingbits/master
Remove shebang from the template
2011-05-25 05:40:31 -07:00
Jeff Cohen
727a5a7c82 Replace old wording about http requests 2011-05-25 07:31:45 -05:00
José Valim
b145a725f8 Merge pull request #1297 from cesario/1294-allocated-object-cant-be-inspected
#1294 : allocated object cant be inspected [closes #1294]
2011-05-25 05:02:15 -07:00
Franck Verrot
b2db8740ea Fix the AR::Base#inspect method [closes #1294] 2011-05-25 13:54:38 +02:00
Franck Verrot
bf159aa5fc Test AR::Base#inspect on an allocated object not yet initialized 2011-05-25 13:53:51 +02:00
José Valim
b1bb9d1738 Merge pull request #1293 from janx/master
Fix Rails::Paths::Root documentation
2011-05-25 02:17:10 -07:00
José Valim
9562c0f899 Merge pull request #1292 from arunagw/database_generators
Database.rake file fixed for load_generators
2011-05-25 02:12:54 -07:00
Jan Xie
a984050570 fix Rails::Paths::Root document 2011-05-25 16:40:45 +08:00
Arun Agrawal
5d89675099 Database.rake file fixed for load_generators 2011-05-25 13:57:44 +05:30
José Valim
144d1b8b0d Merge pull request #1290 from arunagw/load_generators_use
Using load_generators
2011-05-25 00:58:37 -07:00
Arun Agrawal
d9204c1391 Using load_generators 2011-05-25 13:13:24 +05:30
José Valim
460ce7d7ea Use load_generators instead. 2011-05-25 09:30:41 +02:00
Vijay Dev
31bb347e77 update language env variable name 2011-05-25 12:51:56 +05:30
José Valim
3b2ee3b2bc Merge pull request #1288 from guilleiguaran/railties-deprecations
Remove Railties deprecated methods
2011-05-25 00:10:47 -07:00
José Valim
a5ee94f6a2 Merge pull request #1287 from guilleiguaran/removing-test_load_generators_from_railties
load_generators_from_railties was removed, remove test with error about it
2011-05-25 00:05:32 -07:00
Mohammad El-Abid
99dd117d62 Adds outline draft#1 for the Asset Pipeline, please comment if you have thoughts about it! 2011-05-25 02:10:14 -04:00
Guillermo Iguaran
944aee7bb1 Removing deprecated config.generators in Rails::Railtie 2011-05-25 00:11:56 -05:00
Guillermo Iguaran
6e1dbb87ef Remove deprecated plugin generator 2011-05-24 23:03:01 -05:00
Guillermo Iguaran
ce350de56e Removing Deprecated Path API tests 2011-05-24 23:03:01 -05:00
Guillermo Iguaran
685a9195aa Removing deprecated config.paths.app.controller API 2011-05-24 23:02:48 -05:00
Guillermo Iguaran
ce4afa25b4 load_generators_from_railties was removed, remove failing test_load_generators_from_railties 2011-05-24 22:03:10 -05:00
Aaron Patterson
c29ce8add0 Merge pull request #1286 from arunagw/fixed_failing_generators_test
Fixed failing tests for generators_test
2011-05-24 19:52:24 -07:00
Arun Agrawal
c302670c84 fixed test_deliver_is_notified need base_mailer 2011-05-25 08:01:56 +05:30
Arun Agrawal
8e55d3e8d0 Fixed failing tests for generators_test 2011-05-25 07:55:20 +05:30
Josh Kalderimis
542114e1d8 removed deprecated methods, and related tests, from ActiveRecord 2011-05-25 02:29:32 +02:00
José Valim
52e01fc59d Everyone receives app as argument for consistency. 2011-05-25 01:37:55 +02:00
José Valim
76cebf2e53 Actually this file may be invoked directly as well with --dev. 2011-05-25 01:27:00 +02:00
José Valim
594b749f3c Streamline generators initialization flow. 2011-05-25 01:16:50 +02:00
wycats
d1d34ce499 Update default Gemfile to point to sass-rails, not sass 2011-05-24 16:12:41 -07:00
Jon Leighton
c69111ba5f Fix infinite recursion where a lazy default scope references a scope. Fixes #1264. 2011-05-25 00:08:14 +01:00
wycats
d21fef324b Hide css:* and the default stylesheet from rails g 2011-05-24 16:04:28 -07:00
wycats
c1df4425b6 Update generator config to support hiding namespaces and pass the app into generator blocks 2011-05-24 16:04:28 -07:00
tomhuda
74ade51eee Move SCSS generators and default templates from Rails to the Sass Railtie (d435726312601edb3ba6f97b34f562221f72c1f8).
* Sass gem registers a compressor
* Sass gem registers generators for assets and scaffold
* Create a default stylesheet_engine ("css") for apps that remove the Sass gem
2011-05-24 16:04:28 -07:00
tomhuda
88cb89056b Change compressor API so that plugins can register default compressors for their stylesheet or JS engines and still allow the user to turn off compression 2011-05-24 16:04:28 -07:00
José Valim
4b86e7bab0 Merge pull request #1283 from joshk/actiom_mailer_tests_fixed
corrected/fixed the ActionMailer tests
2011-05-24 16:01:25 -07:00
Josh Kalderimis
21317d8824 corrected the ActionMailer tests which broke due to some code removed from ActionPack 2011-05-25 00:57:50 +02:00
José Valim
6f413d87b2 Merge pull request #1281 from joshk/removed_action_pack_deprecations
removed deprecated methods, and related tests, from ActionPack
2011-05-24 15:40:08 -07:00
Jon Leighton
ce37f747cd Merge pull request #1254 from pixeltrix/ignore-includes-in-through-scope
Ignore :includes on through associations
2011-05-24 15:34:28 -07:00
Jon Leighton
a000ff7a50 Ensure that the surrounding code in Relation#to_a respects the default_scope (as well as having Relation#arel respect the default scope). Fixes #1233. 2011-05-24 23:29:44 +01:00
Andrew White
f1f1ab77df Failing tests for #1233. 2011-05-24 23:25:21 +01:00
Josh Kalderimis
d182b6ee9c removed deprecated methods, and related tests, from ActionPack 2011-05-24 23:38:59 +02:00
José Valim
90f59b24dc Merge pull request #1279 from dasch/patch-2
Use quotes consistently in Gemfile
2011-05-24 13:32:37 -07:00
José Valim
eff0fdfd60 Merge pull request #1279 from dasch/patch-2
Use quotes consistently in Gemfile
2011-05-24 13:29:48 -07:00
Daniel Schierbeck
ef8c2a89a5 Also use double quotes for #source 2011-05-24 13:29:29 -07:00
Daniel Schierbeck
962936c56b Use quotes consistently in Gemfile 2011-05-24 13:27:43 -07:00
José Valim
b3f51e3b1c Merge pull request #1239 from alindeman/master
Use set data structure to speed up circular reference checks on large/deeply nested objects
2011-05-24 12:59:06 -07:00
José Valim
806d6009f3 Merge pull request #1278 from vijaydev/rake-doctask-warning-fix
Fixes Rake::RDocTask deprecation warnings from Rake 0.9.0
2011-05-24 12:28:14 -07:00
Vijay Dev
b921679d0d fixes Rake::RDocTask deprecation warnings from rake 0.9.0 2011-05-25 00:49:22 +05:30
José Valim
36991f195b Merge pull request #1274 from vijaydev/rake-packagetask-warning-fix
Fixes for Rake::GemPackageTask deprecation warnings from Rake 0.9.0
2011-05-24 12:14:30 -07:00
Aaron Patterson
176883a906 rescue record invalid exceptions and return false from the save method. fixes #796 2011-05-24 11:22:11 -07:00
Aaron Patterson
559d809609 add tests surrounding behavior of save and save! for associations that have validation errors 2011-05-24 11:21:24 -07:00
Vijay Dev
79e9a2983a fixes Rake::GemPackageTask deprecation warnings from rake 0.9.0 2011-05-24 23:39:24 +05:30
Aaron Patterson
964338777d adding a test for create! with invalid associations 2011-05-24 11:06:36 -07:00
Aaron Patterson
0df8830160 do not bother with assert_nothing_raised, the test will fail and we get a better trace without it 2011-05-24 11:05:36 -07:00
Joey Butler
e106dbf039 Add failing test case for issue 796 2011-05-24 10:59:37 -07:00
Jeremy Friesen
f2a0dfc298 Addresses an inconsistency in the ActiveRecord::Base.method_missing handling of dynamic finder methods and the passing of the &block parameter for :find_by_attributes. 2011-05-24 13:52:48 -04:00
José Valim
c4a9467af4 Merge pull request #1271 from joshk/remove_am_deprecated_methods
Removed deprecated ActionMailer API and related tests
2011-05-24 10:35:46 -07:00
Josh Kalderimis
d500ad3f05 Removed deprecated ActionMailer API and related tests 2011-05-24 18:52:11 +02:00
Aaron Patterson
ae323a51f1 Merge pull request #1247 from arunagw/loading-file
Not loading file if PLATFORM not available.
2011-05-24 09:08:38 -07:00
Aaron Patterson
4d3c30adb9 Merge pull request #1253 from arunagw/preformance_java_import
import to java_import.
2011-05-24 09:07:32 -07:00
Aaron Patterson
68d5abeaff Merge pull request #1251 from arunagw/java_import
Using java_import instead of import. Need to do this with rake 0.9.0 #jruby
2011-05-24 09:06:44 -07:00
David Workman
06436b2cad Added a test to check for correct behaviour with no options in add_index command recorder 2011-05-24 17:06:40 +01:00
Karunakar (Ruby)
bfb9f758ae changed http://api.rubyonrails.com to http://api.rubyonrails.org in readme files 2011-05-24 21:12:01 +05:30
David Heinemeier Hansson
dea4035082 Remove asserts for js ext stuff thats not used any more 2011-05-24 10:22:06 -05:00
José Valim
b865576873 Merge pull request #1268 from ernie/compute_asset_host_fix
Redundant condition in compute_asset_host is redundant.
2011-05-24 08:15:25 -07:00
Ernie Miller
15baa49871 Redundant condition in compute_asset_host is redundant. 2011-05-24 11:09:59 -04:00
José Valim
408bbdcda1 Merge pull request #1267 from guilleiguaran/prefer-each-syntax
Prefer 'each' syntax instead of 'for in'
2011-05-24 08:07:49 -07:00
David Heinemeier Hansson
67e12eb378 The asset pipeline is always on for new apps, dont need the legacy js ext stuff 2011-05-24 07:45:54 -05:00
David Heinemeier Hansson
dac68cb922 Merge pull request #1257 from dmathieu/yml_alias
Properly reference yml alias nodes
2011-05-24 05:40:05 -07:00
José Valim
cedadad891 Merge pull request #1262 from dmathieu/dummy_without_tests
Create the dummy app if there's no test_unit but there's a dummy_path
2011-05-24 04:59:28 -07:00
Stefan Sprenger
e2a0a94c6e Add test for shebang in engine's script/rails file 2011-05-24 13:57:36 +02:00
dmathieu
3d9d9f86f5 create the dummy app if there's no test_unit but there's a dummy_path 2011-05-24 13:18:27 +02:00
Stefan Sprenger
e366cd7f91 Merge branch 'master' of https://github.com/rails/rails 2011-05-24 12:43:55 +02:00
José Valim
b8118ef492 Fix failing test suite (please run tests before sending pull requests :S) 2011-05-24 12:37:57 +02:00
Stefan Sprenger
ab0d2f2d62 Remove shebang from the template since it's already added by the
generator
2011-05-24 12:34:05 +02:00
dmathieu
79dc275b8d properly reference yml alias nodes
as per the last version of the yml specifications : http://www.yaml.org/spec/1.2/spec.html#* alias//
2011-05-24 11:18:28 +02:00
tomhuda
00be5bd75d Remaining cleanup from changes to AssetTagHelper 2011-05-24 00:39:04 -07:00
José Valim
72c7160d0d Merge pull request #1255 from flippingbits/master
Fix gemspec of full or mountable engines
2011-05-24 00:37:57 -07:00
Stefan Sprenger
855d14dd94 Add test for gemspec of the generated engine 2011-05-24 09:30:23 +02:00
Stefan Sprenger
e3d7751b54 Add folders app and config to the engine's gemspec if they're available 2011-05-24 09:06:48 +02:00
Andrew White
d8bd19f6ab Ignore :includes on through associations 2011-05-24 07:21:32 +01:00
Guillermo Iguaran
f4d100bb5a Prefer each instead of for on activesupport 2011-05-24 00:41:41 -05:00
Dmytrii Nagirniak
8f003de2c7 fix minor spelling mistakes in comments 2011-05-23 22:40:29 -07:00
Guillermo Iguaran
505e115b4c Removed extra white-spaces on config/environment/test.rb template 2011-05-23 22:38:02 -07:00
Guillermo Iguaran
e9f9bf015e Removing extra white-spaces on config/environment/development.rb template 2011-05-23 22:35:47 -07:00
José Valim
a47a65f105 Merge pull request #1243 from smartinez87/warnings
Fix 'warning: ambiguous first argument; put parentheses or even spaces'.
2011-05-23 22:32:15 -07:00
Arun Agrawal
ed4f2b9862 import to java_import. 2011-05-24 10:13:27 +05:30
Arun Agrawal
89da0d3ab9 Using java_import instead of import. Need to do this with rake 0.9.0 #jruby 2011-05-24 10:07:05 +05:30
Guillermo Iguaran
647c55ac43 Prefer each instead of for in activeresource 2011-05-23 23:08:48 -05:00
Arun Agrawal
f75df05fd1 Not loading file if PLATFORM not available. 2011-05-24 09:16:50 +05:30
Jeff Cohen
3540579a0b Update the MVC explanation in the main README.rdoc file 2011-05-23 21:09:05 -05:00
Sebastian Martinez
130c9b71aa Parenthesize arguments when the first one is a Regexp literal.
This fixes 'warning: ambiguous first argument; put parentheses or even spaces'.
2011-05-23 21:45:00 -03:00
wycats
9dabbd0cff Make sure that Sprockets::Helpers::RailsHelper can be found 2011-05-23 17:27:57 -07:00
Santiago Pastorino
8e7590c72c Merge pull request #1241 from smartinez87/extra-space
Remove extra white-space on exception message.
2011-05-23 17:09:35 -07:00
Sebastian Martinez
dd6c3676af Remove extra white spaces on ActiveSupport docs. 2011-05-23 21:00:45 -03:00
Sebastian Martinez
0034b7822d Remove extra white spaces on ActiveRecord docs. 2011-05-23 20:58:25 -03:00
Sebastian Martinez
05f29ca2c9 Remove extra white-space on some exception messages. 2011-05-23 20:53:18 -03:00
wycats
a9f22dc272 Move the last pockets of Sprockets stuff into the Sprockets directory 2011-05-23 16:45:26 -07:00
wycats
76f947edf7 Move javascript/css helpers into the Sprockets helper and just have them override the old behavior 2011-05-23 16:45:26 -07:00
wycats
4b79029490 Start moving some logic from being embedded in AV into the Rails Sprockets extensions 2011-05-23 16:45:26 -07:00
Sebastian Martinez
2a4b780ab1 Remove extra white spaces on ActiveModel docs. 2011-05-23 20:39:10 -03:00
Sebastian Martinez
5d0d4d8ad3 Remove extra white spaces on ActionMailer docs. 2011-05-23 20:24:04 -03:00
Sebastian Martinez
fcdb5dc557 Remove extra white spaces on ActionPack docs. 2011-05-23 20:22:33 -03:00
Sebastian Martinez
c6ec7e825e Fix styling error on plugins guide. 2011-05-23 20:09:58 -03:00
Aaron Patterson
5ec23b95ba fixing 1.8 support for new fixture tests 2011-05-23 15:06:13 -07:00
Aaron Patterson
1716da0720 removing CSV fixture support 2011-05-23 15:06:12 -07:00
Aaron Patterson
081b36c6ce fixture file will validate fixture format 2011-05-23 15:06:12 -07:00
Aaron Patterson
5278af3d8e return an empty array for empty yaml files 2011-05-23 15:06:12 -07:00
Aaron Patterson
74c5f65bfb use top level file constant for join, etc 2011-05-23 15:06:12 -07:00
Aaron Patterson
ad3f0eec75 adding AR::Fixtures::File class to wrap a fixture file 2011-05-23 15:06:12 -07:00
Andy Lindeman
2213479a12 Use set data structure to speed up circular reference checks on large/deeply nested objects 2011-05-23 17:50:48 -04:00
David Workman
86afbf7464 Using .try to test for the existence of a method option in a nil-resistent manner. Inlined the determination of the options hash for reversing using a ternary operator. Shortens the method in a way that keeps the code neat 2011-05-23 22:33:03 +01:00
Matthew McEachen
12ab1653dc NOTE: doesn't handle newlines. 2011-05-23 14:14:17 -07:00
Jon Leighton
1170cceaae Removed ActiveSupport::SecureRandom in favour of SecureRandom from the standard library. (It has been deprecated in the 3-1-stable branch.) 2011-05-23 20:25:44 +01:00
Jon Leighton
d411c85a65 Replace references to ActiveSupport::SecureRandom with just SecureRandom, and require 'securerandom' from the stdlib when active support is required. 2011-05-23 20:25:44 +01:00
Karunakar (Ruby)
424eff5209 active resource instalation instructions and Licence 2011-05-24 00:13:40 +05:30
JudeArasu
c76c4f6f67 rails request has been moved from Lighthouse to Github, contribution link has been changed 2011-05-23 22:43:22 +05:30
Josh Kalderimis
09314f21c5 removed require_library_or_gem from the AS core extensions guide 2011-05-23 16:38:51 +02:00
David Workman
8588dd431b Neatened up the invert_add_index method as per suggeston 2011-05-23 15:03:42 +01:00
José Valim
a5fb1c6175 Merge pull request #1231 from joshk/ruby-debugger
Ruby debugger corrections
2011-05-23 06:48:05 -07:00
José Valim
5c3f3f10ba Merge pull request #1230 from smartinez87/changelog
Add entry to AP changelog
2011-05-23 06:46:32 -07:00
Josh Kalderimis
2514d65ca2 Removed the AS core_ext/kernel/debugger breakpoint method as this method is added by ruby-debug and should be left as is. Missing tests added. 2011-05-23 15:44:48 +02:00
Josh Kalderimis
eff5d9aed4 Removed AS core_ext/kernel/requires as it's not used and is bad practice. 2011-05-23 15:31:33 +02:00
Sebastian Martinez
b4951b53ff Add entry to AP changelog 2011-05-23 10:03:52 -03:00
David Workman
a7fad65792 Simple fix for correctly inverting an add_index migration when a name has been provided 2011-05-23 13:54:51 +01:00
José Valim
a8b2a895b7 Merge pull request #1228 from fcheung/db_time_fix2
Take into account time spent in AR even if a redirect occurs or if it is after the render
2011-05-23 03:11:15 -07:00
Frederick Cheung
8a722e0912 Take into account time spent in AR even if a redirect occurs or if it is after the render 2011-05-23 10:58:43 +01:00
José Valim
6e5eedeb12 Move content length to the server, this brings the same behavior as in rack 1.2. 2011-05-23 10:28:00 +02:00
José Valim
c944cab6ce Require rubygems (chill out, just for rails internal tests). 2011-05-23 10:28:00 +02:00
Aaron Patterson
78172987cf Merge pull request #1184 from gnufied/master
Fixes connection_not established error while running db:schema:dump
2011-05-23 00:21:13 -07:00
wycats
dd8ab4fda5 Bump Rack version 2011-05-22 23:55:08 -07:00
wycats
72c7aec792 Eliminate uninitialized instance variable warning 2011-05-22 23:39:51 -07:00
wycats
0a587eecc9 Prepare the context in URLHelperTest so that there are no required uninitialized instance variables 2011-05-22 23:38:50 -07:00
José Valim
750194340c Merge pull request #1222 from arunagw/sprockets-fixes
We don't need to load version any more as Sprockets.beta8 is included.
2011-05-22 23:35:55 -07:00
wycats
7b9f3eb10b Always initialize @title in caching test to avoid uninitialized instance variable warning 2011-05-22 23:14:52 -07:00
wycats
ddc584e89e Restructure TemplateAssertions-related code to eliminate circular requires.
Also, no need to include dependencies in AS::Concerns inside included blocks.
2011-05-22 23:13:44 -07:00
wycats
0afefa9504 Make :status an attr_reader to avoid unnecessary warning when replacing status= 2011-05-22 22:34:06 -07:00
Arun Agrawal
531095e64e We don't need to load version any more as Sprockets.beta8 is included. 2011-05-23 07:09:09 +05:30
Matthew Daubert
cb7677180b Minor typo describing engine helpers 2011-05-22 21:17:38 -04:00
Joshua Peek
5e519fb015 Merge branch '3-1-stable'
Conflicts:
	actionpack/actionpack.gemspec
	activemodel/activemodel.gemspec
2011-05-22 20:11:36 -05:00
David Heinemeier Hansson
ba3ea9c90b Revert "Take into account time spent in AR even if a redirect occurs or if it is after the render" because it's causing test failures about missing db_during_render.
This reverts commit 60b55baca9.
2011-05-22 18:10:52 -05:00
Matthew McEachen
3789685221 Merge branch 'master' of github.com:lifo/docrails 2011-05-22 16:08:47 -07:00
Matthew McEachen
330fc8c48d Following proper naming conventions while referring to Rails, Bundler 2011-05-22 16:07:47 -07:00
David Heinemeier Hansson
7124659f3e Merge pull request #1221 from sikachu/fix_tests
Make sure that we're able to run Action Pack test standalone.
2011-05-22 16:05:36 -07:00
Prem Sichanugrist
90f028a4dc Make sure that we're able to run Action Pack test standalone.
Sprocket was trying to look for these two things:

* `Rails::VERSION::STRING`
* `.initializer(str)` in `Rails::Engine`

This commit added require to version.rb into Abstract Unit, and mocking the `Rails::Engine.initializer` in `sprockets_helper_test.rb`
2011-05-22 19:02:54 -04:00
Jon Leighton
d7a910e31e Fix problem with loading polymorphic associations which have been defined in an abstract superclass. Fixes #552. 2011-05-22 21:25:02 +01:00
José Valim
8c19ebe553 Merge pull request #1219 from fcheung/db_time_fix
Take into account time spent in AR even if a redirect occurs or if it is
2011-05-22 12:08:07 -07:00
Frederick Cheung
60b55baca9 Take into account time spent in AR even if a redirect occurs or if it is after the render 2011-05-22 19:49:31 +01:00
José Valim
4ee7d923e1 Merge pull request #1215 from vatrai/remove_require_tzinfo
remove require active_support/tzinfo as file dosent exists #TODO fix
2011-05-22 09:51:54 -07:00
Vishnu Atrai
ab4dbb110d remove require active_support/tzinfo as file dosent exists #TODO fix 2011-05-22 22:08:05 +05:30
José Valim
06474c1553 Merge pull request #1192 from arunagw/removal_extra
No more need rubygems here.
2011-05-22 09:12:27 -07:00
José Valim
ff55924921 Merge pull request #1202 from vatrai/todo_fix
Fix todo Time.xmlschema used instead of Time.parse
2011-05-22 06:05:52 -07:00
David Chelimsky
3f0c71c852 use to_param (and change method to name accordingly)
- exclude Rack::Test::UploadedFile to pass existing tests. Are there any
  other types we're missing?
2011-05-22 08:13:22 -04:00
Aditya Sanghi
e4f6e6ad2d has_many :dependent => :restrict raises an exception but is not documented appropriately. has_one also has :dependent => :restrict but is not documented at all. 2011-05-22 04:47:04 -07:00
Vishnu Atrai
9c9f450e4f require 'time' 2011-05-22 17:16:23 +05:30
José Valim
09fa80dd26 Merge pull request #1193 from arunagw/railties_tests
Loading action_controller twice removed.
2011-05-22 04:40:34 -07:00
José Valim
62d9c831be Depend on I18n ~> 0.6 2011-05-22 13:38:00 +02:00
José Valim
d5646e842f Move I18n dependency back to ActiveSupport. 2011-05-22 13:31:19 +02:00
José Valim
99b5020eb2 Edited actionpack/lib/action_view/helpers/form_helper.rb via GitHub 2011-05-22 04:27:28 -07:00
José Valim
2cd2f51ded Merge pull request #1189 from jmbejar/7c562d5e460d97b18e4f3367b3cfb13401732920
Add method FormHelper#fields_for_with_index
2011-05-22 04:26:31 -07:00
Anuj Dutta
023ca4fd48 Fixed documentation for scope with path. 2011-05-22 11:27:02 +01:00
David Chelimsky
9277e72a3c Stringify param values in controller tests.
This reduces false positives that come from using ints in params in
tests, which do not get converted to strings in the tests. In
implementations going through rack, they do get converted to strings.

- David Chelimsky and Sam Umbach
2011-05-22 02:47:54 -04:00
Vishnu Atrai
4fe6d01a3b Fix todo Time.xmlschema used instead of Time.parse 2011-05-22 11:17:32 +05:30
Matthew McEachen
e368a3468f Removed the enginex plugin reference which is broken -- rails 3.1.0.beta1 has that functionality now. 2011-05-21 17:33:28 -07:00
Arun Agrawal
4c99f323ad Not loading ruby-debug specially. 2011-05-22 03:12:47 +05:30
Arun Agrawal
b85694ff98 Loading action_controller twice removed. 2011-05-22 02:14:17 +05:30
Arun Agrawal
1ffc3063b7 No more need rubygems here. 2011-05-22 02:02:56 +05:30
Sebastian Martinez
31f09a2b18 Remove extra white spaces on guides. 2011-05-21 17:10:59 -03:00
Sebastian Martinez
0087ef9665 Remove extra white spaces. 2011-05-21 16:51:05 -03:00
Jorge Bejar
7c562d5e46 Add method fields_for_with_index to FormHelper 2011-05-21 12:06:04 -03:00
Bhavin Kamani
e9a2ff8bb7 fix connection not established error while running rake task
db:schema:dump
2011-05-21 15:51:07 +05:30
Sebastian Martinez
bf50935a5d Add more doc to #update_column. 2011-05-20 21:56:08 -03:00
Uģis Ozols
ad3e057e48 Remove duplicate words. 2011-05-20 20:26:20 +03:00
Guillermo Iguaran
93570bb321 Changin 'for' with 'each' on FormHelpers guide 2011-05-19 22:33:43 -07:00
Guillermo Iguaran
d0373507e7 Using each instead of for in actionview guide 2011-05-19 22:30:51 -07:00
Guillermo Iguaran
22abbb862a Replacing 'for' with 'each' in actionmailer guide 2011-05-19 22:26:34 -07:00
Akira Matsuda
696c2ea68d Tests for new create_table DSL 2011-05-20 13:17:16 +09:00
Guillermo Iguaran
0cb812a50e Changing examples: use 'each' instead of 'for in' 2011-05-19 21:12:11 -07:00
Akira Matsuda
993e8c55ca No "t." for the migration DSL!
Now you can omit |t| block parameter and all the t. from your migration code, that means, the syntax looks more Rails-3-ish, like the routes DSL and ActionMailer DSL.
Also, this change won't break any of your existing migration files, since the traditional syntax is still available.
2011-05-20 13:09:32 +09:00
Diego Plentz
0d310d590c fixes code highlight in shallow_path example 2011-05-19 17:38:15 -07:00
Sebastian Martinez
223f3117f1 Remove extra white-spaces. 2011-05-19 20:46:43 -03:00
John Paul Ashenfelter
3b18e900e8 Closes GH #1032
Fixed what looks like minor cut/paste error in documentation for ActiveRecord::Locking:Pessimistic
2011-05-19 01:20:26 -04:00
Cyril Wack
17a7943748 Use quotes for command substitution 2011-05-10 15:42:28 -07:00
1183 changed files with 35085 additions and 18797 deletions

47
.gitignore vendored
View File

@@ -1,27 +1,22 @@
pkg
.bundle
Gemfile.lock
.Gemfile
# Don't put *.swp, *.bak, etc here; those belong in a global ~/.gitignore.
# Check out http://help.github.com/ignore-files/ for how to set that up.
debug.log
doc/rdoc
activemodel/doc
activeresource/doc
activerecord/doc
activerecord/sqlnet.log
actionpack/doc
actionmailer/doc
activesupport/doc
activesupport/test/tmp
activemodel/test/fixtures/fixture_database.sqlite3
actionpack/test/tmp
activesupport/test/fixtures/isolation_test
dist
railties/test/500.html
railties/test/fixtures/tmp
railties/test/initializer/root/log
railties/doc
railties/guides/output
railties/tmp
.rvmrc
.rbenv-version
RDOC_MAIN.rdoc
.Gemfile
/.bundle
/.ruby-version
/pkg
/dist
/doc/rdoc
/*/doc
/*/test/tmp
/activerecord/sqlnet.log
/activemodel/test/fixtures/fixture_database.sqlite3
/activesupport/test/fixtures/isolation_test
/railties/test/500.html
/railties/test/fixtures/tmp
/railties/test/initializer/root/log
/railties/doc
/railties/guides/output
/railties/tmp
/RDOC_MAIN.rdoc

View File

@@ -1,8 +1,11 @@
script: 'ci/travis.rb'
before_install:
- gem install bundler
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- 2.0.0
env:
- "GEM=railties"
- "GEM=ap,am,amo,ares,as"
@@ -21,5 +24,5 @@ notifications:
on_success: change
on_failure: always
rooms:
- secure: "CGWvthGkBKNnTnk9YSmf9AXKoiRI33fCl5D3jU4nx3cOPu6kv2R9nMjt9EAo\nOuS4Q85qNSf4VNQ2cUPNiNYSWQ+XiTfivKvDUw/QW9r1FejYyeWarMsSBWA+\n0fADjF1M2dkDIVLgYPfwoXEv7l+j654F1KLKB69F0F/netwP9CQ="
- secure: "YA1alef1ESHWGFNVwvmVGCkMe4cUy4j+UcNvMUESraceiAfVyRMAovlQBGs6\n9kBRm7DHYBUXYC2ABQoJbQRLDr/1B5JPf/M8+Qd7BKu8tcDC03U01SMHFLpO\naOs/HLXcDxtnnpL07tGVsm0zhMc5N8tq4/L3SHxK7Vi+TacwQzI="
bundler_args: --path vendor/bundle

87
Gemfile
View File

@@ -1,89 +1,64 @@
source "http://rubygems.org"
source 'https://rubygems.org'
gemspec
if ENV['AREL']
gem "arel", :path => ENV['AREL']
gem 'arel', :path => ENV['AREL']
else
gem 'arel'
end
gem 'bcrypt-ruby', '~> 3.0.0'
gem 'jquery-rails'
if ENV['JOURNEY']
gem 'journey', :path => ENV['JOURNEY']
else
gem 'journey'
end
gem "bcrypt-ruby", "~> 3.0.0"
gem "jquery-rails"
# This needs to be with require false to avoid
# it being automatically loaded by sprockets
gem "uglifier", ">= 1.0.3", :require => false
gem 'uglifier', '>= 1.0.3', :require => false
gem "rake", ">= 0.8.7"
gem "mocha", "0.10.5"
# execjs >= 2.1.0 doesn't work with Ruby 1.8
gem 'execjs', '< 2.1.0'
gem 'rake', '>= 0.8.7'
gem 'mocha', '~> 0.14', :require => false
group :doc do
# The current sdoc cannot generate GitHub links due
# to a bug, but the PR that fixes it has been there
# for some weeks unapplied. As a temporary solution
# this is our own fork with the fix.
gem "sdoc", :git => 'git://github.com/fxn/sdoc.git'
gem "RedCloth", "~> 4.2" if RUBY_VERSION < "1.9.3"
gem "w3c_validators"
gem 'sdoc', :git => 'git://github.com/fxn/sdoc.git'
gem 'RedCloth', '~> 4.2'
gem 'w3c_validators'
end
# AS
gem "memcache-client", ">= 1.8.5"
platforms :mri_18 do
gem "system_timer"
gem "json"
end
gem 'memcache-client', '>= 1.8.5'
# Add your own local bundler stuff
instance_eval File.read ".Gemfile" if File.exists? ".Gemfile"
instance_eval File.read '.Gemfile' if File.exists? '.Gemfile'
platforms :mri do
group :test do
gem 'ruby-prof', '~> 0.11.2'
gem 'ruby-prof', '~> 0.11.2' if RUBY_VERSION < '2.0'
end
end
platforms :ruby do
if ENV["RB_FSEVENT"]
gem "rb-fsevent"
end
gem "json"
gem "yajl-ruby"
gem "nokogiri", ">= 1.4.4"
gem 'yajl-ruby'
gem 'nokogiri', '>= 1.4.5', '< 1.6'
# AR
gem "sqlite3", "~> 1.3.4"
gem 'sqlite3', '~> 1.3.5'
group :db do
gem "pg", ">= 0.11.0"
gem "mysql", ">= 2.8.1"
gem "mysql2", ">= 0.3.10"
end
end
platforms :jruby do
gem "json"
gem "activerecord-jdbcsqlite3-adapter", ">= 1.2.0"
# This is needed by now to let tests work on JRuby
# TODO: When the JRuby guys merge jruby-openssl in
# jruby this will be removed
gem "jruby-openssl"
group :db do
gem "activerecord-jdbcmysql-adapter", ">= 1.2.0"
gem "activerecord-jdbcpostgresql-adapter", ">= 1.2.0"
end
end
# gems that are necessary for ActiveRecord tests with Oracle database
if ENV['ORACLE_ENHANCED_PATH'] || ENV['ORACLE_ENHANCED']
platforms :ruby do
gem "ruby-oci8", ">= 2.0.4"
end
if ENV['ORACLE_ENHANCED_PATH']
gem "activerecord-oracle_enhanced-adapter", :path => ENV['ORACLE_ENHANCED_PATH']
else
gem "activerecord-oracle_enhanced-adapter", :git => "git://github.com/rsim/oracle-enhanced.git"
gem 'pg', '>= 0.11.0'
gem 'mysql', '>= 2.8.1'
gem 'mysql2', '>= 0.3.10'
end
end

131
Gemfile.lock Normal file
View File

@@ -0,0 +1,131 @@
GIT
remote: git://github.com/fxn/sdoc.git
revision: 9977ca4ecf83a76d637861f79319b11830d51de5
specs:
sdoc (0.3.19)
json (>= 1.1.3)
rdoc (~> 3.10)
PATH
remote: .
specs:
actionmailer (3.2.19)
actionpack (= 3.2.19)
mail (~> 2.5.4)
actionpack (3.2.19)
activemodel (= 3.2.19)
activesupport (= 3.2.19)
builder (~> 3.2)
erubis (~> 2.7.0)
journey (~> 1.0.4)
rack (~> 1.4.5)
rack-cache (~> 1.2)
rack-test (~> 0.6.1)
activemodel (3.2.19)
activesupport (= 3.2.19)
builder (~> 3.2)
activerecord (3.2.19)
activemodel (= 3.2.19)
activesupport (= 3.2.19)
arel (~> 3.0.2)
tzinfo (~> 0.3.29)
activeresource (3.2.19)
activemodel (= 3.2.19)
activesupport (= 3.2.19)
activesupport (3.2.19)
i18n (~> 0.6, >= 0.6.4)
multi_json (~> 1.0)
rails (3.2.19)
actionmailer (= 3.2.19)
actionpack (= 3.2.19)
activerecord (= 3.2.19)
activeresource (= 3.2.19)
activesupport (= 3.2.19)
bundler (~> 1.0)
railties (= 3.2.19)
railties (3.2.19)
actionpack (= 3.2.19)
activesupport (= 3.2.19)
rack-ssl (~> 1.3.2)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (>= 0.14.6, < 2.0)
GEM
remote: https://rubygems.org/
specs:
RedCloth (4.2.9)
arel (3.0.3)
bcrypt-ruby (3.0.1)
benchmark-ips (1.2.0)
builder (3.2.2)
erubis (2.7.0)
execjs (2.0.2)
i18n (0.6.11)
journey (1.0.4)
jquery-rails (3.1.0)
railties (>= 3.0, < 5.0)
thor (>= 0.14, < 2.0)
json (1.8.1)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
memcache-client (1.8.5)
metaclass (0.0.4)
mime-types (1.25.1)
mocha (0.14.0)
metaclass (~> 0.0.1)
multi_json (1.10.1)
mysql (2.9.1)
mysql2 (0.3.15)
nokogiri (1.5.11)
pg (0.17.1)
polyglot (0.3.5)
rack (1.4.5)
rack-cache (1.2)
rack (>= 0.4)
rack-ssl (1.3.4)
rack
rack-test (0.6.2)
rack (>= 1.0)
rake (10.2.2)
rdoc (3.12.2)
json (~> 1.4)
sqlite3 (1.3.9)
thor (0.19.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.41)
uglifier (2.5.0)
execjs (>= 0.3.0)
json (>= 1.8.0)
w3c_validators (1.2)
json
nokogiri
yajl-ruby (1.2.0)
PLATFORMS
ruby
DEPENDENCIES
RedCloth (~> 4.2)
arel
bcrypt-ruby (~> 3.0.0)
benchmark-ips
execjs (< 2.1.0)
journey
jquery-rails
memcache-client (>= 1.8.5)
mocha (~> 0.14)
mysql (>= 2.8.1)
mysql2 (>= 0.3.10)
nokogiri (>= 1.4.5, < 1.6)
pg (>= 0.11.0)
rails!
rake (>= 0.8.7)
sdoc!
sqlite3 (~> 1.3.5)
uglifier (>= 1.0.3)
w3c_validators
yajl-ruby

View File

@@ -1 +1 @@
3.1.8
3.2.19.github9

View File

@@ -18,7 +18,7 @@ you to present the data from database rows as objects and embellish these data o
with business logic methods. Although most Rails models are backed by a database, models
can also be ordinary Ruby classes, or Ruby classes that implement a set of interfaces as
provided by the ActiveModel module. You can read more about Active Record in its
{README}[link:files/activerecord/README_rdoc.html].
{README}[link:/rails/rails/blob/master/activerecord/README.rdoc].
The Controller layer is responsible for handling incoming HTTP requests and providing a
suitable response. Usually this means returning \HTML, but Rails controllers can also
@@ -29,7 +29,7 @@ In Rails, the Controller and View layers are handled together by Action Pack.
These two layers are bundled in a single package due to their heavy interdependence.
This is unlike the relationship between Active Record and Action Pack which are
independent. Each of these packages can be used independently outside of Rails. You
can read more about Action Pack in its {README}[link:files/actionpack/README_rdoc.html].
can read more about Action Pack in its {README}[link:/rails/rails/blob/master/actionpack/README.rdoc].
== Getting Started
@@ -61,13 +61,17 @@ can read more about Action Pack in its {README}[link:files/actionpack/README_rdo
* The {Ruby on Rails Guides}[http://guides.rubyonrails.org].
* The {API Documentation}[http://api.rubyonrails.org].
== Contributing
We encourage you to contribute to Ruby on Rails! Please check out the {Contributing to Rails
guide}[http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html] for guidelines about how
to proceed. {Join us}[http://contributors.rubyonrails.org]!
== Build Status {<img src="https://secure.travis-ci.org/rails/rails.png"/>}[http://travis-ci.org/rails/rails]
== Dependency Status {<img src="https://gemnasium.com/rails/rails.png?travis"/>}[https://gemnasium.com/rails/rails]
== License
Ruby on Rails is released under the MIT license.

238
RELEASING_RAILS.rdoc Normal file
View File

@@ -0,0 +1,238 @@
= Releasing Rails
In this document, we'll cover the steps necessary to release Rails. Each
section contains steps to take during that time before the release. The times
suggested in each header are just that: suggestions. However, they should
really be considered as minimums.
== 10 Days before release
Today is mostly coordination tasks. Here are the things you must do today:
=== Is the CI green? If not, make it green. (See "Fixing the CI")
Do not release with a Red CI. You can find the CI status here:
http://travis-ci.org/#!/rails/rails
=== Is Sam Ruby happy? If not, make him happy.
Sam Ruby keeps a test suite that makes sure the code samples in his book (Agile
Web Development with Rails) all work. These are valuable integration tests
for Rails. You can check the status of his tests here:
http://intertwingly.net/projects/dashboard.html
Do not release with Red AWDwR tests.
=== Are the postgres tests green? If not, make them green
Currently Travis CI doesn't run the Active Record postgres tests. They are
working to resolve this, but in the mean time, it is crucial to ensure that
the tests are still green before release.
=== Do we have any git dependencies? If so, contact those authors.
Having git dependencies indicates that we depend on unreleased code.
Obviously rails cannot be released when it depends on unreleased code.
Contact the authors of those particular gems and work out a release date that
suits them.
=== Contact the security team (either Koz or tenderlove)
Let them know of your plans to release. There may be security issues to be
addressed, and that can impact your release date.
=== Notify implementors.
Ruby implementors have high stakes in making sure Rails works. Be kind and
give them a heads up that Rails will be released soonish.
Send an email just giving a heads up about the upcoming release to these
lists:
* team@jruby.org
* community@rubini.us
* rubyonrails-core@googlegroups.com
Implementors will love you and help you.
== 3 Days before release
This is when you should release the release candidate. Here are your tasks
for today:
=== Is the CI green? If not, make it green.
=== Is Sam Ruby happy? If not, make him happy.
=== Are the postgres tests green? If not, make them green
=== Contact the security team. CVE emails must be sent on this day.
=== Create a release branch.
From the stable branch, create a release branch. For example, if you're
releasing Rails 3.0.10, do this:
[aaron@higgins rails (3-0-stable)]$ git checkout -b 3-0-10
Switched to a new branch '3-0-10'
[aaron@higgins rails (3-0-10)]$
=== Update each CHANGELOG.
Many times commits are made without the CHANGELOG being updated. You should
review the commits since the last release, and fill in any missing information
for each CHANGELOG.
You can review the commits for the 3.0.10 release like this:
[aaron@higgins rails (3-0-10)]$ git log v3.0.9..
If you're doing a stable branch release, you should also ensure that all of
the CHANGELOG entries in the stable branch are also synced to the master
branch.
=== Update the RAILS_VERSION file to include the RC.
=== Build and test the gem.
Run `rake install` to generate the gems and install them locally. Then try
generating a new app and ensure that nothing explodes.
This will stop you from looking silly when you push an RC to rubygems.org and
then realise it is broken.
=== Release the gem.
IMPORTANT: Due to YAML parse problems on the rubygems.org server, it is safest
to use Ruby 1.8 when releasing.
Run `rake release`. This will populate the gemspecs with data from
RAILS_VERSION, commit the changes, tag it, and push the gems to rubygems.org.
Here are the commands that `rake release` should use, so you can understand
what to do in case anything goes wrong:
$ rake all:build
$ git commit -am'updating RAILS_VERSION'
$ git tag -m'tagging rc release' v3.0.10.rc1
$ git push
$ git push --tags
$ for i in $(ls dist); do gem push $i; done
=== Send Rails release announcements
Write a release announcement that includes the version, changes, and links to
github where people can find the specific commit list. Here are the mailing
lists where you should announce:
* rubyonrails-core@googlegroups.com
* rubyonrails-talk@googlegroups.com
* ruby-talk@ruby-lang.org
Use markdown format for your announcement. Remember to ask people to report
issues with the release candidate to the rails-core mailing list.
IMPORTANT: If any users experience regressions when using the release
candidate, you *must* postpone the release. Bugfix releases *should not*
break existing applications.
=== Post the announcement to the Rails blog.
If you used markdown format for your email, you can just paste it in to the
blog.
* http://weblog.rubyonrails.org
=== Post the announcement to the Rails twitter account.
== Time between release candidate and actual release
Check the rails-core mailing list and the github issue list for regressions in
the RC.
If any regressions are found, fix the regressions and repeat the release
candidate process. We will not release the final until 72 hours after the
last release candidate has been pushed. This means that if users find
regressions, the scheduled release date must be postponed.
When you fix the regressions, do not create a new branch. Fix them on the
stable branch, then cherry pick the commit to your release branch. No other
commits should be added to the release branch besides regression fixing commits.
== Day of release
Many of these steps are the same as for the release candidate, so if you need
more explanation on a particular step, so the RC steps.
Today, do this stuff in this order:
* Apply security patches to the release branch
* Update CHANGELOG with security fixes.
* Update RAILS_VERSION to remove the rc
* Build and test the gem
* Release the gems
* Email security lists
* Email general announcement lists
=== Emailing the rails security announce list
Email the security announce list once for each vulnerability fixed.
You can do this, or ask the security team to do it.
Email the security reports to:
* rubyonrails-security@googlegroups.com
* linux-distros@vs.openwall.org
Be sure to note the security fixes in your announcement along with CVE numbers
and links to each patch. Some people may not be able to upgrade right away,
so we need to give them the security fixes in patch form.
* Blog announcements
* Twitter announcements
* Merge the release branch to the stable branch.
* Drink beer (or other cocktail)
== Misc
=== Fixing the CI
There are two simple steps for fixing the CI:
1. Identify the problem
2. Fix it
Repeat these steps until the CI is green.
=== Manually trigger docs generation
We have a post-receive hook in GitHub that calls the docs server on pushes.
It triggers generation and publication of edge docs, updates the contrib app,
and generates and publishes stable docs if a new stable tag is detected.
The hook unfortunately is not invoked by tag pushing, so once the new stable
tag has been pushed to origin, please run
rake publish_docs
You should see something like this:
Rails master hook tasks scheduled:
* updates the local checkout
* updates Rails Contributors
* generates and publishes edge docs
If a new stable tag is detected it also
* generates and publishes stable docs
This needs typically a few minutes.
Note you do not need to specify the tag, the docs server figures it out.
Also, don't worry if you call that multiple times or the hook is triggered
again by some immediate regular push, if the scripts are running new calls
are just queued (in a queue of size 1).

View File

@@ -75,7 +75,12 @@ RDoc::Task.new do |rdoc|
# since no autolinking happens there and RDoc displays the backslash
# otherwise.
rdoc_main.gsub!(/^(?=\S).*?\b(?=Rails)\b/) { "#$&\\" }
rdoc_main.gsub!(%r{link:blob/master/(\w+)/README\.rdoc}, "link:files/\\1/README_rdoc.html")
rdoc_main.gsub!(%r{link:/rails/rails/blob/master/(\w+)/README\.rdoc}, "link:files/\\1/README_rdoc.html")
# Remove Travis and Gemnasium status images from API pages. Only GitHub
# README page gets these images. Travis' https build image is used to avoid
# GitHub caching: http://about.travis-ci.org/docs/user/status-images
rdoc_main.gsub!(%r{^== (Build|Dependency) Status.*}, '')
File.open(RDOC_MAIN, 'w') do |f|
f.write(rdoc_main)
@@ -89,7 +94,7 @@ RDoc::Task.new do |rdoc|
rdoc.options << '-f' << 'sdoc'
rdoc.options << '-T' << 'rails'
rdoc.options << '-c' << 'utf-8'
rdoc.options << '-e' << 'UTF-8'
rdoc.options << '-g' # SDoc flag, link methods to GitHub
rdoc.options << '-m' << RDOC_MAIN
@@ -185,7 +190,7 @@ end
#
desc 'Publishes docs, run this AFTER a new stable tag has been pushed'
task :publish_docs do
Net::HTTP.new('rails-hooks.hashref.com').start do |http|
Net::HTTP.new('api.rubyonrails.org', 8080).start do |http|
request = Net::HTTP::Post.new('/rails-master-hook')
response = http.request(request)
puts response.body

View File

@@ -1,26 +1,123 @@
## Rails 3.1.8 (Aug 9, 2012)
## Rails 3.2.19 (Jul 2, 2014) ##
* No changes.
## Rails 3.2.18 (May 6, 2014) ##
* No changes.
## Rails 3.2.17 (Feb 18, 2014) ##
* No changes.
## Rails 3.2.16 (Dec 3, 2013) ##
* No changes.
## Rails 3.2.15 (Oct 16, 2013) ##
* No changes.
## Rails 3.1.7 (Jul 26, 2012)
## Rails 3.2.14 (Jul 22, 2013) ##
* No changes.
## Rails 3.1.6 (Jun 12, 2012)
## Rails 3.2.13 (Mar 18, 2013) ##
* No changes.
## Rails 3.1.5 (May 31, 2012) ##
* Increase minimum version of mail.
## Rails 3.2.12 (Feb 11, 2013) ##
## Rails 3.1.1 (October 7, 2011) ##
* No changes
* No changes.
## Rails 3.1.0 (August 30, 2011) ##
## Rails 3.2.11 (Jan 8, 2013) ##
* No changes
* No changes.
Please check [3-0-stable](https://github.com/rails/rails/blob/3-0-stable/actionmailer/CHANGELOG) for previous changes.
## Rails 3.2.10 (Jan 2, 2013) ##
* No changes.
## Rails 3.2.9 (Nov 12, 2012) ##
* The return value from mailer methods is no longer relevant. This fixes a bug,
which was introduced with 3.2.9.
Backport #8450
Fix #8448
class ExampleMailer < ActionMailer::Base
# in 3.2.9, returning a falsy value from a mailer action, prevented the email from beeing sent.
# With 3.2.10 the return value is no longer relevant. If you call mail() the email will be sent.
def nil_returning_mailer_action
mail()
nil
end
end
*Yves Senn*
## Rails 3.2.9 (Nov 12, 2012) ##
* Do not render views when mail() isn't called.
Fix #7761
*Yves Senn*
## Rails 3.2.8 (Aug 9, 2012) ##
* No changes.
## Rails 3.2.7 (Jul 26, 2012) ##
* No changes.
## Rails 3.2.6 (Jun 12, 2012) ##
* No changes.
## Rails 3.2.5 (Jun 1, 2012) ##
* No changes.
## Rails 3.2.4 (May 31, 2012) ##
* No changes.
## Rails 3.2.3 (March 30, 2012) ##
* Upgrade mail version to 2.4.3 *ML*
## Rails 3.2.2 (March 1, 2012) ##
* No changes.
## Rails 3.2.1 (January 26, 2012) ##
* No changes.
## Rails 3.2.0 (January 20, 2012) ##
* Upgrade mail version to 2.4.0 *ML*
* Remove Old ActionMailer API *Josh Kalderimis*
Please check [3-1-stable](https://github.com/rails/rails/blob/3-1-stable/actionmailer/CHANGELOG.md) for previous changes.

View File

@@ -137,13 +137,13 @@ The Base class has the full list of configuration options. Here's an example:
== Download and installation
The latest version of Action Mailer can be installed with Rubygems:
The latest version of Action Mailer can be installed with RubyGems:
% [sudo] gem install actionmailer
Source code can be downloaded as part of the Rails project on GitHub
* https://github.com/rails/rails/tree/master/actionmailer
* https://github.com/rails/rails/tree/3-2-stable/actionmailer
== License
@@ -155,7 +155,7 @@ Action Mailer is released under the MIT license.
API documentation is at
* http://api.rubyonrails.com
* http://api.rubyonrails.org
Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:

View File

@@ -6,6 +6,9 @@ Gem::Specification.new do |s|
s.version = version
s.summary = 'Email composition, delivery, and receiving framework (part of Rails).'
s.description = 'Email on Rails. Compose, deliver, receive, and test emails using the familiar controller/view pattern. First-class support for multipart email and attachments.'
s.license = 'MIT'
s.required_ruby_version = '>= 1.8.7'
s.author = 'David Heinemeier Hansson'
@@ -17,5 +20,5 @@ Gem::Specification.new do |s|
s.requirements << 'none'
s.add_dependency('actionpack', version)
s.add_dependency('mail', '~> 2.5')
s.add_dependency('mail', '~> 2.5.4')
end

View File

@@ -40,12 +40,10 @@ require 'active_support/lazy_load_hooks'
module ActionMailer
extend ::ActiveSupport::Autoload
autoload :AdvAttrAccessor
autoload :Collector
autoload :Base
autoload :DeliveryMethods
autoload :MailHelper
autoload :OldApi
autoload :TestCase
autoload :TestHelper
end

View File

@@ -1,28 +0,0 @@
module ActionMailer
module AdvAttrAccessor #:nodoc:
def adv_attr_accessor(name, deprecation=nil)
ivar = "@#{name}"
deprecation ||= "Please pass :#{name} as hash key to mail() instead"
class_eval <<-ACCESSORS, __FILE__, __LINE__ + 1
def #{name}=(value)
ActiveSupport::Deprecation.warn "#{name}= is deprecated. #{deprecation}"
#{ivar} = value
end
def #{name}(*args)
raise ArgumentError, "expected 0 or 1 parameters" unless args.length <= 1
if args.empty?
ActiveSupport::Deprecation.warn "#{name}() is deprecated and will be removed in future versions."
#{ivar} if instance_variable_names.include?(#{ivar.inspect})
else
ActiveSupport::Deprecation.warn "#{name}(value) is deprecated. #{deprecation}"
#{ivar} = args.first
end
end
ACCESSORS
self.protected_instance_variables << ivar if self.respond_to?(:protected_instance_variables)
end
end
end

View File

@@ -1,11 +1,10 @@
require 'mail'
require 'action_mailer/tmail_compat'
require 'action_mailer/collector'
require 'active_support/core_ext/array/wrap'
require 'active_support/core_ext/object/blank'
require 'active_support/core_ext/proc'
require 'active_support/core_ext/string/inflections'
require 'active_support/core_ext/hash/except'
require 'active_support/core_ext/module/anonymous'
require 'action_mailer/log_subscriber'
module ActionMailer #:nodoc:
@@ -23,16 +22,16 @@ module ActionMailer #:nodoc:
#
# Examples:
#
# class Notifier < ActionMailer::Base
# default :from => 'no-reply@example.com',
# class Notifier < ActionMailer::Base
# default :from => 'no-reply@example.com',
# :return_path => 'system@example.com'
#
# def welcome(recipient)
# @account = recipient
# mail(:to => recipient.email_address_with_name,
# :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"])
# end
# end
# def welcome(recipient)
# @account = recipient
# mail(:to => recipient.email_address_with_name,
# :bcc => ["bcc@example.com", "Order Watcher <watcher@example.com>"])
# end
# end
#
# Within the mailer method, you have access to the following methods:
#
@@ -123,8 +122,8 @@ module ActionMailer #:nodoc:
#
# <%= users_url(:host => "example.com") %>
#
# You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
# <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
# You should use the <tt>named_route_url</tt> style (which generates absolute URLs) and avoid using the
# <tt>named_route_path</tt> style (which generates relative URLs), since clients reading the mail will
# have no concept of a current URL from which to determine a relative path.
#
# It is also possible to set a default host that will be used in all mailers by setting the <tt>:host</tt>
@@ -132,13 +131,10 @@ module ActionMailer #:nodoc:
#
# config.action_mailer.default_url_options = { :host => "example.com" }
#
# Setting <tt>ActionMailer::Base.default_url_options</tt> directly is now deprecated, use the configuration
# option mentioned above to set the default host.
#
# If you do decide to set a default <tt>:host</tt> for your mailers you want to use the
# <tt>:only_path => false</tt> option when using <tt>url_for</tt>. This will ensure that absolute URLs are
# generated because the <tt>url_for</tt> view helper will, by default, generate relative URLs when a
# <tt>:host</tt> option isn't explicitly provided.
# When you decide to set a default <tt>:host</tt> for your mailers, then you need to make sure to use the
# <tt>:only_path => false</tt> option when using <tt>url_for</tt>. Since the <tt>url_for</tt> view helper
# will generate relative URLs by default when a <tt>:host</tt> option isn't explicitly provided, passing
# <tt>:only_path => false</tt> will ensure that absolute URLs are generated.
#
# = Sending mail
#
@@ -153,8 +149,8 @@ module ActionMailer #:nodoc:
#
# = Multipart Emails
#
# Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
# multipart templates, where each template is named after the name of the action, followed by the content
# Multipart messages can also be used implicitly because Action Mailer will automatically detect and use
# multipart templates, where each template is named after the name of the action, followed by the content
# type. Each such detected template will be added as a separate part to the message.
#
# For example, if the following templates exist:
@@ -217,15 +213,15 @@ module ActionMailer #:nodoc:
#
# = Observing and Intercepting Mails
#
# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
# register objects that are called during the mail delivery life cycle.
# Action Mailer provides hooks into the Mail observer and interceptor methods. These allow you to
# register classes that are called during the mail delivery life cycle.
#
# An observer object must implement the <tt>:delivered_email(message)</tt> method which will be
# An observer class must implement the <tt>:delivered_email(message)</tt> method which will be
# called once for every email sent after the email has been sent.
#
# An interceptor object must implement the <tt>:delivering_email(message)</tt> method which will be
# An interceptor class must implement the <tt>:delivering_email(message)</tt> method which will be
# called before the email is sent, allowing you to make modifications to the email before it hits
# the delivery agents. Your object should make any needed modifications directly to the passed
# the delivery agents. Your class should make any needed modifications directly to the passed
# in Mail::Message instance.
#
# = Default Hash
@@ -298,9 +294,9 @@ module ActionMailer #:nodoc:
# information and a cryptographic Message Digest 5 algorithm to hash important information)
# * <tt>:enable_starttls_auto</tt> - When set to true, detects if STARTTLS is enabled in your SMTP server
# and starts to use it.
# * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is
# really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name
# of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the
# * <tt>:openssl_verify_mode</tt> - When using TLS, you can set how OpenSSL checks the certificate. This is
# really useful if you need to validate a self-signed and/or a wildcard certificate. You can use the name
# of an OpenSSL verify constant ('none', 'peer', 'client_once','fail_if_no_peer_cert') or directly the
# constant (OpenSSL::SSL::VERIFY_NONE, OpenSSL::SSL::VERIFY_PEER,...).
#
# * <tt>sendmail_settings</tt> - Allows you to override options for the <tt>:sendmail</tt> delivery method.
@@ -316,29 +312,16 @@ module ActionMailer #:nodoc:
#
# * <tt>delivery_method</tt> - Defines a delivery method. Possible values are <tt>:smtp</tt> (default),
# <tt>:sendmail</tt>, <tt>:test</tt>, and <tt>:file</tt>. Or you may provide a custom delivery method
# object eg. MyOwnDeliveryMethodClass.new. See the Mail gem documentation on the interface you need to
# object eg. MyOwnDeliveryMethodClass.new. See the Mail gem documentation on the interface you need to
# implement for a custom delivery agent.
#
# * <tt>perform_deliveries</tt> - Determines whether emails are actually sent from Action Mailer when you
# call <tt>.deliver</tt> on an mail message or on an Action Mailer method. This is on by default but can
# call <tt>.deliver</tt> on an mail message or on an Action Mailer method. This is on by default but can
# be turned off to aid in functional testing.
#
# * <tt>deliveries</tt> - Keeps an array of all the emails sent out through the Action Mailer with
# <tt>delivery_method :test</tt>. Most useful for unit and functional testing.
#
# * <tt>default_charset</tt> - This is now deprecated, use the +default+ method above to
# set the default +:charset+.
#
# * <tt>default_content_type</tt> - This is now deprecated, use the +default+ method above
# to set the default +:content_type+.
#
# * <tt>default_mime_version</tt> - This is now deprecated, use the +default+ method above
# to set the default +:mime_version+.
#
# * <tt>default_implicit_parts_order</tt> - This is now deprecated, use the +default+ method above
# to set the default +:parts_order+. Parts Order is used when a message is built implicitly
# (i.e. multiple parts are assembled from templates which specify the content type in their
# filenames) this variable controls how the parts are ordered.
class Base < AbstractController::Base
include DeliveryMethods
abstract!
@@ -353,7 +336,6 @@ module ActionMailer #:nodoc:
self.protected_instance_variables = %w(@_action_has_layout)
helper ActionMailer::MailHelper
include ActionMailer::OldApi
private_class_method :new #:nodoc:
@@ -393,7 +375,7 @@ module ActionMailer #:nodoc:
end
def mailer_name
@mailer_name ||= name.underscore
@mailer_name ||= anonymous? ? "anonymous" : name.underscore
end
attr_writer :mailer_name
alias :controller_path :mailer_name
@@ -465,13 +447,24 @@ module ActionMailer #:nodoc:
# method, for instance).
def initialize(method_name=nil, *args)
super()
@mail_was_called = false
@_message = Mail.new
process(method_name, *args) if method_name
end
def process(*args) #:nodoc:
lookup_context.skip_default_locale!
super
@_message = NullMail.new unless @mail_was_called
end
class NullMail #:nodoc:
def body; '' end
def method_missing(*args)
nil
end
end
def mailer_name
@@ -542,7 +535,7 @@ module ActionMailer #:nodoc:
#
# * <tt>:subject</tt> - The subject of the message, if this is omitted, Action Mailer will
# ask the Rails I18n class for a translated <tt>:subject</tt> in the scope of
# <tt>[:actionmailer, mailer_scope, action_name]</tt> or if this is missing, will translate the
# <tt>[mailer_scope, action_name]</tt> or if this is missing, will translate the
# humanized version of the <tt>action_name</tt>
# * <tt>:to</tt> - Who the message is destined for, can be a string of addresses, or an array
# of addresses.
@@ -568,8 +561,8 @@ module ActionMailer #:nodoc:
# method.
#
# When a <tt>:return_path</tt> is specified as header, that value will be used as the 'envelope from'
# address for the Mail message. Setting this is useful when you want delivery notifications
# sent to a different address than the one in <tt>:from</tt>. Mail will actually use the
# address for the Mail message. Setting this is useful when you want delivery notifications
# sent to a different address than the one in <tt>:from</tt>. Mail will actually use the
# <tt>:return_path</tt> in preference to the <tt>:sender</tt> in preference to the <tt>:from</tt>
# field for the 'envelope from' value.
#
@@ -621,8 +614,9 @@ module ActionMailer #:nodoc:
# end
#
def mail(headers={}, &block)
# Guard flag to prevent both the old and the new API from firing
# Should be removed when old API is removed
# Guard flag to prevent both the old and the new API from firing.
# On master this flag was renamed to `@_mail_was_called`.
# On master there is only one API and this flag is no longer used as a guard.
@mail_was_called = true
m = @_message
@@ -632,7 +626,7 @@ module ActionMailer #:nodoc:
# Call all the procs (if any)
default_values = self.class.default.merge(self.class.default) do |k,v|
v.respond_to?(:call) ? v.bind(self).call : v
v.respond_to?(:call) ? instance_eval(&v) : v
end
# Handle defaults
@@ -751,3 +745,4 @@ module ActionMailer #:nodoc:
ActiveSupport.run_load_hooks(:action_mailer, self)
end
end

View File

@@ -22,9 +22,9 @@ module ActionMailer #:nodoc:
def custom(mime, options={})
options.reverse_merge!(:content_type => mime.to_s)
@context.freeze_formats([mime.to_sym])
@context.formats = [mime.to_sym]
options[:body] = block_given? ? yield : @default_render.call
@responses << options
end
end
end
end

View File

@@ -4,12 +4,12 @@ module ActionMailer
class LogSubscriber < ActiveSupport::LogSubscriber
def deliver(event)
recipients = Array.wrap(event.payload[:to]).join(', ')
info("\nSent mail to #{recipients} (%1.fms)" % event.duration)
info("\nSent mail to #{recipients} (#{format_duration(event.duration)})")
debug(event.payload[:mail])
end
def receive(event)
info("\nReceived mail (%.1fms)" % event.duration)
info("\nReceived mail (#{format_duration(event.duration)})")
debug(event.payload[:mail])
end
@@ -19,4 +19,4 @@ module ActionMailer
end
end
ActionMailer::LogSubscriber.attach_to :action_mailer
ActionMailer::LogSubscriber.attach_to :action_mailer

View File

@@ -1,255 +0,0 @@
require 'active_support/concern'
require 'active_support/core_ext/object/try'
require 'active_support/core_ext/object/blank'
module ActionMailer
module OldApi #:nodoc:
extend ActiveSupport::Concern
included do
extend ActionMailer::AdvAttrAccessor
self.protected_instance_variables.concat %w(@parts @mail_was_called @headers)
# Specify the BCC addresses for the message
adv_attr_accessor :bcc
# Specify the CC addresses for the message.
adv_attr_accessor :cc
# Specify the charset to use for the message. This defaults to the
# +default_charset+ specified for ActionMailer::Base.
adv_attr_accessor :charset
# Specify the content type for the message. This defaults to <tt>text/plain</tt>
# in most cases, but can be automatically set in some situations.
adv_attr_accessor :content_type
# Specify the from address for the message.
adv_attr_accessor :from
# Specify the address (if different than the "from" address) to direct
# replies to this message.
adv_attr_accessor :reply_to
# Specify the order in which parts should be sorted, based on content-type.
# This defaults to the value for the +default_implicit_parts_order+.
adv_attr_accessor :implicit_parts_order
# Defaults to "1.0", but may be explicitly given if needed.
adv_attr_accessor :mime_version
# The recipient addresses for the message, either as a string (for a single
# address) or an array (for multiple addresses).
adv_attr_accessor :recipients, "Please pass :to as hash key to mail() instead"
# The date on which the message was sent. If not set (the default), the
# header will be set by the delivery agent.
adv_attr_accessor :sent_on, "Please pass :date as hash key to mail() instead"
# Specify the subject of the message.
adv_attr_accessor :subject
# Specify the template name to use for current message. This is the "base"
# template name, without the extension or directory, and may be used to
# have multiple mailer methods share the same template.
adv_attr_accessor :template, "Please pass :template_name or :template_path as hash key to mail() instead"
# Define the body of the message. This is either a Hash (in which case it
# specifies the variables to pass to the template when it is rendered),
# or a string, in which case it specifies the actual text of the message.
adv_attr_accessor :body
end
def process(method_name, *args)
initialize_defaults(method_name)
super
unless @mail_was_called
create_parts
create_mail
end
@_message
end
# Add a part to a multipart message, with the given content-type. The
# part itself is yielded to the block so that other properties (charset,
# body, headers, etc.) can be set on it.
def part(params)
ActiveSupport::Deprecation.warn "part() is deprecated and will be removed in future versions. " <<
"Please pass a block to mail() instead."
params = {:content_type => params} if String === params
if custom_headers = params.delete(:headers)
params.merge!(custom_headers)
end
part = Mail::Part.new(params)
yield part if block_given?
@parts << part
end
# Add an attachment to a multipart message. This is simply a part with the
# content-disposition set to "attachment".
def attachment(params, &block)
ActiveSupport::Deprecation.warn "attachment() is deprecated and will be removed in future versions. " <<
"Please use the attachments[] API instead."
params = { :content_type => params } if String === params
params[:content] ||= params.delete(:data) || params.delete(:body)
if params[:filename]
params = normalize_file_hash(params)
else
params = normalize_nonfile_hash(params)
end
part(params, &block)
end
protected
def normalize_nonfile_hash(params)
content_disposition = "attachment;"
mime_type = params.delete(:mime_type)
if content_type = params.delete(:content_type)
content_type = "#{mime_type || content_type};"
end
params[:body] = params.delete(:data) if params[:data]
{ :content_type => content_type,
:content_disposition => content_disposition }.merge(params)
end
def normalize_file_hash(params)
filename = File.basename(params.delete(:filename))
content_disposition = "attachment; filename=\"#{File.basename(filename)}\""
mime_type = params.delete(:mime_type)
if (content_type = params.delete(:content_type)) && (content_type !~ /filename=/)
content_type = "#{mime_type || content_type}; filename=\"#{filename}\""
end
params[:body] = params.delete(:data) if params[:data]
{ :content_type => content_type,
:content_disposition => content_disposition }.merge(params)
end
def create_mail
m = @_message
set_fields!({:subject => @subject, :to => @recipients, :from => @from,
:bcc => @bcc, :cc => @cc, :reply_to => @reply_to}, @charset)
m.mime_version = @mime_version if @mime_version
m.date = @sent_on.to_time rescue @sent_on if @sent_on
@headers.each { |k, v| m[k] = v }
real_content_type, ctype_attrs = parse_content_type
main_type, sub_type = split_content_type(real_content_type)
if @parts.size == 1 && @parts.first.parts.empty?
m.content_type([main_type, sub_type, ctype_attrs])
m.body = @parts.first.body.encoded
else
@parts.each do |p|
m.add_part(p)
end
m.body.set_sort_order(@implicit_parts_order)
m.body.sort_parts!
if real_content_type =~ /multipart/
ctype_attrs.delete "charset"
m.content_type([main_type, sub_type, ctype_attrs])
end
end
wrap_delivery_behavior!
m.content_transfer_encoding = '8bit' unless m.body.only_us_ascii?
@_message
end
# Set up the default values for the various instance variables of this
# mailer. Subclasses may override this method to provide different
# defaults.
def initialize_defaults(method_name)
@charset ||= self.class.default[:charset].try(:dup)
@content_type ||= self.class.default[:content_type].try(:dup)
@implicit_parts_order ||= self.class.default[:parts_order].try(:dup)
@mime_version ||= self.class.default[:mime_version].try(:dup)
@cc, @bcc, @reply_to, @subject, @from, @recipients = nil, nil, nil, nil, nil, nil
@mailer_name ||= self.class.mailer_name.dup
@template ||= method_name
@mail_was_called = false
@parts ||= []
@headers ||= {}
@sent_on ||= Time.now
@body ||= {}
end
def create_parts
if String === @body
@parts.unshift create_inline_part(@body)
elsif @parts.empty? || @parts.all? { |p| p.content_disposition =~ /^attachment/ }
lookup_context.find_all(@template, [@mailer_name]).each do |template|
self.formats = template.formats
@parts << create_inline_part(render(:template => template), template.mime_type)
end
if @parts.size > 1
@content_type = "multipart/alternative" if @content_type !~ /^multipart/
end
# If this is a multipart e-mail add the mime_version if it is not
# already set.
@mime_version ||= "1.0" unless @parts.empty?
end
end
def create_inline_part(body, mime_type=nil)
ct = mime_type || "text/plain"
main_type, sub_type = split_content_type(ct.to_s)
Mail::Part.new(
:content_type => [main_type, sub_type, {:charset => charset}],
:content_disposition => "inline",
:body => body
)
end
def set_fields!(headers, charset) #:nodoc:
m = @_message
m.charset = charset
m.subject ||= headers.delete(:subject) if headers[:subject]
m.to ||= headers.delete(:to) if headers[:to]
m.from ||= headers.delete(:from) if headers[:from]
m.cc ||= headers.delete(:cc) if headers[:cc]
m.bcc ||= headers.delete(:bcc) if headers[:bcc]
m.reply_to ||= headers.delete(:reply_to) if headers[:reply_to]
end
def split_content_type(ct)
ct.to_s.split("/")
end
def parse_content_type
if @content_type.blank?
[ nil, {} ]
else
ctype, *attrs = @content_type.split(/;\s*/)
attrs = Hash[attrs.map { |attr| attr.split(/=/, 2) }]
[ctype, {"charset" => @charset}.merge!(attrs)]
end
end
end
end

View File

@@ -19,8 +19,9 @@ module ActionMailer
options.stylesheets_dir ||= paths["public/stylesheets"].first
# make sure readers methods get compiled
options.asset_path ||= app.config.asset_path
options.asset_host ||= app.config.asset_host
options.asset_path ||= app.config.asset_path
options.asset_host ||= app.config.asset_host
options.relative_url_root ||= app.config.relative_url_root
ActiveSupport.on_load(:action_mailer) do
include AbstractController::UrlFor

View File

@@ -15,9 +15,22 @@ module ActionMailer
include TestHelper
included do
class_attribute :_mailer_class
setup :initialize_test_deliveries
setup :set_expected_mail
end
module ClassMethods
def tests(mailer)
self._mailer_class = mailer
case mailer
when String, Symbol
self._mailer_class = mailer.to_s.camelize.constantize
when Module
self._mailer_class = mailer
else
raise NonInferrableMailerError.new(mailer)
end
end
def mailer_class
@@ -35,8 +48,6 @@ module ActionMailer
end
end
module InstanceMethods
protected
def initialize_test_deliveries
@@ -64,16 +75,8 @@ module ActionMailer
def read_fixture(action)
IO.readlines(File.join(Rails.root, 'test', 'fixtures', self.class.mailer_class.name.underscore, action))
end
end
included do
class_attribute :_mailer_class
setup :initialize_test_deliveries
setup :set_expected_mail
end
end
include Behavior
end
end

View File

@@ -1,37 +0,0 @@
module Mail
class Message
def set_content_type(*args)
message = 'Message#set_content_type is deprecated, please just call ' <<
'Message#content_type with the same arguments'
ActiveSupport::Deprecation.warn(message, caller[0,2])
content_type(*args)
end
alias :old_transfer_encoding :transfer_encoding
def transfer_encoding(value = nil)
if value
message = 'Message#transfer_encoding is deprecated, ' <<
'please call Message#content_transfer_encoding with the same arguments'
ActiveSupport::Deprecation.warn(message, caller[0,2])
content_transfer_encoding(value)
else
old_transfer_encoding
end
end
def transfer_encoding=(value)
message = 'Message#transfer_encoding= is deprecated, ' <<
'please call Message#content_transfer_encoding= with the same arguments'
ActiveSupport::Deprecation.warn(message, caller[0,2])
self.content_transfer_encoding = value
end
def original_filename
message = 'Message#original_filename is deprecated, please call Message#filename'
ActiveSupport::Deprecation.warn(message, caller[0,2])
filename
end
end
end

View File

@@ -1,8 +1,8 @@
module ActionMailer
module VERSION #:nodoc:
MAJOR = 3
MINOR = 1
TINY = 8
MINOR = 2
TINY = 19
PRE = nil
STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')

View File

@@ -471,6 +471,18 @@ class BaseTest < ActiveSupport::TestCase
assert_equal(%{<img alt="Dummy" src="http://local.com/images/dummy.png" />}, mail.body.to_s.strip)
end
test 'the view is not rendered when mail was never called' do
mail = BaseMailer.without_mail_call
assert_equal('', mail.body.to_s.strip)
mail.deliver
end
test 'the return value of mailer methods is not relevant' do
mail = BaseMailer.with_nil_as_return_value
assert_equal('Welcome', mail.body.to_s.strip)
mail.deliver
end
# Before and After hooks
class MyObserver
@@ -562,6 +574,19 @@ class BaseTest < ActiveSupport::TestCase
assert_equal ["notify"], FooMailer.action_methods
end
test "mailer can be anonymous" do
mailer = Class.new(ActionMailer::Base) do
def welcome
mail
end
end
assert_equal "anonymous", mailer.mailer_name
assert_equal "Welcome", mailer.welcome.subject
assert_equal "Anonymous mailer body", mailer.welcome.body.encoded.strip
end
protected
# Execute the block setting the given values and restoring old values after

View File

@@ -0,0 +1 @@
Anonymous mailer body

View File

@@ -0,0 +1 @@
<% raise 'the template should not be rendered' %>

View File

@@ -1,4 +1,5 @@
require "abstract_unit"
require 'mailers/base_mailer'
require "active_support/log_subscriber/test_helper"
require "action_mailer/log_subscriber"
@@ -11,13 +12,6 @@ class AMLogSubscriberTest < ActionMailer::TestCase
end
class TestMailer < ActionMailer::Base
def basic
recipients "somewhere@example.com"
subject "basic"
from "basic@example.com"
body "Hello world"
end
def receive(mail)
# Do nothing
end
@@ -28,12 +22,12 @@ class AMLogSubscriberTest < ActionMailer::TestCase
end
def test_deliver_is_notified
TestMailer.basic.deliver
BaseMailer.welcome.deliver
wait
assert_equal(1, @logger.logged(:info).size)
assert_match(/Sent mail to somewhere@example.com/, @logger.logged(:info).first)
assert_match(/Sent mail to system@test.lindsaar.net/, @logger.logged(:info).first)
assert_equal(1, @logger.logged(:debug).size)
assert_match(/Hello world/, @logger.logged(:debug).first)
assert_match(/Welcome/, @logger.logged(:debug).first)
end
def test_receive_is_notified

View File

@@ -38,7 +38,7 @@ class BaseMailer < ActionMailer::Base
end
def attachment_with_hash
attachments['invoice.jpg'] = { :data => "\312\213\254\232)b",
attachments['invoice.jpg'] = { :data => ::Base64.encode64("\312\213\254\232)b"),
:mime_type => "image/x-jpg",
:transfer_encoding => "base64" }
mail
@@ -113,6 +113,14 @@ class BaseMailer < ActionMailer::Base
end
def email_with_translations
mail :body => render("email_with_translations.html")
mail :body => render("email_with_translations", :formats => [:html])
end
def without_mail_call
end
def with_nil_as_return_value(hash = {})
mail(:template_name => "welcome")
nil
end
end

View File

@@ -1,41 +0,0 @@
require 'abstract_unit'
require 'action_mailer/adv_attr_accessor'
class AdvAttrTest < ActiveSupport::TestCase
class Person
cattr_reader :protected_instance_variables
@@protected_instance_variables = []
extend ActionMailer::AdvAttrAccessor
adv_attr_accessor :name
end
def setup
ActiveSupport::Deprecation.silenced = true
@person = Person.new
end
def teardown
ActiveSupport::Deprecation.silenced = false
end
def test_adv_attr
assert_nil @person.name
@person.name 'Bob'
assert_equal 'Bob', @person.name
end
def test_adv_attr_writer
assert_nil @person.name
@person.name = 'Bob'
assert_equal 'Bob', @person.name
end
def test_raise_an_error_with_multiple_args
assert_raise(ArgumentError) { @person.name('x', 'y') }
end
def test_ivar_is_added_to_protected_instnace_variables
assert Person.protected_instance_variables.include?('@name')
end
end

View File

@@ -1,134 +0,0 @@
require 'abstract_unit'
class RenderMailer < ActionMailer::Base
def inline_template
recipients 'test@localhost'
subject "using helpers"
from "tester@example.com"
@world = "Earth"
body render(:inline => "Hello, <%= @world %>")
end
def file_template
recipients 'test@localhost'
subject "using helpers"
from "tester@example.com"
@recipient = 'test@localhost'
body render(:file => "templates/signed_up")
end
def no_instance_variable
recipients 'test@localhost'
subject "No Instance Variable"
from "tester@example.com"
silence_warnings do
body render(:inline => "Look, subject.nil? is <%= @subject.nil? %>!")
end
end
def multipart_alternative
recipients 'test@localhost'
subject 'multipart/alternative'
from 'tester@example.com'
build_multipart_message(:foo => "bar")
end
private
def build_multipart_message(assigns = {})
content_type "multipart/alternative"
part "text/plain" do |p|
p.body = build_body_part('plain', assigns, :layout => false)
end
part "text/html" do |p|
p.body = build_body_part('html', assigns)
end
end
def build_body_part(content_type, assigns, options = {})
ActiveSupport::Deprecation.silence do
render "#{template}.#{content_type}", :body => assigns
end
end
end
class FirstMailer < ActionMailer::Base
def share
recipients 'test@localhost'
subject "using helpers"
from "tester@example.com"
end
end
class SecondMailer < ActionMailer::Base
def share
recipients 'test@localhost'
subject "using helpers"
from "tester@example.com"
end
end
# CHANGED: Those tests were changed because body returns an object now
# Instead of mail.body.strip, we should mail.body.to_s.strip
class RenderHelperTest < Test::Unit::TestCase
def setup
set_delivery_method :test
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries.clear
ActiveSupport::Deprecation.silenced = true
@recipient = 'test@localhost'
end
def teardown
ActiveSupport::Deprecation.silenced = false
restore_delivery_method
end
def test_inline_template
mail = RenderMailer.inline_template
assert_equal "Hello, Earth", mail.body.to_s.strip
end
def test_file_template
mail = RenderMailer.file_template
assert_equal "Hello there,\n\nMr. test@localhost", mail.body.to_s.strip
end
def test_no_instance_variable
mail = RenderMailer.no_instance_variable.deliver
assert_equal "Look, subject.nil? is true!", mail.body.to_s.strip
end
end
class FirstSecondHelperTest < Test::Unit::TestCase
def setup
set_delivery_method :test
ActiveSupport::Deprecation.silenced = true
ActionMailer::Base.perform_deliveries = true
ActionMailer::Base.deliveries.clear
@recipient = 'test@localhost'
end
def teardown
ActiveSupport::Deprecation.silenced = false
restore_delivery_method
end
def test_ordering
mail = FirstMailer.share
assert_equal "first mail", mail.body.to_s.strip
mail = SecondMailer.share
assert_equal "second mail", mail.body.to_s.strip
mail = FirstMailer.share
assert_equal "first mail", mail.body.to_s.strip
mail = SecondMailer.share
assert_equal "second mail", mail.body.to_s.strip
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -1,42 +0,0 @@
require 'abstract_unit'
class TmailCompatTest < ActiveSupport::TestCase
def setup
@silence = ActiveSupport::Deprecation.silenced
ActiveSupport::Deprecation.silenced = false
end
def teardown
ActiveSupport::Deprecation.silenced = @silence
end
def test_set_content_type_raises_deprecation_warning
mail = Mail.new
assert_deprecated do
assert_nothing_raised do
mail.set_content_type "text/plain"
end
end
assert_equal mail.mime_type, "text/plain"
end
def test_transfer_encoding_raises_deprecation_warning
mail = Mail.new
assert_deprecated do
assert_nothing_raised do
mail.transfer_encoding "base64"
end
end
assert_equal mail.content_transfer_encoding, "base64"
end
def test_transfer_encoding_setter_raises_deprecation_warning
mail = Mail.new
assert_deprecated do
assert_nothing_raised do
mail.transfer_encoding = "base64"
end
end
assert_equal mail.content_transfer_encoding, "base64"
end
end

View File

@@ -0,0 +1,28 @@
require 'abstract_unit'
class TestTestMailer < ActionMailer::Base
end
class CrazyNameMailerTest < ActionMailer::TestCase
tests TestTestMailer
def test_set_mailer_class_manual
assert_equal TestTestMailer, self.class.mailer_class
end
end
class CrazySymbolNameMailerTest < ActionMailer::TestCase
tests :test_test_mailer
def test_set_mailer_class_manual_using_symbol
assert_equal TestTestMailer, self.class.mailer_class
end
end
class CrazyStringNameMailerTest < ActionMailer::TestCase
tests 'test_test_mailer'
def test_set_mailer_class_manual_using_string
assert_equal TestTestMailer, self.class.mailer_class
end
end

File diff suppressed because it is too large Load Diff

View File

@@ -218,7 +218,7 @@ A short rundown of some of the major features:
def show
# the output of the method will be cached as
# ActionController::Base.page_cache_directory + "/weblog/show/n.html"
# ActionController::Base.page_cache_directory + "/weblog/show.html"
# and the web server will pick it up without even hitting Rails
end
@@ -283,7 +283,7 @@ methods:
The last two lines are responsible for telling ActionController where the
template files are located and actually running the controller on a new
request from the web-server (like to be Apache).
request from the web-server (e.g., Apache).
And the templates look like this:
@@ -316,13 +316,13 @@ an URL such as /weblog/5 (where 5 is the id of the post).
== Download and installation
The latest version of Action Pack can be installed with Rubygems:
The latest version of Action Pack can be installed with RubyGems:
% [sudo] gem install actionpack
Source code can be downloaded as part of the Rails project on GitHub
* https://github.com/rails/rails/tree/master/actionpack
* https://github.com/rails/rails/tree/3-2-stable/actionpack
== License
@@ -334,7 +334,7 @@ Action Pack is released under the MIT license.
API documentation is at
* http://api.rubyonrails.com
* http://api.rubyonrails.org
Bug reports and feature requests can be filed with the rest for the Ruby on Rails project here:

View File

@@ -18,7 +18,7 @@ which can be further narrowed down to one test:
== Dependency on Active Record and database setup
Test cases in the test/controller/active_record/ directory depend on having
Test cases in the test/active_record/ directory depend on having
activerecord and sqlite installed. If Active Record is not in
actionpack/../activerecord directory, or the sqlite rubygem is not installed,
these tests are skipped.

View File

@@ -26,6 +26,11 @@ namespace :test do
Rake::TestTask.new(:isolated) do |t|
t.pattern = 'test/ts_isolated.rb'
end
Rake::TestTask.new(:template) do |t|
t.libs << 'test'
t.pattern = 'test/template/**/*.rb'
end
end
desc 'ActiveRecord Integration Tests'

View File

@@ -6,6 +6,9 @@ Gem::Specification.new do |s|
s.version = version
s.summary = 'Web-flow and rendering framework putting the VC in MVC (part of Rails).'
s.description = 'Web apps on Rails. Simple, battle-tested conventions for building and testing MVC web applications. Works with any Rack-compatible server.'
s.license = 'MIT'
s.required_ruby_version = '>= 1.8.7'
s.author = 'David Heinemeier Hansson'
@@ -20,11 +23,9 @@ Gem::Specification.new do |s|
s.add_dependency('activemodel', version)
s.add_dependency('rack-cache', '~> 1.2')
s.add_dependency('builder', '~> 3.2')
s.add_dependency('i18n', '~> 0.6')
s.add_dependency('rack', '~> 1.4.1')
s.add_dependency('rack', '~> 1.4.5')
s.add_dependency('rack-test', '~> 0.6.1')
s.add_dependency('rack-mount', '~> 0.8.2')
s.add_dependency('sprockets', '~> 2.10')
s.add_dependency('journey', '~> 1.0.4')
s.add_dependency('erubis', '~> 2.7.0')
s.add_development_dependency('tzinfo', '~> 0.3.29')

View File

@@ -0,0 +1,185 @@
ENV['RAILS_ENV'] ||= 'production'
require File.expand_path('../../../load_paths', __FILE__)
require 'action_pack'
require 'action_controller'
require 'action_view'
require 'active_model'
require 'benchmark'
MyHash = Class.new(Hash)
Hash.class_eval do
extend ActiveModel::Naming
include ActiveModel::Conversion
end
class Runner
def initialize(app, output)
@app, @output = app, output
end
def puts(*)
super if @output
end
def call(env)
env['n'].to_i.times { @app.call(env) }
@app.call(env).tap { |response| report(env, response) }
end
def report(env, response)
return unless ENV["DEBUG"]
out = env['rack.errors']
out.puts response[0], response[1].to_yaml, '---'
response[2].each { |part| out.puts part }
out.puts '---'
end
def self.puts(*)
super if @output
end
def self.print(*)
super if @output
end
def self.app_and_env_for(action, n)
env = Rack::MockRequest.env_for("/")
env.merge!('n' => n, 'rack.input' => StringIO.new(''), 'rack.errors' => $stdout)
app = lambda { |env| BasePostController.action(action).call(env) }
return app, env
end
$ran = []
def self.run(action, n, output = true)
print "."
STDOUT.flush
@output = output
label = action.to_s
app, env = app_and_env_for(action, n)
t = Benchmark.realtime { new(app, output).call(env) }
$ran << [label, (t * 1000).to_i.to_s] if output
end
def self.done
puts
header, content = "", ""
$ran.each do |k,v|
size = [k.size, v.size].max + 1
header << format("%#{size}s", k)
content << format("%#{size}s", v)
end
puts header
puts content
end
end
ActionController::Base.logger = nil
ActionController::Base.config.compile_methods!
ActionView::Resolver.caching = ENV["RAILS_ENV"] == "production"
class BasePostController < ActionController::Base
append_view_path "#{File.dirname(__FILE__)}/views"
def overhead
self.response_body = ''
end
def index
render :text => ''
end
$OBJECT = {:name => "Hello my name is omg", :address => "333 omg"}
def partial
render :partial => "/collection", :object => $OBJECT
end
def partial_10
render :partial => "/ten_partials"
end
def partial_100
render :partial => "/hundred_partials"
end
$COLLECTION1 = []
10.times do |i|
$COLLECTION1 << { :name => "Hello my name is omg", :address => "333 omg" }
end
def coll_10
render :partial => "/collection", :collection => $COLLECTION1
end
$COLLECTION2 = []
100.times do |i|
$COLLECTION2 << { :name => "Hello my name is omg", :address => "333 omg" }
end
def coll_100
render :partial => "/collection", :collection => $COLLECTION2
end
def uniq_100
render :partial => $COLLECTION2
end
$COLLECTION3 = []
50.times do |i|
$COLLECTION3 << {:name => "Hello my name is omg", :address => "333 omg"}
$COLLECTION3 << MyHash.new(:name => "Hello my name is omg", :address => "333 omg")
end
def diff_100
render :partial => $COLLECTION3
end
def template_1
render :template => "template"
end
module Foo
def omg
"omg"
end
end
helper Foo
end
N = (ENV['N'] || 1000).to_i
# ActionController::Base.use_accept_header = false
def run_all!(times, verbose)
Runner.run(:overhead, times, verbose)
Runner.run(:index, times, verbose)
Runner.run(:template_1, times, verbose)
Runner.run(:partial, times, verbose)
Runner.run(:partial_10, times, verbose)
Runner.run(:coll_10, times, verbose)
Runner.run(:partial_100, times, verbose)
Runner.run(:coll_100, times, verbose)
Runner.run(:uniq_100, times, verbose)
Runner.run(:diff_100, times, verbose)
end
unless ENV["PROFILE"]
run_all!(1, false)
(ENV["M"] || 1).to_i.times do
$ran = []
run_all!(N, true)
Runner.done
end
else
Runner.run(ENV["PROFILE"].to_sym, 1, false)
require "ruby-prof"
RubyProf.start
Runner.run(ENV["PROFILE"].to_sym, N, true)
result = RubyProf.stop
printer = RubyProf::CallStackPrinter.new(result)
printer.print(File.open("output.html", "w"))
end

View File

@@ -0,0 +1,3 @@
<%= collection[:name] %>
<%= collection[:address] %>
<%= omg %>

View File

@@ -0,0 +1 @@
Hello

View File

@@ -0,0 +1,3 @@
<% 100.times do %>
<%= render :partial => "/collection", :object => $OBJECT %>
<% end %>

View File

@@ -0,0 +1,10 @@
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>
<%= "Hello" %>

View File

@@ -0,0 +1,10 @@
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>
<%= render :partial => '/collection', :object => $OBJECT %>

View File

@@ -0,0 +1,3 @@
<%= hash[:name] %>
<%= hash[:address] %>
<%= omg %>

View File

@@ -0,0 +1,3 @@
<%= my_hash[:name] %>
<%= my_hash[:address] %>
<%= omg %>

View File

@@ -0,0 +1 @@
Hello

View File

@@ -4,7 +4,7 @@ module AbstractController
included do
config_accessor :asset_host, :asset_path, :assets_dir, :javascripts_dir,
:stylesheets_dir, :default_asset_host_protocol
:stylesheets_dir, :default_asset_host_protocol, :relative_url_root
end
end
end

View File

@@ -10,7 +10,7 @@ module AbstractController
# <tt>AbstractController::Base</tt> is a low-level API. Nobody should be
# using it directly, and subclasses (like ActionController::Base) are
# expected to provide their own +render+ method, since rendering means
# different things depending on the context.
# different things depending on the context.
class Base
attr_internal :response_body
attr_internal :action_name
@@ -112,7 +112,7 @@ module AbstractController
def process(action, *args)
@_action_name = action_name = action.to_s
unless action_name = method_for_action(action_name)
unless action_name = _find_action_name(action_name)
raise ActionNotFound, "The action '#{action}' could not be found for #{self.class.name}"
end
@@ -138,7 +138,7 @@ module AbstractController
# available action consider actions that are also available
# through other means, for example, implicit render ones.
def available_action?(action_name)
method_for_action(action_name).present?
_find_action_name(action_name).present?
end
private
@@ -181,6 +181,23 @@ module AbstractController
action_missing(@_action_name, *args)
end
# Takes an action name and returns the name of the method that will
# handle the action.
#
# It checks if the action name is valid and returns false otherwise.
#
# See method_for_action for more information.
#
# ==== Parameters
# * <tt>action_name</tt> - An action name to find a method name for
#
# ==== Returns
# * <tt>string</tt> - The name of the method that handles the action
# * false - No valid method name could be found. Raise ActionNotFound.
def _find_action_name(action_name)
_valid_action_name?(action_name) && method_for_action(action_name)
end
# Takes an action name and returns the name of the method that will
# handle the action. In normal cases, this method returns the same
# name as it receives. By default, if #method_for_action receives
@@ -203,11 +220,16 @@ module AbstractController
#
# ==== Returns
# * <tt>string</tt> - The name of the method that handles the action
# * <tt>nil</tt> - No method name could be found. Raise ActionNotFound.
# * <tt>nil</tt> - No method name could be found.
def method_for_action(action_name)
if action_method?(action_name) then action_name
elsif respond_to?(:action_missing, true) then "_handle_action_missing"
end
end
# Checks if the action name is valid and returns false otherwise.
def _valid_action_name?(action_name)
action_name.to_s !~ Regexp.new(File::SEPARATOR)
end
end
end

View File

@@ -75,38 +75,122 @@ module AbstractController
end
end
##
# :method: before_filter
#
# :call-seq: before_filter(names, block)
#
# Append a before filter. See _insert_callbacks for parameter details.
##
# :method: prepend_before_filter
#
# :call-seq: prepend_before_filter(names, block)
#
# Prepend a before filter. See _insert_callbacks for parameter details.
##
# :method: skip_before_filter
#
# :call-seq: skip_before_filter(names, block)
#
# Skip a before filter. See _insert_callbacks for parameter details.
##
# :method: append_before_filter
#
# :call-seq: append_before_filter(names, block)
#
# Append a before filter. See _insert_callbacks for parameter details.
##
# :method: after_filter
#
# :call-seq: after_filter(names, block)
#
# Append an after filter. See _insert_callbacks for parameter details.
##
# :method: prepend_after_filter
#
# :call-seq: prepend_after_filter(names, block)
#
# Prepend an after filter. See _insert_callbacks for parameter details.
##
# :method: skip_after_filter
#
# :call-seq: skip_after_filter(names, block)
#
# Skip an after filter. See _insert_callbacks for parameter details.
##
# :method: append_after_filter
#
# :call-seq: append_after_filter(names, block)
#
# Append an after filter. See _insert_callbacks for parameter details.
##
# :method: around_filter
#
# :call-seq: around_filter(names, block)
#
# Append an around filter. See _insert_callbacks for parameter details.
##
# :method: prepend_around_filter
#
# :call-seq: prepend_around_filter(names, block)
#
# Prepend an around filter. See _insert_callbacks for parameter details.
##
# :method: skip_around_filter
#
# :call-seq: skip_around_filter(names, block)
#
# Skip an around filter. See _insert_callbacks for parameter details.
##
# :method: append_around_filter
#
# :call-seq: append_around_filter(names, block)
#
# Append an around filter. See _insert_callbacks for parameter details.
# set up before_filter, prepend_before_filter, skip_before_filter, etc.
# for each of before, after, and around.
[:before, :after, :around].each do |filter|
class_eval <<-RUBY_EVAL, __FILE__, __LINE__ + 1
# Append a before, after or around filter. See _insert_callbacks
# for details on the allowed parameters.
def #{filter}_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options|
options[:if] = (Array.wrap(options[:if]) << "!halted") if #{filter == :after}
set_callback(:process_action, :#{filter}, name, options)
end
end
def #{filter}_filter(*names, &blk) # def before_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options|
options[:if] = (Array.wrap(options[:if]) << "!halted") if #{filter == :after} # options[:if] = (Array.wrap(options[:if]) << "!halted") if false
set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before, name, options)
end # end
end # end
# Prepend a before, after or around filter. See _insert_callbacks
# for details on the allowed parameters.
def prepend_#{filter}_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options|
options[:if] = (Array.wrap(options[:if]) << "!halted") if #{filter == :after}
set_callback(:process_action, :#{filter}, name, options.merge(:prepend => true))
end
end
def prepend_#{filter}_filter(*names, &blk) # def prepend_before_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options|
options[:if] = (Array.wrap(options[:if]) << "!halted") if #{filter == :after} # options[:if] = (Array.wrap(options[:if]) << "!halted") if false
set_callback(:process_action, :#{filter}, name, options.merge(:prepend => true)) # set_callback(:process_action, :before, name, options.merge(:prepend => true))
end # end
end # end
# Skip a before, after or around filter. See _insert_callbacks
# for details on the allowed parameters.
def skip_#{filter}_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options|
skip_callback(:process_action, :#{filter}, name, options)
end
end
def skip_#{filter}_filter(*names, &blk) # def skip_before_filter(*names, &blk)
_insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options|
skip_callback(:process_action, :#{filter}, name, options) # skip_callback(:process_action, :before, name, options)
end # end
end # end
# *_filter is the same as append_*_filter
alias_method :append_#{filter}_filter, :#{filter}_filter
alias_method :append_#{filter}_filter, :#{filter}_filter # alias_method :append_before_filter, :before_filter
RUBY_EVAL
end
end

View File

@@ -67,7 +67,7 @@ module AbstractController
# helper FooHelper # => includes FooHelper
#
# When the argument is a string or symbol, the method will provide the "_helper" suffix, require the file
# and include the module in the template class. The second form illustrates how to include custom helpers
# and include the module in the template class. The second form illustrates how to include custom helpers
# when working with namespaced controllers, or other cases where the file containing the helper definition is not
# in one of Rails' standard load paths:
# helper :foo # => requires 'foo_helper' and includes FooHelper

View File

@@ -66,27 +66,40 @@ module AbstractController
# == Inheritance Examples
#
# class BankController < ActionController::Base
# layout "bank_standard"
# # bank.html.erb exists
#
# class ExchangeController < BankController
# # exchange.html.erb exists
#
# class CurrencyController < BankController
#
# class InformationController < BankController
# layout "information"
#
# class TellerController < BankController
# class TellerController < InformationController
# # teller.html.erb exists
#
# class TillController < TellerController
# class EmployeeController < InformationController
# # employee.html.erb exists
# layout nil
#
# class VaultController < BankController
# layout :access_level_layout
#
# class EmployeeController < BankController
# layout nil
# class TillController < BankController
# layout false
#
# In these examples:
# * The InformationController uses the "bank_standard" layout, inherited from BankController.
# * The TellerController follows convention and uses +app/views/layouts/teller.html.erb+.
# * The TillController inherits the layout from TellerController and uses +teller.html.erb+ as well.
# In these examples, we have three implicit lookup scenrios:
# * The BankController uses the "bank" layout.
# * The ExchangeController uses the "exchange" layout.
# * The CurrencyController inherits the layout from BankController.
#
# However, when a layout is explicitly set, the explicitly set layout wins:
# * The InformationController uses the "information" layout, explicitly set.
# * The TellerController also uses the "information" layout, because the parent explicitly set it.
# * The EmployeeController uses the "employee" layout, because it set the layout to nil, resetting the parent configuration.
# * The VaultController chooses a layout dynamically by calling the <tt>access_level_layout</tt> method.
# * The EmployeeController does not use a layout at all.
# * The TillController does not use a layout at all.
#
# == Types of layouts
#
@@ -126,6 +139,22 @@ module AbstractController
# If no directory is specified for the template name, the template will by default be looked for in <tt>app/views/layouts/</tt>.
# Otherwise, it will be looked up relative to the template root.
#
# Setting the layout to nil forces it to be looked up in the filesystem and fallbacks to the parent behavior if none exists.
# Setting it to nil is useful to re-enable template lookup overriding a previous configuration set in the parent:
#
# class ApplicationController < ActionController::Base
# layout "application"
# end
#
# class PostsController < ApplicationController
# # Will use "application" layout
# end
#
# class CommentsController < ApplicationController
# # Will search for "comments" layout and fallback "application" layout
# layout nil
# end
#
# == Conditional layouts
#
# If you have a layout that by default is applied to all the actions of a controller, you still have the option of rendering
@@ -168,11 +197,12 @@ module AbstractController
included do
class_attribute :_layout_conditions
remove_possible_method :_layout_conditions
delegate :_layout_conditions, :to => :'self.class'
self._layout_conditions = {}
_write_layout_method
end
delegate :_layout_conditions, :to => "self.class"
module ClassMethods
def inherited(klass)
super
@@ -188,7 +218,7 @@ module AbstractController
#
# ==== Returns
# * <tt> Boolean</tt> - True if the action has a layout, false otherwise.
def action_has_layout?
def conditional_layout?
return unless super
conditions = _layout_conditions
@@ -207,10 +237,10 @@ module AbstractController
#
# If the specified layout is a:
# String:: the String is the template name
# Symbol:: call the method specified by the symbol, which will return
# the template name
# Symbol:: call the method specified by the symbol, which will return the template name
# false:: There is no layout
# true:: raise an ArgumentError
# nil:: Force default layout behavior with inheritance
#
# ==== Parameters
# * <tt>layout</tt> - The layout to use.
@@ -224,7 +254,7 @@ module AbstractController
conditions.each {|k, v| conditions[k] = Array(v).map {|a| a.to_s} }
self._layout_conditions = conditions
@_layout = layout || false # Converts nil to false
@_layout = layout
_write_layout_method
end
@@ -244,43 +274,71 @@ module AbstractController
def _write_layout_method
remove_possible_method(:_layout)
case defined?(@_layout) ? @_layout : nil
when String
self.class_eval %{def _layout; #{@_layout.inspect} end}, __FILE__, __LINE__
when Symbol
self.class_eval <<-ruby_eval, __FILE__, __LINE__ + 1
def _layout
#{@_layout}.tap do |layout|
unless layout.is_a?(String) || !layout
raise ArgumentError, "Your layout method :#{@_layout} returned \#{layout}. It " \
"should have returned a String, false, or nil"
end
end
end
ruby_eval
when Proc
define_method :_layout_from_proc, &@_layout
self.class_eval %{def _layout; _layout_from_proc(self) end}, __FILE__, __LINE__
when false
self.class_eval %{def _layout; end}, __FILE__, __LINE__
when true
raise ArgumentError, "Layouts must be specified as a String, Symbol, false, or nil"
when nil
if name
_prefixes = _implied_layout_name =~ /\blayouts/ ? [] : ["layouts"]
prefixes = _implied_layout_name =~ /\blayouts/ ? [] : ["layouts"]
name_clause = if name
<<-RUBY
lookup_context.find_all("#{_implied_layout_name}", #{prefixes.inspect}).first || super
RUBY
end
self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def _layout
if template_exists?("#{_implied_layout_name}", #{_prefixes.inspect})
"#{_implied_layout_name}"
if defined?(@_layout)
layout_definition = case @_layout
when String
@_layout.inspect
when Symbol
<<-RUBY
#{@_layout}.tap do |layout|
unless layout.is_a?(String) || !layout
raise ArgumentError, "Your layout method :#{@_layout} returned \#{layout}. It " \
"should have returned a String, false, or nil"
end
end
RUBY
when Proc
define_method :_layout_from_proc, &@_layout
"_layout_from_proc(self)"
when false
nil
when true
raise ArgumentError, "Layouts must be specified as a String, Symbol, false, or nil"
when nil
name_clause
end
else
# Add a deprecation if the parent layout was explicitly set and the child
# still does a dynamic lookup. In next Rails release, we should @_layout
# to be inheritable so we can skip the child lookup if the parent explicitly
# set the layout.
parent = self.superclass.instance_eval { @_layout if defined?(@_layout) }
@_layout = nil
inspect = parent.is_a?(Proc) ? parent.inspect : parent
layout_definition = if parent.nil?
name_clause
elsif name
<<-RUBY
if template = lookup_context.find_all("#{_implied_layout_name}", #{prefixes.inspect}).first
ActiveSupport::Deprecation.warn 'Layout found at "#{_implied_layout_name}" for #{name} but parent controller ' \
'set layout to #{inspect.inspect}. Please explicitly set your layout to "#{_implied_layout_name}" ' \
'or set it to nil to force a dynamic lookup.'
template
else
super
end
end
RUBY
end
RUBY
end
end
self.class_eval { private :_layout }
self.class_eval <<-RUBY, __FILE__, __LINE__ + 1
def _layout
if conditional_layout?
#{layout_definition}
else
#{name_clause}
end
end
private :_layout
RUBY
end
end
@@ -289,8 +347,7 @@ module AbstractController
if _include_layout?(options)
layout = options.key?(:layout) ? options.delete(:layout) : :default
value = _layout_for_option(layout)
options[:layout] = (value =~ /\blayouts/ ? value : "layouts/#{value}") if value
options[:layout] = _layout_for_option(layout)
end
end
@@ -305,6 +362,10 @@ module AbstractController
@_action_has_layout
end
def conditional_layout?
true
end
private
# This will be overwritten by _write_layout_method
@@ -316,9 +377,10 @@ module AbstractController
# * <tt>name</tt> - The name of the template
def _layout_for_option(name)
case name
when String then name
when true then _default_layout(true)
when :default then _default_layout(false)
when String then _normalize_layout(name)
when Proc then name
when true then Proc.new { _default_layout(true) }
when :default then Proc.new { _default_layout(false) }
when false, nil then nil
else
raise ArgumentError,
@@ -326,6 +388,10 @@ module AbstractController
end
end
def _normalize_layout(value)
value.is_a?(String) && value !~ /\blayouts/ ? "layouts/#{value}" : value
end
# Returns the default layout for this controller.
# Optionally raises an exception if the layout could not be found.
#
@@ -337,17 +403,17 @@ module AbstractController
# * <tt>template</tt> - The template object for the default layout (or nil)
def _default_layout(require_layout = false)
begin
layout_name = _layout if action_has_layout?
value = _layout if action_has_layout?
rescue NameError => e
raise e, "Could not render layout: #{e.message}"
end
if require_layout && action_has_layout? && !layout_name
if require_layout && action_has_layout? && !value
raise ArgumentError,
"There was no default layout for #{self.class} in #{view_paths.inspect}"
end
layout_name
_normalize_layout(value)
end
def _include_layout?(options)

View File

@@ -7,7 +7,7 @@ module AbstractController
included do
config_accessor :logger
extend ActiveSupport::Benchmarkable
include ActiveSupport::Benchmarkable
end
end
end

View File

@@ -5,8 +5,8 @@ module AbstractController
Module.new do
define_method(:inherited) do |klass|
super(klass)
if namespace = klass.parents.detect {|m| m.respond_to?(:_railtie) }
klass.send(:include, namespace._railtie.routes.url_helpers)
if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_routes_url_helpers) }
klass.send(:include, namespace.railtie_routes_url_helpers)
else
klass.send(:include, routes.url_helpers)
end

View File

@@ -35,7 +35,7 @@ module AbstractController
include AbstractController::ViewPaths
included do
config_accessor :protected_instance_variables, :instance_reader => false
class_attribute :protected_instance_variables
self.protected_instance_variables = []
end
@@ -59,19 +59,8 @@ module AbstractController
attr_internal_writer :view_context_class
# Explicitly define protected_instance_variables so it can be
# inherited and overwritten by other modules if needed.
def protected_instance_variables
config.protected_instance_variables
end
def view_context_class
@_view_context_class || self.class.view_context_class
end
def initialize(*)
@_view_context_class = nil
super
@_view_context_class ||= self.class.view_context_class
end
# An instance of a view class. The default view class is ActionView::Base
@@ -117,6 +106,7 @@ module AbstractController
# Find and renders a template based on the options given.
# :api: private
def _render_template(options) #:nodoc:
lookup_context.rendered_format = nil if options[:formats]
view_renderer.render(view_context, options)
end

View File

@@ -1,3 +1,5 @@
require 'action_view/base'
module AbstractController
module ViewPaths
extend ActiveSupport::Concern
@@ -8,7 +10,7 @@ module AbstractController
self._view_paths.freeze
end
delegate :find_template, :template_exists?, :view_paths, :formats, :formats=,
delegate :template_exists?, :view_paths, :formats, :formats=,
:locale, :locale=, :to => :lookup_context
module ClassMethods
@@ -63,7 +65,7 @@ module AbstractController
# the default view path. You may also provide a custom view path
# (see ActionView::PathSet for more information)
def append_view_path(path)
self.view_paths = view_paths.dup + Array(path)
self._view_paths = view_paths + Array(path)
end
# Prepend a path to the list of view paths for this controller.
@@ -73,7 +75,7 @@ module AbstractController
# the default view path. You may also provide a custom view path
# (see ActionView::PathSet for more information)
def prepend_view_path(path)
self.view_paths = Array(path) + view_paths.dup
self._view_paths = ActionView::PathSet.new(Array(path) + view_paths)
end
# A list of all of the default view paths for this controller.
@@ -87,8 +89,7 @@ module AbstractController
# * <tt>paths</tt> - If a PathSet is provided, use that;
# otherwise, process the parameter into a PathSet.
def view_paths=(paths)
self._view_paths = ActionView::Base.process_view_paths(paths)
self._view_paths.freeze
self._view_paths = ActionView::PathSet.new(Array.wrap(paths))
end
end
end

View File

@@ -47,21 +47,6 @@ module ActionController
eager_autoload do
autoload :RecordIdentifier
# TODO: Don't autoload exceptions, setup explicit
# requires for files that need them
autoload_at "action_controller/metal/exceptions" do
autoload :ActionControllerError
autoload :RenderError
autoload :RoutingError
autoload :MethodNotAllowed
autoload :NotImplemented
autoload :UnknownController
autoload :MissingFile
autoload :RenderError
autoload :SessionOverflowError
autoload :UnknownHttpMethod
end
end
end

View File

@@ -121,7 +121,7 @@ module ActionController
#
# def search
# @results = Search.find(params[:query])
# case @results
# case @results.count
# when 0 then render :action => "no_results"
# when 1 then render :action => "show"
# when 2..10 then render :action => "show_many"
@@ -192,7 +192,6 @@ module ActionController
Renderers::All,
ConditionalGet,
RackDelegation,
SessionManagement,
Caching,
MimeResponds,
ImplicitRender,

View File

@@ -24,7 +24,6 @@ module ActionController #:nodoc:
#
# config.action_controller.cache_store = :memory_store
# config.action_controller.cache_store = :file_store, "/path/to/cache/directory"
# config.action_controller.cache_store = :drb_store, "druby://localhost:9192"
# config.action_controller.cache_store = :mem_cache_store, "localhost"
# config.action_controller.cache_store = :mem_cache_store, Memcached::Rails.new("localhost:11211")
# config.action_controller.cache_store = MyOwnStore.new("parameter")
@@ -56,6 +55,9 @@ module ActionController #:nodoc:
end
end
include RackDelegation
include AbstractController::Callbacks
include ConfigMethods
include Pages, Actions, Fragments
include Sweeping if defined?(ActiveRecord)

View File

@@ -38,9 +38,9 @@ module ActionController #:nodoc:
# <tt>:action => 'lists'</tt> is not the same as
# <tt>:action => 'list', :format => :xml</tt>.
#
# You can set modify the default action cache path by passing a
# <tt>:cache_path</tt> option. This will be passed directly to
# <tt>ActionCachePath.path_for</tt>. This is handy for actions with
# You can modify the default action cache path by passing a
# <tt>:cache_path</tt> option. This will be passed directly to
# <tt>ActionCachePath.path_for</tt>. This is handy for actions with
# multiple possible routes that should be cached differently. If a
# block is given, it is called with the current controller instance.
#
@@ -102,8 +102,10 @@ module ActionController #:nodoc:
end
def _save_fragment(name, options)
content = response_body
content = content.join if content.is_a?(Array)
content = ""
response_body.each do |parts|
content << parts
end
if caching_allowed?
write_fragment(name, content, options)
@@ -116,9 +118,8 @@ module ActionController #:nodoc:
def expire_action(options = {})
return unless cache_configured?
actions = options[:action]
if actions.is_a?(Array)
actions.each {|action| expire_action(options.merge(:action => action)) }
if options.is_a?(Hash) && options[:action].is_a?(Array)
options[:action].each {|action| expire_action(options.merge(:action => action)) }
else
expire_fragment(ActionCachePath.new(self, options, false).path)
end

View File

@@ -12,13 +12,13 @@ module ActionController #:nodoc:
#
# <% cache do %>
# All the topics in the system:
# <%= render :partial => "topic", :collection => Topic.find(:all) %>
# <%= render :partial => "topic", :collection => Topic.all %>
# <% end %>
#
# This cache will bind the name of the action that called it, so if
# this code was part of the view for the topics/list action, you
# would be able to invalidate it using:
#
#
# expire_fragment(:controller => "topics", :action => "list")
#
# This default behavior is limited if you need to cache multiple
@@ -109,7 +109,6 @@ module ActionController #:nodoc:
def expire_fragment(key, options = nil)
return unless cache_configured?
key = fragment_cache_key(key) unless key.is_a?(Regexp)
message = nil
instrument_fragment_cache :expire_fragment, key do
if key.is_a?(Regexp)

View File

@@ -16,9 +16,10 @@ module ActionController #:nodoc:
# caches_page :show, :new
# end
#
# This will generate cache files such as <tt>weblog/show/5.html</tt> and <tt>weblog/new.html</tt>,
# which match the URLs used to trigger the dynamic generation. This is how the web server is able
# pick up a cache file when it exists and otherwise let the request pass on to Action Pack to generate it.
# This will generate cache files such as <tt>weblog/show/5.html</tt> and <tt>weblog/new.html</tt>, which match the URLs used
# that would normally trigger dynamic page generation. Page caching works by configuring a web server to first check for the
# existence of files on disk, and to serve them directly when found, without passing the request through to Action Pack.
# This is much faster than handling the full dynamic request in the usual way.
#
# Expiration of the cache is handled by deleting the cached file, which results in a lazy regeneration approach where the cache
# is not restored before another hit is made against it. The API for doing so mimics the options from +url_for+ and friends:
@@ -37,23 +38,25 @@ module ActionController #:nodoc:
extend ActiveSupport::Concern
included do
##
# :singleton-method:
# The cache directory should be the document root for the web server and is set using <tt>Base.page_cache_directory = "/document/root"</tt>.
# For Rails, this directory has already been set to Rails.public_path (which is usually set to <tt>Rails.root + "/public"</tt>). Changing
# this setting can be useful to avoid naming conflicts with files in <tt>public/</tt>, but doing so will likely require configuring your
# web server to look in the new location for cached files.
config_accessor :page_cache_directory
class_attribute :page_cache_directory
self.page_cache_directory ||= ''
##
# :singleton-method:
# Most Rails requests do not have an extension, such as <tt>/weblog/new</tt>. In these cases, the page caching mechanism will add one in
# order to make it easy for the cached files to be picked up properly by the web server. By default, this cache extension is <tt>.html</tt>.
# If you want something else, like <tt>.php</tt> or <tt>.shtml</tt>, just set Base.page_cache_extension. In cases where a request already has an
# extension, such as <tt>.xml</tt> or <tt>.rss</tt>, page caching will not add an extension. This allows it to work well with RESTful apps.
config_accessor :page_cache_extension
class_attribute :page_cache_extension
self.page_cache_extension ||= '.html'
# The compression used for gzip. If false (default), the page is not compressed.
# If can be a symbol showing the ZLib compression method, for example, :best_compression
# or :best_speed or an integer configuring the compression level.
class_attribute :page_cache_compression
self.page_cache_compression ||= false
end
module ClassMethods
@@ -65,24 +68,31 @@ module ActionController #:nodoc:
instrument_page_cache :expire_page, path do
File.delete(path) if File.exist?(path)
File.delete(path + '.gz') if File.exist?(path + '.gz')
end
end
# Manually cache the +content+ in the key determined by +path+. Example:
# cache_page "I'm the cached content", "/lists/show"
def cache_page(content, path, extension = nil)
def cache_page(content, path, extension = nil, gzip = Zlib::BEST_COMPRESSION)
return unless perform_caching
path = page_cache_path(path, extension)
instrument_page_cache :write_page, path do
FileUtils.makedirs(File.dirname(path))
File.open(path, "wb+") { |f| f.write(content) }
if gzip
Zlib::GzipWriter.open(path + '.gz', gzip) { |f| f.write(content) }
end
end
end
# Caches the +actions+ using the page-caching approach that'll store the cache in a path within the page_cache_directory that
# Caches the +actions+ using the page-caching approach that'll store
# the cache in a path within the page_cache_directory that
# matches the triggering url.
#
# You can also pass a :gzip option to override the class configuration one.
#
# Usage:
#
# # cache the index action
@@ -90,10 +100,28 @@ module ActionController #:nodoc:
#
# # cache the index action except for JSON requests
# caches_page :index, :if => Proc.new { |c| !c.request.format.json? }
#
# # don't gzip images
# caches_page :image, :gzip => false
def caches_page(*actions)
return unless perform_caching
options = actions.extract_options!
after_filter({:only => actions}.merge(options)) { |c| c.cache_page }
gzip_level = options.fetch(:gzip, page_cache_compression)
gzip_level = case gzip_level
when Symbol
Zlib.const_get(gzip_level.to_s.upcase)
when Fixnum
gzip_level
when false
nil
else
Zlib::BEST_COMPRESSION
end
after_filter({:only => actions}.merge(options)) do |c|
c.cache_page(nil, nil, gzip_level)
end
end
private
@@ -121,7 +149,7 @@ module ActionController #:nodoc:
if options.is_a?(Hash)
if options[:action].is_a?(Array)
options[:action].dup.each do |action|
options[:action].each do |action|
self.class.expire_page(url_for(options.merge(:only_path => true, :action => action)))
end
else
@@ -132,10 +160,10 @@ module ActionController #:nodoc:
end
end
# Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of response.body is used
# If no options are provided, the requested url is used. Example:
# Manually cache the +content+ in the key determined by +options+. If no content is provided, the contents of response.body is used.
# If no options are provided, the url of the current request being handled is used. Example:
# cache_page "I'm the cached content", :controller => "lists", :action => "show"
def cache_page(content = nil, options = nil)
def cache_page(content = nil, options = nil, gzip = Zlib::BEST_COMPRESSION)
return unless self.class.perform_caching && caching_allowed?
path = case options
@@ -151,7 +179,7 @@ module ActionController #:nodoc:
extension = ".#{type_symbol}"
end
self.class.cache_page(content || response.body, path, extension)
self.class.cache_page(content || response.body, path, extension, gzip)
end
end

View File

@@ -88,7 +88,7 @@ module ActionController #:nodoc:
end
def method_missing(method, *arguments, &block)
return if @controller.nil?
return unless @controller
@controller.__send__(method, *arguments, &block)
end
end

View File

@@ -10,7 +10,7 @@ module ActionController
format = payload[:format]
format = format.to_s.upcase if format.is_a?(Symbol)
info " Processing by #{payload[:controller]}##{payload[:action]} as #{format}"
info "Processing by #{payload[:controller]}##{payload[:action]} as #{format}"
info " Parameters: #{params.inspect}" unless params.empty?
end
@@ -20,18 +20,21 @@ module ActionController
status = payload[:status]
if status.nil? && payload[:exception].present?
status = Rack::Utils.status_code(ActionDispatch::ShowExceptions.rescue_responses[payload[:exception].first]) rescue nil
end
message = "Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in %.0fms" % event.duration
exception_class_name = payload[:exception].first
status = ActionDispatch::ExceptionWrapper.status_code_for_exception(exception_class_name)
end
message = "Completed #{status} #{Rack::Utils::HTTP_STATUS_CODES[status]} in #{format_duration(event.duration)}"
message << " (#{additions.join(" | ")})" unless additions.blank?
info(message)
end
def halted_callback(event)
info "Filter chain halted as #{event.payload[:filter]} rendered or redirected"
end
def send_file(event)
message = "Sent file %s"
message << " (%.1fms)"
info(message % [event.payload[:path], event.duration])
info("Sent file #{event.payload[:path]} (#{format_duration(event.duration)})")
end
def redirect_to(event)
@@ -39,7 +42,7 @@ module ActionController
end
def send_data(event)
info("Sent data %s (%.1fms)" % [event.payload[:filename], event.duration])
info("Sent data #{event.payload[:filename]} (#{format_duration(event.duration)})")
end
%w(write_fragment read_fragment exist_fragment?
@@ -48,7 +51,8 @@ module ActionController
def #{method}(event)
key_or_path = event.payload[:key] || event.payload[:path]
human_name = #{method.to_s.humanize.inspect}
info("\#{human_name} \#{key_or_path} \#{"(%.1fms)" % event.duration}")
duration = format_duration(event.duration)
info("\#{human_name} \#{key_or_path} \#{duration}")
end
METHOD
end
@@ -59,4 +63,4 @@ module ActionController
end
end
ActionController::LogSubscriber.attach_to :action_controller
ActionController::LogSubscriber.attach_to :action_controller

View File

@@ -182,10 +182,20 @@ module ActionController
end
def response_body=(val)
body = val.nil? ? nil : (val.respond_to?(:each) ? val : [val])
body = if val.is_a?(String)
[val]
elsif val.nil? || val.respond_to?(:each)
val
else
[val]
end
super body
end
def performed?
response_body
end
def dispatch(name, request) #:nodoc:
@_request = request
@_env = request.env

View File

@@ -1,21 +1,22 @@
require 'active_support/deprecation'
module ActionController
module Compatibility
extend ActiveSupport::Concern
class ::ActionController::ActionControllerError < StandardError #:nodoc:
end
# Temporary hax
included do
::ActionController::UnknownAction = ::AbstractController::ActionNotFound
::ActionController::DoubleRenderError = ::AbstractController::DoubleRenderError
::ActionController::UnknownAction = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('ActionController::UnknownAction', '::AbstractController::ActionNotFound')
::ActionController::DoubleRenderError = ActiveSupport::Deprecation::DeprecatedConstantProxy.new('ActionController::DoubleRenderError', '::AbstractController::DoubleRenderError')
# ROUTES TODO: This should be handled by a middleware and route generation
# should be able to handle SCRIPT_NAME
self.config.relative_url_root = ENV['RAILS_RELATIVE_URL_ROOT']
class << self
delegate :default_charset=, :to => "ActionDispatch::Response"
def self.default_charset=(new_charset)
ActiveSupport::Deprecation.warn "Setting default charset at controller level" \
" is deprecated, please use `config.action_dispatch.default_charset` instead", caller
ActionDispatch::Response.default_charset = new_charset
end
self.protected_instance_variables = %w(
@@ -24,13 +25,19 @@ module ActionController
)
def rescue_action(env)
ActiveSupport::Deprecation.warn "Calling `rescue_action` is deprecated and will be removed in Rails 4.0.", caller
raise env["action_dispatch.rescue.exception"]
end
end
# For old tests
def initialize_template_class(*) end
def assign_shortcuts(*) end
def initialize_template_class(*)
ActiveSupport::Deprecation.warn "Calling `initialize_template_class` is deprecated and has no effect anymore.", caller
end
def assign_shortcuts(*)
ActiveSupport::Deprecation.warn "Calling `assign_shortcuts` is deprecated and has no effect anymore.", caller
end
def _normalize_options(options)
options[:text] = nil if options.delete(:nothing) == true
@@ -44,15 +51,15 @@ module ActionController
end
def _handle_method_missing
ActiveSupport::Deprecation.warn "Using `method_missing` to handle non" \
" existing actions is deprecated and will be removed in Rails 4.0, " \
" please use `action_missing` instead.", caller
method_missing(@_action_name.to_sym)
end
def method_for_action(action_name)
super || (respond_to?(:method_missing) && "_handle_method_missing")
end
def performed?
response_body
super || ((self.class.public_method_defined?(:method_missing) ||
self.class.protected_method_defined?(:method_missing)) && "_handle_method_missing")
end
end
end

View File

@@ -23,8 +23,27 @@ module ActionController
# This will render the show template if the request isn't sending a matching etag or
# If-Modified-Since header and just a <tt>304 Not Modified</tt> response if there's a match.
#
def fresh_when(options)
options.assert_valid_keys(:etag, :last_modified, :public)
# You can also just pass a record where last_modified will be set by calling updated_at and the etag by passing the object itself. Example:
#
# def show
# @article = Article.find(params[:id])
# fresh_when(@article)
# end
#
# When passing a record, you can still set whether the public header:
#
# def show
# @article = Article.find(params[:id])
# fresh_when(@article, :public => true)
# end
def fresh_when(record_or_options, additional_options = {})
if record_or_options.is_a? Hash
options = record_or_options
options.assert_valid_keys(:etag, :last_modified, :public)
else
record = record_or_options
options = { :etag => record, :last_modified => record.try(:updated_at) }.merge(additional_options)
end
response.etag = options[:etag] if options[:etag]
response.last_modified = options[:last_modified] if options[:last_modified]
@@ -55,8 +74,34 @@ module ActionController
# end
# end
# end
def stale?(options)
fresh_when(options)
#
# You can also just pass a record where last_modified will be set by calling updated_at and the etag by passing the object itself. Example:
#
# def show
# @article = Article.find(params[:id])
#
# if stale?(@article)
# @statistics = @article.really_expensive_call
# respond_to do |format|
# # all the supported formats
# end
# end
# end
#
# When passing a record, you can still set whether the public header:
#
# def show
# @article = Article.find(params[:id])
#
# if stale?(@article, :public => true)
# @statistics = @article.really_expensive_call
# respond_to do |format|
# # all the supported formats
# end
# end
# end
def stale?(record_or_options, additional_options = {})
fresh_when(record_or_options, additional_options)
!request.fresh?(response)
end

View File

@@ -1,4 +1,5 @@
require 'active_support/core_ext/file/path'
require 'action_controller/metal/exceptions'
module ActionController #:nodoc:
# Methods for sending arbitrary data and for streaming files to the browser,
@@ -26,8 +27,11 @@ module ActionController #:nodoc:
# Options:
# * <tt>:filename</tt> - suggests a filename for the browser to use.
# Defaults to <tt>File.basename(path)</tt>.
# * <tt>:type</tt> - specifies an HTTP content type. Defaults to 'application/octet-stream'. You can specify
# either a string or a symbol for a registered type register with <tt>Mime::Type.register</tt>, for example :json
# * <tt>:type</tt> - specifies an HTTP content type.
# You can specify either a string or a symbol for a registered type register with
# <tt>Mime::Type.register</tt>, for example :json
# If omitted, type will be guessed from the file extension specified in <tt>:filename</tt>.
# If no content type is registered for the extension, default type 'application/octet-stream' will be used.
# * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
# Valid values are 'inline' and 'attachment' (default).
# * <tt>:status</tt> - specifies the status code to send with the response. Defaults to 200.
@@ -37,7 +41,7 @@ module ActionController #:nodoc:
#
# The default Content-Type and Content-Disposition headers are
# set to download arbitrary binary files in as many browsers as
# possible. IE versions 4, 5, 5.5, and 6 are all known to have
# possible. IE versions 4, 5, 5.5, and 6 are all known to have
# a variety of quirks (especially when downloading over SSL).
#
# Simple download:
@@ -58,8 +62,8 @@ module ActionController #:nodoc:
#
# Also be aware that the document may be cached by proxies and browsers.
# The Pragma and Cache-Control headers declare how the file may be cached
# by intermediaries. They default to require clients to validate with
# the server before releasing cached responses. See
# by intermediaries. They default to require clients to validate with
# the server before releasing cached responses. See
# http://www.mnot.net/cache_docs/ for an overview of web caching and
# http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9
# for the Cache-Control header spec.
@@ -71,7 +75,27 @@ module ActionController #:nodoc:
self.status = options[:status] || 200
self.content_type = options[:content_type] if options.key?(:content_type)
self.response_body = File.open(path, "rb")
self.response_body = FileBody.new(path)
end
# Avoid having to pass an open file handle as the response body.
# Rack::Sendfile will usually intercept the response and uses
# the path directly, so there is no reason to open the file.
class FileBody #:nodoc:
attr_reader :to_path
def initialize(path)
@to_path = path
end
# Stream the file's contents if Rack::Sendfile isn't present.
def each
File.open(to_path, 'rb') do |file|
while chunk = file.read(16384)
yield chunk
end
end
end
end
# Sends the given binary data to the browser. This method is similar to
@@ -84,6 +108,8 @@ module ActionController #:nodoc:
# * <tt>:filename</tt> - suggests a filename for the browser to use.
# * <tt>:type</tt> - specifies an HTTP content type. Defaults to 'application/octet-stream'. You can specify
# either a string or a symbol for a registered type register with <tt>Mime::Type.register</tt>, for example :json
# If omitted, type will be guessed from the file extension specified in <tt>:filename</tt>.
# If no content type is registered for the extension, default type 'application/octet-stream' will be used.
# * <tt>:disposition</tt> - specifies whether the file will be shown inline or downloaded.
# Valid values are 'inline' and 'attachment' (default).
# * <tt>:status</tt> - specifies the status code to send with the response. Defaults to 200.
@@ -108,12 +134,14 @@ module ActionController #:nodoc:
private
def send_file_headers!(options)
type_provided = options.has_key?(:type)
options.update(DEFAULT_SEND_FILE_OPTIONS.merge(options))
[:type, :disposition].each do |arg|
raise ArgumentError, ":#{arg} option required" if options[arg].nil?
end
disposition = options[:disposition]
disposition = options[:disposition].to_s
disposition += %(; filename="#{options[:filename]}") if options[:filename]
content_type = options[:type]
@@ -123,6 +151,10 @@ module ActionController #:nodoc:
raise ArgumentError, "Unknown MIME type #{options[:type]}" unless extension
self.content_type = extension
else
if !type_provided && options[:filename]
# If type wasn't provided, try guessing from file extension.
content_type = Mime::Type.lookup_by_extension(File.extname(options[:filename]).downcase.tr('.','')) || content_type
end
self.content_type = content_type
end

View File

@@ -1,12 +1,12 @@
module ActionController
# This module provides a method which will redirects browser to use HTTPS
# This module provides a method which will redirect browser to use HTTPS
# protocol. This will ensure that user's sensitive information will be
# transferred safely over the internet. You _should_ always force browser
# to use HTTPS when you're transferring sensitive information such as
# user authentication, account information, or credit card information.
#
# Note that if you really concern about your application safety, you might
# consider using +config.force_ssl+ in your configuration config file instead.
# Note that if you are really concerned about your application security,
# you might consider using +config.force_ssl+ in your config file instead.
# That will ensure all the data transferred via HTTPS protocol and prevent
# user from getting session hijacked when accessing the site under unsecured
# HTTP protocol.
@@ -22,14 +22,18 @@ module ActionController
#
# ==== Options
# * <tt>only</tt> - The callback should be run only for this action
# * <tt>except<tt> - The callback should be run for all actions except this action
# * <tt>except</tt> - The callback should be run for all actions except this action
def force_ssl(options = {})
host = options.delete(:host)
before_filter(options) do
if !request.ssl? && !Rails.env.development?
redirect_to :protocol => 'https://', :status => :moved_permanently
redirect_options = {:protocol => 'https://', :status => :moved_permanently}
redirect_options.merge!(:host => host) if host
redirect_options.merge!(:params => request.query_parameters)
redirect_to redirect_options
end
end
end
end
end
end
end

View File

@@ -20,6 +20,7 @@ module ActionController
options, status = status, nil if status.is_a?(Hash)
status ||= options.delete(:status) || :ok
location = options.delete(:location)
content_type = options.delete(:content_type)
options.each do |key, value|
headers[key.to_s.dasherize.split('-').each { |v| v[0] = v[0].chr.upcase }.join('-')] = value.to_s
@@ -27,7 +28,7 @@ module ActionController
self.status = status
self.location = url_for(location) if location
self.content_type = Mime[formats.first] if formats
self.content_type = content_type || (Mime[formats.first] if formats)
self.response_body = " "
end
end

View File

@@ -7,9 +7,12 @@ module ActionController
# by default.
#
# In addition to using the standard template helpers provided, creating custom helpers to
# extract complicated logic or reusable functionality is strongly encouraged. By default, the controller will
# include a helper whose name matches that of the controller, e.g., <tt>MyController</tt> will automatically
# include <tt>MyHelper</tt>.
# extract complicated logic or reusable functionality is strongly encouraged. By default, each controller
# will include all helpers.
#
# In previous versions of \Rails the controller will include a helper whose
# name matches that of the controller, e.g., <tt>MyController</tt> will automatically
# include <tt>MyHelper</tt>. To return old behavior set +config.action_controller.include_all_helpers+ to +false+.
#
# Additional helpers can be specified using the +helper+ class method in ActionController::Base or any
# controller which inherits from it.
@@ -29,7 +32,7 @@ module ActionController
# class EventsController < ActionController::Base
# helper FormattedTimeHelper
# def index
# @events = Event.find(:all)
# @events = Event.all
# end
# end
#
@@ -53,7 +56,7 @@ module ActionController
include AbstractController::Helpers
included do
config_accessor :helpers_path, :include_all_helpers
class_attribute :helpers_path, :include_all_helpers
self.helpers_path ||= []
self.include_all_helpers = true
end

View File

@@ -27,20 +27,14 @@ module ActionController
self.hidden_actions = hidden_actions.dup.merge(args.map(&:to_s)).freeze
end
def inherited(klass)
klass.class_eval { @visible_actions = {} }
super
end
def visible_action?(action_name)
return @visible_actions[action_name] if @visible_actions.key?(action_name)
@visible_actions[action_name] = !hidden_actions.include?(action_name)
not hidden_actions.include?(action_name)
end
# Overrides AbstractController::Base#action_methods to remove any methods
# that are listed as hidden methods.
def action_methods
@action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) })
@action_methods ||= Set.new(super.reject { |name| hidden_actions.include?(name) }).freeze
end
end
end

View File

@@ -67,7 +67,7 @@ module ActionController
# class PostsController < ApplicationController
# REALM = "SuperSecret"
# USERS = {"dhh" => "secret", #plain text password
# "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":")) #ha1 digest password
# "dap" => Digest::MD5.hexdigest(["dap",REALM,"secret"].join(":"))} #ha1 digest password
#
# before_filter :authenticate, :except => [:index]
#
@@ -141,11 +141,11 @@ module ActionController
end
def decode_credentials(request)
ActiveSupport::Base64.decode64(request.authorization.split(' ', 2).last || '')
::Base64.decode64(request.authorization.split(' ', 2).last || '')
end
def encode_credentials(user_name, password)
"Basic #{ActiveSupport::Base64.encode64s("#{user_name}:#{password}")}"
"Basic #{::Base64.strict_encode64("#{user_name}:#{password}")}"
end
def authentication_request(controller, realm)
@@ -289,7 +289,7 @@ module ActionController
t = time.to_i
hashed = [t, secret_key]
digest = ::Digest::MD5.hexdigest(hashed.join(":"))
ActiveSupport::Base64.encode64("#{t}:#{digest}").gsub("\n", '')
::Base64.encode64("#{t}:#{digest}").gsub("\n", '')
end
# Might want a shorter timeout depending on whether the request
@@ -298,7 +298,7 @@ module ActionController
# allow a user to use new nonce without prompting user again for their
# username and password.
def validate_nonce(secret_key, request, value, seconds_to_timeout=5*60)
t = ActiveSupport::Base64.decode64(value).split(":").first.to_i
t = ::Base64.decode64(value).split(":").first.to_i
nonce(secret_key, t) == value && (t - Time.now.to_i).abs <= seconds_to_timeout
end
@@ -403,7 +403,7 @@ module ActionController
# the present token and options.
#
# controller - ActionController::Base instance for the current request.
# login_procedure - Proc to call if a token is present. The Proc should
# login_procedure - Proc to call if a token is present. The Proc should
# take 2 arguments:
# authenticate(controller) { |token, options| ... }
#
@@ -416,7 +416,7 @@ module ActionController
end
end
# Parses the token and options out of the token authorization header. If
# Parses the token and options out of the token authorization header. If
# the header looks like this:
# Authorization: Token token="abc", nonce="def"
# Then the returned token is "abc", and the options is {:nonce => "def"}
@@ -426,7 +426,7 @@ module ActionController
# Returns an Array of [String, Hash] if a token is present.
# Returns nil if no token is found.
def token_and_options(request)
if header = request.authorization.to_s[/^Token (.*)/]
if request.authorization.to_s[/^Token (.*)/]
values = Hash[$1.split(',').map do |value|
value.strip! # remove any spaces between commas and values
key, value = value.split(/\=\"?/) # split key=value pairs

View File

@@ -58,13 +58,18 @@ module ActionController
def redirect_to(*args)
ActiveSupport::Notifications.instrument("redirect_to.action_controller") do |payload|
result = super
payload[:status] = self.status
payload[:location] = self.location
payload[:status] = response.status
payload[:location] = response.location
result
end
end
protected
private
# A hook invoked everytime a before callback is halted.
def halted_callback_hook(filter)
ActiveSupport::Notifications.instrument("halted_callback.action_controller", :filter => filter)
end
# A hook which allows you to clean up any time taken into account in
# views wrongly, like database querying time.
@@ -97,4 +102,4 @@ module ActionController
end
end
end
end
end

View File

@@ -42,8 +42,8 @@ module ActionController #:nodoc:
def respond_to(*mimes)
options = mimes.extract_options!
only_actions = Array(options.delete(:only))
except_actions = Array(options.delete(:except))
only_actions = Array(options.delete(:only)).map(&:to_s)
except_actions = Array(options.delete(:except)).map(&:to_s)
new = mimes_for_respond_to.dup
mimes.each do |mime|
@@ -182,7 +182,7 @@ module ActionController #:nodoc:
#
# def index
# @people = Person.all
# respond_with(@person)
# respond_with(@people)
# end
# end
#
@@ -191,8 +191,9 @@ module ActionController #:nodoc:
def respond_to(*mimes, &block)
raise ArgumentError, "respond_to takes either types or a block, never both" if mimes.any? && block_given?
if response = retrieve_response_from_mimes(mimes, &block)
response.call(nil)
if collector = retrieve_collector_from_mimes(mimes, &block)
response = collector.response
response ? response.call : default_render({})
end
end
@@ -232,9 +233,9 @@ module ActionController #:nodoc:
raise "In order to use respond_with, first you need to declare the formats your " <<
"controller responds to in the class level" if self.class.mimes_for_respond_to.empty?
if response = retrieve_response_from_mimes(&block)
if collector = retrieve_collector_from_mimes(&block)
options = resources.size == 1 ? {} : resources.extract_options!
options.merge!(:default_response => response)
options[:default_response] = collector.response
(options.delete(:responder) || self.class.responder).call(self, resources, options)
end
end
@@ -245,7 +246,7 @@ module ActionController #:nodoc:
# current action.
#
def collect_mimes_from_class_level #:nodoc:
action = action_name.to_sym
action = action_name.to_s
self.class.mimes_for_respond_to.keys.select do |mime|
config = self.class.mimes_for_respond_to[mime]
@@ -263,15 +264,17 @@ module ActionController #:nodoc:
# Collects mimes and return the response for the negotiated format. Returns
# nil if :not_acceptable was sent to the client.
#
def retrieve_response_from_mimes(mimes=nil, &block) #:nodoc:
def retrieve_collector_from_mimes(mimes=nil, &block) #:nodoc:
mimes ||= collect_mimes_from_class_level
collector = Collector.new(mimes) { |options| default_render(options || {}) }
collector = Collector.new(mimes)
block.call(collector) if block_given?
format = collector.negotiate_format(request)
if format = request.negotiate_mime(collector.order)
if format
self.content_type ||= format.to_s
lookup_context.freeze_formats([format.to_sym])
collector.response_for(format)
lookup_context.formats = [format.to_sym]
lookup_context.rendered_format = lookup_context.formats.first
collector
else
head :not_acceptable
nil
@@ -280,10 +283,10 @@ module ActionController #:nodoc:
class Collector #:nodoc:
include AbstractController::Collector
attr_accessor :order
attr_accessor :order, :format
def initialize(mimes, &block)
@order, @responses, @default_response = [], {}, block
def initialize(mimes)
@order, @responses = [], {}
mimes.each { |mime| send(mime) }
end
@@ -302,8 +305,12 @@ module ActionController #:nodoc:
@responses[mime_type] ||= block
end
def response_for(mime)
@responses[mime] || @responses[Mime::ALL] || @default_response
def response
@responses[format] || @responses[Mime::ALL]
end
def negotiate_format(request)
@format = request.negotiate_mime(order)
end
end
end

View File

@@ -43,6 +43,11 @@ module ActionController
# wrap_parameters :person, :include => [:username, :password]
# end
#
# On ActiveRecord models with no +:include+ or +:exclude+ option set,
# if attr_accessible is set on that model, it will only wrap the accessible
# parameters, else it will only wrap the parameters returned by the class
# method attribute_names.
#
# If you're going to pass the parameters to an +ActiveModel+ object (such as
# +User.new(params[:user])+), you might consider passing the model class to
# the method instead. The +ParamsWrapper+ will actually try to determine the
@@ -141,19 +146,16 @@ module ActionController
# try to find Foo::Bar::User, Foo::User and finally User.
def _default_wrap_model #:nodoc:
return nil if self.anonymous?
model_name = self.name.sub(/Controller$/, '').singularize
model_name = self.name.sub(/Controller$/, '').classify
begin
model_klass = model_name.constantize
rescue NameError, ArgumentError => e
if e.message =~ /is not missing constant|uninitialized constant #{model_name}/
if model_klass = model_name.safe_constantize
model_klass
else
namespaces = model_name.split("::")
namespaces.delete_at(-2)
break if namespaces.last == model_name
model_name = namespaces.join("::")
else
raise
end
end until model_klass
@@ -165,7 +167,10 @@ module ActionController
unless options[:include] || options[:exclude]
model ||= _default_wrap_model
if model.respond_to?(:attribute_names) && model.attribute_names.present?
role = options.has_key?(:as) ? options[:as] : :default
if model.respond_to?(:accessible_attributes) && model.accessible_attributes(role).present?
options[:include] = model.accessible_attributes(role).to_a
elsif model.respond_to?(:attribute_names) && model.attribute_names.present?
options[:include] = model.attribute_names
end
end
@@ -189,7 +194,8 @@ module ActionController
def process_action(*args)
if _wrapper_enabled?
wrapped_hash = _wrap_parameters request.request_parameters
wrapped_filtered_hash = _wrap_parameters request.filtered_parameters
wrapped_keys = request.request_parameters.keys
wrapped_filtered_hash = _wrap_parameters request.filtered_parameters.slice(*wrapped_keys)
# This will make the wrapped hash accessible from controller and view
request.parameters.merge! wrapped_hash

View File

@@ -18,7 +18,7 @@ module ActionController
#
# * <tt>Hash</tt> - The URL will be generated by calling url_for with the +options+.
# * <tt>Record</tt> - The URL will be generated by calling url_for with the +options+, which will reference a named URL for that record.
# * <tt>String</tt> starting with <tt>protocol://</tt> (like <tt>http://</tt>) - Is passed straight through as the target for redirection.
# * <tt>String</tt> starting with <tt>protocol://</tt> (like <tt>http://</tt>) or a protocol relative reference (like <tt>//</tt>) - Is passed straight through as the target for redirection.
# * <tt>String</tt> not containing a protocol - The current protocol and host is prepended to the string.
# * <tt>Proc</tt> - A block that will be executed in the controller's context. Should return any option accepted by +redirect_to+.
# * <tt>:back</tt> - Back to the page that issued the request. Useful for forms that are triggered from multiple places.
@@ -45,6 +45,16 @@ module ActionController
# integer, or a symbol representing the downcased, underscored and symbolized description.
# Note that the status code must be a 3xx HTTP code, or redirection will not occur.
#
# If you are using XHR requests other than GET or POST and redirecting after the
# request then some browsers will follow the redirect using the original request
# method. This may lead to undesirable behavior such as a double DELETE. To work
# around this you can return a <tt>303 See Other</tt> status code which will be
# followed using a GET request.
#
# Examples:
# redirect_to posts_url, :status => :see_other
# redirect_to :action => 'index', :status => 303
#
# It is also possible to assign a flash message as part of the redirection. There are two special accessors for the commonly used flash names
# +alert+ and +notice+ as well as a general purpose +flash+ bucket.
#
@@ -54,10 +64,10 @@ module ActionController
# redirect_to post_url(@post), :status => 301, :flash => { :updated_post_id => @post.id }
# redirect_to { :action=>'atom' }, :alert => "Something serious happened"
#
# When using <tt>redirect_to :back</tt>, if there is no referrer, RedirectBackError will be raised. You may specify some fallback
# behavior for this case by rescuing RedirectBackError.
# When using <tt>redirect_to :back</tt>, if there is no referrer, ActionController::RedirectBackError will be raised. You may specify some fallback
# behavior for this case by rescuing ActionController::RedirectBackError.
def redirect_to(options = {}, response_status = {}) #:doc:
raise ActionControllerError.new("Cannot redirect to nil!") if options.nil?
raise ActionControllerError.new("Cannot redirect to nil!") unless options
raise AbstractController::DoubleRenderError if response_body
self.status = _extract_redirect_to_status(options, response_status)
@@ -67,7 +77,7 @@ module ActionController
private
def _extract_redirect_to_status(options, response_status)
status = if options.is_a?(Hash) && options.key?(:status)
if options.is_a?(Hash) && options.key?(:status)
Rack::Utils.status_code(options.delete(:status))
elsif response_status.key?(:status)
Rack::Utils.status_code(response_status[:status])
@@ -81,7 +91,8 @@ module ActionController
# The scheme name consist of a letter followed by any combination of
# letters, digits, and the plus ("+"), period ("."), or hyphen ("-")
# characters; and is terminated by a colon (":").
when %r{^\w[\w+.-]*:.*}
# The protocol relative scheme starts with a double slash "//"
when %r{^(\w[\w+.-]*:|//).*}
options
when String
request.protocol + request.host_with_port + options

View File

@@ -1,5 +1,6 @@
require 'active_support/core_ext/class/attribute'
require 'active_support/core_ext/object/blank'
require 'set'
module ActionController
# See <tt>Renderers.add</tt>
@@ -12,16 +13,13 @@ module ActionController
included do
class_attribute :_renderers
self._renderers = {}.freeze
self._renderers = Set.new.freeze
end
module ClassMethods
def use_renderers(*args)
new = _renderers.dup
args.each do |key|
new[key] = RENDERERS[key]
end
self._renderers = new.freeze
renderers = _renderers + args
self._renderers = renderers.freeze
end
alias use_renderer use_renderers
end
@@ -31,10 +29,10 @@ module ActionController
end
def _handle_render_options(options)
_renderers.each do |name, value|
if options.key?(name.to_sym)
_renderers.each do |name|
if options.key?(name)
_process_options(options)
return send("_render_option_#{name}", options.delete(name.to_sym), options)
return send("_render_option_#{name}", options.delete(name), options)
end
end
nil
@@ -42,7 +40,7 @@ module ActionController
# Hash of available renderers, mapping a renderer name to its proc.
# Default keys are :json, :js, :xml.
RENDERERS = {}
RENDERERS = Set.new
# Adds a new renderer to call within controller actions.
# A renderer is invoked by passing its name as an option to
@@ -79,7 +77,7 @@ module ActionController
# <tt>ActionController::MimeResponds#respond_with</tt>
def self.add(key, &block)
define_method("_render_option_#{key}", &block)
RENDERERS[key] = block
RENDERERS << key.to_sym
end
module All

View File

@@ -14,7 +14,7 @@ module ActionController
def render(*args) #:nodoc:
raise ::AbstractController::DoubleRenderError if response_body
super
self.content_type ||= Mime[formats.first].to_s
self.content_type ||= Mime[lookup_context.rendered_format].to_s
response_body
end

View File

@@ -1,4 +1,5 @@
require 'active_support/core_ext/class/attribute'
require 'action_controller/metal/exceptions'
module ActionController #:nodoc:
class InvalidAuthenticityToken < ActionControllerError #:nodoc:
@@ -73,7 +74,7 @@ module ActionController #:nodoc:
# The actual before_filter that is used. Modify this to change how you handle unverified requests.
def verify_authenticity_token
unless verified_request?
logger.debug "WARNING: Can't verify CSRF token authenticity" if logger
logger.warn "WARNING: Can't verify CSRF token authenticity" if logger
handle_unverified_request
end
end

View File

@@ -1,4 +1,7 @@
module ActionController #:nodoc:
# This module is responsible to provide `rescue_from` helpers
# to controllers and configure when detailed exceptions must be
# shown.
module Rescue
extend ActiveSupport::Concern
include ActiveSupport::Rescuable
@@ -12,10 +15,20 @@ module ActionController #:nodoc:
super(exception)
end
# Override this method if you want to customize when detailed
# exceptions must be shown. This method is only called when
# consider_all_requests_local is false. By default, it returns
# false, but someone may set it to `request.local?` so local
# requests in production still shows the detailed exception pages.
def show_detailed_exceptions?
false
end
private
def process_action(*args)
super
rescue Exception => exception
request.env['action_dispatch.show_detailed_exceptions'] ||= show_detailed_exceptions?
rescue_with_handler(exception) || raise(exception)
end
end

View File

@@ -9,7 +9,7 @@ module ActionController #:nodoc:
# respond_to :html, :xml, :json
#
# def index
# @people = Person.find(:all)
# @people = Person.all
# respond_with(@people)
# end
# end
@@ -84,8 +84,8 @@ module ActionController #:nodoc:
#
# === Custom options
#
# <code>respond_with</code> also allow you to pass options that are forwarded
# to the underlying render call. Those options are only applied success
# <code>respond_with</code> also allows you to pass options that are forwarded
# to the underlying render call. Those options are only applied for success
# scenarios. For instance, you can do the following in the create method above:
#
# def create
@@ -95,7 +95,7 @@ module ActionController #:nodoc:
# respond_with(@project, @task, :status => 201)
# end
#
# This will return status 201 if the task was saved with success. If not,
# This will return status 201 if the task was saved successfully. If not,
# it will simply ignore the given options and return status 422 and the
# resource errors. To customize the failure scenario, you can pass a
# a block to <code>respond_with</code>:
@@ -172,7 +172,7 @@ module ActionController #:nodoc:
# responds to :to_format and display it.
#
def to_format
if get? || !has_errors?
if get? || !has_errors? || response_overridden?
default_render
else
display_errors
@@ -202,10 +202,8 @@ module ActionController #:nodoc:
display resource
elsif post?
display resource, :status => :created, :location => api_location
elsif has_empty_resource_definition?
display empty_resource, :status => :ok
else
head :ok
head :no_content
end
end
@@ -224,11 +222,15 @@ module ActionController #:nodoc:
alias :navigation_location :resource_location
alias :api_location :resource_location
# If a given response block was given, use it, otherwise call render on
# If a response block was given, use it, otherwise call render on
# controller.
#
def default_render
@default_response.call(options)
if @default_response
@default_response.call(options)
else
controller.default_render(options)
end
end
# Display is just a shortcut to render a resource with the current format.
@@ -253,7 +255,7 @@ module ActionController #:nodoc:
end
def display_errors
controller.render format => resource.errors, :status => :unprocessable_entity
controller.render format => resource_errors, :status => :unprocessable_entity
end
# Check whether the resource has errors.
@@ -269,22 +271,16 @@ module ActionController #:nodoc:
@action ||= ACTIONS_FOR_VERBS[request.request_method_symbol]
end
# Check whether resource needs a specific definition of empty resource to be valid
#
def has_empty_resource_definition?
respond_to?("empty_#{format}_resource", true)
def resource_errors
respond_to?("#{format}_resource_errors", true) ? send("#{format}_resource_errors") : resource.errors
end
# Delegate to proper empty resource method
#
def empty_resource
send("empty_#{format}_resource")
def json_resource_errors
{:errors => resource.errors}
end
# Return a valid empty JSON resource
#
def empty_json_resource
"{}"
def response_overridden?
@default_response.present?
end
end
end

View File

@@ -2,6 +2,11 @@ module ActionController #:nodoc:
module SessionManagement #:nodoc:
extend ActiveSupport::Concern
included do
ActiveSupport::Deprecation.warn "ActionController::SessionManagement " \
"is deprecated because it has no contents since Rails 3.1", caller
end
module ClassMethods
end

View File

@@ -200,34 +200,9 @@ module ActionController #:nodoc:
extend ActiveSupport::Concern
include AbstractController::Rendering
attr_internal :stream
module ClassMethods
# Render streaming templates. It accepts :only, :except, :if and :unless as options
# to specify when to stream, as in ActionController filters.
def stream(options={})
ActiveSupport::Deprecation.warn "stream class method is deprecated. Please give the :stream option to render instead"
if defined?(Fiber)
before_filter :_stream_filter, options
else
raise "You cannot use streaming if Fiber is not available."
end
end
end
protected
# Mark following render calls as streaming.
def _stream_filter #:nodoc:
self.stream = true
end
# Consider the stream option when normalazing options.
def _normalize_options(options) #:nodoc:
super
options[:stream] = self.stream unless options.key?(:stream)
end
# Set proper cache control and transfer encoding when streaming
def _process_options(options) #:nodoc:
super

View File

@@ -17,11 +17,14 @@ module ActionController
ActiveSupport.on_load(:action_controller) { self.cache_store ||= RAILS_CACHE }
end
initializer "action_controller.assets_config", :group => :all do |app|
app.config.action_controller.assets_dir ||= app.config.paths["public"].first
end
initializer "action_controller.set_configs" do |app|
paths = app.config.paths
options = app.config.action_controller
options.assets_dir ||= paths["public"].first
options.javascripts_dir ||= paths["public/javascripts"].first
options.stylesheets_dir ||= paths["public/stylesheets"].first
options.page_cache_directory ||= paths["public"].first
@@ -29,6 +32,7 @@ module ActionController
# make sure readers methods get compiled
options.asset_path ||= app.config.asset_path
options.asset_host ||= app.config.asset_host
options.relative_url_root ||= app.config.relative_url_root
ActiveSupport.on_load(:action_controller) do
include app.routes.mounted_helpers

View File

@@ -6,13 +6,14 @@ module ActionController
define_method(:inherited) do |klass|
super(klass)
if namespace = klass.parents.detect {|m| m.respond_to?(:_railtie) }
paths = namespace._railtie.paths["app/helpers"].existent
if namespace = klass.parents.detect { |m| m.respond_to?(:railtie_helpers_paths) }
paths = namespace.railtie_helpers_paths
else
paths = app.config.helpers_paths
paths = app.helpers_paths
end
klass.helpers_path = paths
if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers
klass.helper :all
end

View File

@@ -14,9 +14,9 @@ module ActionController
# <% end %> </div>
#
# # controller
# def destroy
# def update
# post = Post.find(params[:id])
# post.destroy
# post.update_attributes(params[:post])
#
# redirect_to(post) # Calls polymorphic_url(post) which in turn calls post_url(post)
# end
@@ -40,7 +40,7 @@ module ActionController
# dom_class(post, :edit) # => "edit_post"
# dom_class(Person, :edit) # => "edit_person"
def dom_class(record_or_class, prefix = nil)
singular = ActiveModel::Naming.singular(record_or_class)
singular = ActiveModel::Naming.param_key(record_or_class)
prefix ? "#{prefix}#{JOIN}#{singular}" : singular
end
@@ -67,7 +67,7 @@ module ActionController
# This can be overwritten to customize the default generated string representation if desired.
# If you need to read back a key from a dom_id in order to query for the underlying database record,
# you should write a helper like 'person_record_from_dom_id' that will extract the key either based
# on the default implementation (which just joins all key attributes with '-') or on your own
# on the default implementation (which just joins all key attributes with '_') or on your own
# overwritten version of the method. By default, this implementation passes the key string through a
# method that replaces all characters that are invalid inside DOM ids, with valid ones. You need to
# make sure yourself that your dom ids are valid, in case you overwrite this method.

View File

@@ -20,7 +20,12 @@ module ActionController
ActiveSupport::Notifications.subscribe("render_template.action_view") do |name, start, finish, id, payload|
path = payload[:layout]
@layouts[path] += 1
if path
@layouts[path] += 1
if path =~ /^layouts\/(.*)/
@layouts[$1] += 1
end
end
end
ActiveSupport::Notifications.subscribe("!render_template.action_view") do |name, start, finish, id, payload|
@@ -56,6 +61,15 @@ module ActionController
# # assert that the "new" view template was rendered
# assert_template "new"
#
# # assert that the layout 'admin' was rendered
# assert_template :layout => 'admin'
# assert_template :layout => 'layouts/admin'
# assert_template :layout => :admin
#
# # assert that no layout was rendered
# assert_template :layout => nil
# assert_template :layout => false
#
# # assert that the "_customer" partial was rendered twice
# assert_template :partial => '_customer', :count => 2
#
@@ -70,6 +84,8 @@ module ActionController
#
def assert_template(options = {}, message = nil)
validate_request!
# Force body to be read in case the template is being streamed
response.body
case options
when NilClass, String, Symbol
@@ -79,18 +95,38 @@ module ActionController
"expecting <?> but rendering with <?>",
options, rendered.keys.join(', '))
assert_block(msg) do
if options.nil?
@templates.blank?
else
if options
rendered.any? { |t,num| t.match(options) }
else
@templates.blank?
end
end
when Hash
if options.key?(:layout)
expected_layout = options[:layout]
msg = build_message(message,
"expecting layout <?> but action rendered <?>",
expected_layout, @layouts.keys)
case expected_layout
when String, Symbol
assert(@layouts.keys.include?(expected_layout.to_s), msg)
when Regexp
assert(@layouts.keys.any? {|l| l =~ expected_layout }, msg)
when nil, false
assert(@layouts.empty?, msg)
end
end
if expected_partial = options[:partial]
if expected_locals = options[:locals]
actual_locals = @locals[expected_partial.to_s.sub(/^_/,'')]
expected_locals.each_pair do |k,v|
assert_equal(v, actual_locals[k])
if defined?(@locals)
actual_locals = @locals[expected_partial.to_s.sub(/^_/,'')]
expected_locals.each_pair do |k,v|
assert_equal(v, actual_locals[k])
end
else
warn "the :locals option to #assert_template is only supported in a ActionView::TestCase"
end
elsif expected_count = options[:count]
actual_count = @partials[expected_partial]
@@ -98,26 +134,13 @@ module ActionController
"expecting ? to be rendered ? time(s) but rendered ? time(s)",
expected_partial, expected_count, actual_count)
assert(actual_count == expected_count.to_i, msg)
elsif options.key?(:layout)
msg = build_message(message,
"expecting layout <?> but action rendered <?>",
expected_layout, @layouts.keys)
case layout = options[:layout]
when String
assert(@layouts.include?(expected_layout), msg)
when Regexp
assert(@layouts.any? {|l| l =~ layout }, msg)
when nil
assert(@layouts.empty?, msg)
end
else
msg = build_message(message,
"expecting partial <?> but action rendered <?>",
options[:partial], @partials.keys)
assert(@partials.include?(expected_partial), msg)
end
else
elsif options.key?(:partial)
assert @partials.empty?,
"Expected no partials to be rendered"
end
@@ -181,10 +204,6 @@ module ActionController
end
def recycle!
write_cookies!
@env.delete('HTTP_COOKIE') if @cookies.blank?
@env.delete('action_dispatch.cookies')
@cookies = nil
@formats = nil
@env.delete_if { |k, v| k =~ /^(action_dispatch|rack)\.request/ }
@env.delete_if { |k, v| k =~ /^action_dispatch\.rescue/ }
@@ -192,6 +211,14 @@ module ActionController
@method = @request_method = nil
@fullpath = @ip = @remote_ip = @protocol = nil
@env['action_dispatch.request.query_parameters'] = {}
@set_cookies ||= {}
@set_cookies.update(Hash[cookie_jar.instance_variable_get("@set_cookies").map{ |k,o| [k,o[:value]] }])
deleted_cookies = cookie_jar.instance_variable_get("@delete_cookies")
@set_cookies.reject!{ |k,v| deleted_cookies.include?(k) }
cookie_jar.update(rack_cookies)
cookie_jar.update(cookies)
cookie_jar.update(@set_cookies)
cookie_jar.recycle!
end
end
@@ -212,7 +239,7 @@ module ActionController
DEFAULT_OPTIONS = Rack::Session::Abstract::ID::DEFAULT_OPTIONS
def initialize(session = {})
@env, @by = nil, nil
super(nil, nil)
replace(session.stringify_keys)
@loaded = true
end
@@ -298,27 +325,26 @@ module ActionController
# assert_equal "Dave", cookies[:name] # makes sure that a cookie called :name was set as "Dave"
# assert flash.empty? # makes sure that there's nothing in the flash
#
# For historic reasons, the assigns hash uses string-based keys. So assigns[:person] won't work, but assigns["person"] will. To
# For historic reasons, the assigns hash uses string-based keys. So <tt>assigns[:person]</tt> won't work, but <tt>assigns["person"]</tt> will. To
# appease our yearning for symbols, though, an alternative accessor has been devised using a method call instead of index referencing.
# So assigns(:person) will work just like assigns["person"], but again, assigns[:person] will not work.
# So <tt>assigns(:person)</tt> will work just like <tt>assigns["person"]</tt>, but again, <tt>assigns[:person]</tt> will not work.
#
# On top of the collections, you have the complete url that a given action redirected to available in redirect_to_url.
# On top of the collections, you have the complete url that a given action redirected to available in <tt>redirect_to_url</tt>.
#
# For redirects within the same controller, you can even call follow_redirect and the redirect will be followed, triggering another
# action call which can then be asserted against.
#
# == Manipulating the request collections
# == Manipulating session and cookie variables
#
# The collections described above link to the response, so you can test if what the actions were expected to do happened. But
# sometimes you also want to manipulate these collections in the incoming request. This is really only relevant for sessions
# and cookies, though. For sessions, you just do:
# Sometimes you need to set up the session and cookie variables for a test.
# To do this just assign a value to the session or cookie collection:
#
# @request.session[:key] = "value"
# @request.cookies[:key] = "value"
# session[:key] = "value"
# cookies[:key] = "value"
#
# To clear the cookies for a test just clear the request's cookies hash:
# To clear the cookies for a test just clear the cookie collection:
#
# @request.cookies.clear
# cookies.clear
#
# == \Testing named routes
#
@@ -336,9 +362,21 @@ module ActionController
module ClassMethods
# Sets the controller class name. Useful if the name can't be inferred from test class.
# Expects +controller_class+ as a constant. Example: <tt>tests WidgetController</tt>.
# Normalizes +controller_class+ before using. Examples:
#
# tests WidgetController
# tests :widget
# tests 'widget'
#
def tests(controller_class)
self.controller_class = controller_class
case controller_class
when String, Symbol
self.controller_class = "#{controller_class.to_s.underscore}_controller".camelize.constantize
when Class
self.controller_class = controller_class
else
raise ArgumentError, "controller class must be a String, Symbol, or Class"
end
end
def controller_class=(new_class)
@@ -355,9 +393,7 @@ module ActionController
end
def determine_default_controller_class(name)
name.sub(/Test$/, '').constantize
rescue NameError
nil
name.sub(/Test$/, '').safe_constantize
end
def prepare_controller_class(new_class)
@@ -407,7 +443,7 @@ module ActionController
Hash[hash_or_array_or_value.map{|key, value| [key, paramify_values(value)] }]
when Array
hash_or_array_or_value.map {|i| paramify_values(i)}
when Rack::Test::UploadedFile
when Rack::Test::UploadedFile, ActionDispatch::Http::UploadedFile
hash_or_array_or_value
else
hash_or_array_or_value.to_param
@@ -439,12 +475,13 @@ module ActionController
parameters ||= {}
controller_class_name = @controller.class.anonymous? ?
"anonymous_controller" :
@controller.class.name.underscore.sub(/_controller$/, '')
@controller.class.controller_path
@request.assign_parameters(@routes, controller_class_name, action.to_s, parameters)
@request.session = ActionController::TestSession.new(session) if session
@request.session["flash"] = @request.flash.update(flash || {})
@request.session["flash"].sweep
@controller.request = @request
build_request_uri(action, parameters)
@@ -452,8 +489,8 @@ module ActionController
@controller.recycle!
@controller.process_with_new_base_test(@request, @response)
@assigns = @controller.respond_to?(:view_assigns) ? @controller.view_assigns : {}
@request.session['flash'] = @request.flash.to_session_value
@request.session.delete('flash') if @request.session['flash'].blank?
@request.cookies.merge!(@response.cookies)
@response
end
@@ -473,11 +510,6 @@ module ActionController
end
end
# Cause the action to be rescued according to the regular rules for rescue_action when the visitor is not local
def rescue_action_in_public!
@request.remote_addr = '208.77.188.166' # example.com
end
included do
include ActionController::TemplateAssertions
include ActionDispatch::Assertions

View File

@@ -66,7 +66,7 @@ module HTML
# A regular expression of the valid characters used to separate protocols like
# the ':' in 'http://foo.com'
self.protocol_separator = /:|(&#0*58)|(&#x70)|(%|&#37;)3A/
self.protocol_separator = /:|(&#0*58)|(&#x70)|(&#x0*3a)|(%|&#37;)3A/i
# Specifies a Set of HTML attributes that can have URIs.
self.uri_attributes = Set.new(%w(href src cite action longdesc xlink:href lowsrc))
@@ -104,14 +104,14 @@ module HTML
# Specifies the default Set of allowed shorthand css properties for the #sanitize and #sanitize_css helpers.
self.shorthand_css_properties = Set.new(%w(background border margin padding))
# Sanitizes a block of css code. Used by #sanitize when it comes across a style attribute
# Sanitizes a block of css code. Used by #sanitize when it comes across a style attribute
def sanitize_css(style)
# disallow urls
style = style.to_s.gsub(/url\s*\(\s*[^\s)]+?\s*\)\s*/, ' ')
# gauntlet
if style !~ /^([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*$/ ||
style !~ /^(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*$/
if style !~ /\A([:,;#%.\sa-zA-Z0-9!]|\w-\w|\'[\s\w]+\'|\"[\s\w]+\"|\([\d,\s]+\))*\z/ ||
style !~ /\A(\s*[-\w]+\s*:\s*[^:;]*(;|$)\s*)*\z/
return ''
end
@@ -122,7 +122,7 @@ module HTML
elsif shorthand_css_properties.include?(prop.split('-')[0].downcase)
unless val.split().any? do |keyword|
!allowed_css_keywords.include?(keyword) &&
keyword !~ /^(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)$/
keyword !~ /\A(#[0-9a-f]+|rgb\(\d+%?,\d*%?,?\d*%?\)?|\d{0,2}\.?\d{0,2}(cm|em|ex|in|mm|pc|pt|px|%|,|\))?)\z/
end
clean << prop + ': ' + val + ';'
end
@@ -171,7 +171,7 @@ module HTML
def contains_bad_protocols?(attr_name, value)
uri_attributes.include?(attr_name) &&
(value =~ /(^[^\/:]*):|(&#0*58)|(&#x70)|(%|&#37;)3A/ && !allowed_protocols.include?(value.split(protocol_separator).first.downcase))
(value =~ /(^[^\/:]*):|(&#0*58)|(&#x70)|(&#x0*3a)|(%|&#37;)3A/i && !allowed_protocols.include?(value.split(protocol_separator).first.downcase.strip))
end
end
end

View File

@@ -47,12 +47,16 @@ module ActionDispatch
end
autoload_under 'middleware' do
autoload :RequestId
autoload :BestStandardsSupport
autoload :Callbacks
autoload :Cookies
autoload :DebugExceptions
autoload :ExceptionWrapper
autoload :Flash
autoload :Head
autoload :ParamsParser
autoload :PublicExceptions
autoload :Reloader
autoload :RemoteIp
autoload :Rescue
@@ -60,7 +64,6 @@ module ActionDispatch
autoload :Static
end
autoload :ClosedError, 'action_dispatch/middleware/closed_error'
autoload :MiddlewareStack, 'action_dispatch/middleware/stack'
autoload :Routing
@@ -82,6 +85,7 @@ module ActionDispatch
autoload :AbstractStore, 'action_dispatch/middleware/session/abstract_store'
autoload :CookieStore, 'action_dispatch/middleware/session/cookie_store'
autoload :MemCacheStore, 'action_dispatch/middleware/session/mem_cache_store'
autoload :CacheStore, 'action_dispatch/middleware/session/cache_store'
end
autoload_under 'testing' do

View File

@@ -4,14 +4,18 @@ module ActionDispatch
module Http
module Cache
module Request
HTTP_IF_MODIFIED_SINCE = 'HTTP_IF_MODIFIED_SINCE'.freeze
HTTP_IF_NONE_MATCH = 'HTTP_IF_NONE_MATCH'.freeze
def if_modified_since
if since = env['HTTP_IF_MODIFIED_SINCE']
if since = env[HTTP_IF_MODIFIED_SINCE]
Time.rfc2822(since) rescue nil
end
end
def if_none_match
env['HTTP_IF_NONE_MATCH']
env[HTTP_IF_NONE_MATCH]
end
def not_modified?(modified_at)
@@ -43,31 +47,35 @@ module ActionDispatch
alias :etag? :etag
def last_modified
if last = headers['Last-Modified']
if last = headers[LAST_MODIFIED]
Time.httpdate(last)
end
end
def last_modified?
headers.include?('Last-Modified')
headers.include?(LAST_MODIFIED)
end
def last_modified=(utc_time)
headers['Last-Modified'] = utc_time.httpdate
headers[LAST_MODIFIED] = utc_time.httpdate
end
def etag=(etag)
key = ActiveSupport::Cache.expand_cache_key(etag)
@etag = self["ETag"] = %("#{Digest::MD5.hexdigest(key)}")
@etag = self[ETAG] = %("#{Digest::MD5.hexdigest(key)}")
end
private
LAST_MODIFIED = "Last-Modified".freeze
ETAG = "ETag".freeze
CACHE_CONTROL = "Cache-Control".freeze
def prepare_cache_control!
@cache_control = {}
@etag = self["ETag"]
@etag = self[ETAG]
if cache_control = self["Cache-Control"]
if cache_control = self[CACHE_CONTROL]
cache_control.split(/,\s*/).each do |segment|
first, last = segment.split("=")
@cache_control[first.to_sym] = last || true
@@ -81,28 +89,32 @@ module ActionDispatch
end
end
DEFAULT_CACHE_CONTROL = "max-age=0, private, must-revalidate"
DEFAULT_CACHE_CONTROL = "max-age=0, private, must-revalidate".freeze
NO_CACHE = "no-cache".freeze
PUBLIC = "public".freeze
PRIVATE = "private".freeze
MUST_REVALIDATE = "must-revalidate".freeze
def set_conditional_cache_control!
return if self["Cache-Control"].present?
return if self[CACHE_CONTROL].present?
control = @cache_control
if control.empty?
headers["Cache-Control"] = DEFAULT_CACHE_CONTROL
headers[CACHE_CONTROL] = DEFAULT_CACHE_CONTROL
elsif control[:no_cache]
headers["Cache-Control"] = "no-cache"
headers[CACHE_CONTROL] = NO_CACHE
else
extras = control[:extras]
max_age = control[:max_age]
options = []
options << "max-age=#{max_age.to_i}" if max_age
options << (control[:public] ? "public" : "private")
options << "must-revalidate" if control[:must_revalidate]
options << (control[:public] ? PUBLIC : PRIVATE)
options << MUST_REVALIDATE if control[:must_revalidate]
options.concat(extras) if extras
headers["Cache-Control"] = options.join(", ")
headers[CACHE_CONTROL] = options.join(", ")
end
end
end

View File

@@ -26,8 +26,6 @@ module ActionDispatch
module FilterParameters
extend ActiveSupport::Concern
@@parameter_filter_for = {}
# Return a hash of parameters with all sensitive data replaced.
def filtered_parameters
@filtered_parameters ||= parameter_filter.filter(parameters)
@@ -54,7 +52,7 @@ module ActionDispatch
end
def parameter_filter_for(filters)
@@parameter_filter_for[filters] ||= ParameterFilter.new(filters)
ParameterFilter.new(filters)
end
KV_RE = '[^&;=]+'

View File

@@ -1,11 +1,10 @@
require 'active_support/memoizable'
module ActionDispatch
module Http
class Headers < ::Hash
extend ActiveSupport::Memoizable
@@env_cache = Hash.new { |h,k| h[k] = "HTTP_#{k.upcase.gsub(/-/, '_')}" }
def initialize(*args)
if args.size == 1 && args[0].is_a?(Hash)
super()
update(args[0])
@@ -25,9 +24,8 @@ module ActionDispatch
private
# Converts a HTTP header name to an environment variable name.
def env_name(header_name)
"HTTP_#{header_name.upcase.gsub(/-/, '_')}"
@@env_cache[header_name]
end
memoize :env_name
end
end
end

View File

@@ -98,7 +98,8 @@ module ActionDispatch
BROWSER_LIKE_ACCEPTS = /,\s*\*\/\*|\*\/\*\s*,/
def valid_accept_header
xhr? || (accept && accept !~ BROWSER_LIKE_ACCEPTS)
(xhr? && (accept.present? || content_mime_type)) ||
(accept.present? && accept !~ BROWSER_LIKE_ACCEPTS)
end
def use_accept_header

View File

@@ -47,7 +47,7 @@ module Mime
cattr_reader :html_types
# These are the content types which browsers can generate without using ajax, flash, etc
# i.e. following a link, getting an image or posting a form. CSRF protection
# i.e. following a link, getting an image or posting a form. CSRF protection
# only needs to protect against these types.
@@browser_generated_types = Set.new [:html, :url_encoded_form, :multipart_form, :text]
cattr_reader :browser_generated_types
@@ -82,6 +82,7 @@ module Mime
class << self
TRAILING_STAR_REGEXP = /(text|application)\/\*/
Q_SEPARATOR_REGEXP = /;\s*q=/
def lookup(string)
LOOKUP[string]
@@ -103,11 +104,12 @@ module Mime
SET << Mime.const_get(symbol.to_s.upcase)
([string] + mime_type_synonyms).each { |str| LOOKUP[str] = SET.last } unless skip_lookup
([symbol.to_s] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext] = SET.last }
([symbol] + extension_synonyms).each { |ext| EXTENSION_LOOKUP[ext.to_s] = SET.last }
end
def parse(accept_header)
if accept_header !~ /,/
accept_header = accept_header.split(Q_SEPARATOR_REGEXP).first
if accept_header =~ TRAILING_STAR_REGEXP
parse_data_with_trailing_star($1)
else
@@ -117,7 +119,7 @@ module Mime
# keep track of creation order to keep the subsequent sort stable
list, index = [], 0
accept_header.split(/,/).each do |header|
params, q = header.split(/;\s*q=/)
params, q = header.split(Q_SEPARATOR_REGEXP)
if params.present?
params.strip!
@@ -246,7 +248,7 @@ module Mime
end
end
# Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See
# Returns true if Action Pack should check requests using this Mime Type for possible request forgery. See
# ActionController::RequestForgeryProtection.
def verify_request?
@@browser_generated_types.include?(to_sym)
@@ -256,6 +258,10 @@ module Mime
@@html_types.include?(to_sym) || @string =~ /html/
end
def respond_to?(method, include_private = false) #:nodoc:
super || method.to_s =~ /(\w+)\?$/
end
private
def method_missing(method, *args)
if method.to_s =~ /(\w+)\?$/

View File

@@ -7,6 +7,15 @@ Mime::Type.register "text/javascript", :js, %w( application/javascript applicati
Mime::Type.register "text/css", :css
Mime::Type.register "text/calendar", :ics
Mime::Type.register "text/csv", :csv
Mime::Type.register "image/png", :png, [], %w(png)
Mime::Type.register "image/jpeg", :jpeg, [], %w(jpg jpeg jpe)
Mime::Type.register "image/gif", :gif, [], %w(gif)
Mime::Type.register "image/bmp", :bmp, [], %w(bmp)
Mime::Type.register "image/tiff", :tiff, [], %w(tif tiff)
Mime::Type.register "video/mpeg", :mpeg, [], %w(mpg mpeg mpe)
Mime::Type.register "application/xml", :xml, %w( text/xml application/x-xml )
Mime::Type.register "application/rss+xml", :rss
Mime::Type.register "application/atom+xml", :atom
@@ -19,5 +28,8 @@ Mime::Type.register "application/x-www-form-urlencoded", :url_encoded_form
# http://www.json.org/JSONRequest.html
Mime::Type.register "application/json", :json, %w( text/x-json application/jsonrequest )
Mime::Type.register "application/pdf", :pdf, [], %w(pdf)
Mime::Type.register "application/zip", :zip, [], %w(zip)
# Create Mime::ALL but do not add it to the SET.
Mime::ALL = Mime::Type.new("*/*", :all, [])

View File

@@ -20,6 +20,8 @@ module ActionDispatch
@filters.present?
end
FILTERED = '[FILTERED]'.freeze
def compiled_filter
@compiled_filter ||= begin
regexps, blocks = compile_filter
@@ -29,7 +31,7 @@ module ActionDispatch
original_params.each do |key, value|
if regexps.find { |r| key =~ r }
value = '[FILTERED]'
value = FILTERED
elsif value.is_a?(Hash)
value = filter(value)
elsif value.is_a?(Array)

View File

@@ -2,11 +2,11 @@ require 'tempfile'
require 'stringio'
require 'strscan'
require 'active_support/core_ext/module/deprecation'
require 'active_support/core_ext/hash/indifferent_access'
require 'active_support/core_ext/string/access'
require 'active_support/inflector'
require 'action_dispatch/http/headers'
require 'action_controller/metal/exceptions'
module ActionDispatch
class Request < Rack::Request
@@ -26,7 +26,7 @@ module ActionDispatch
HTTP_ACCEPT HTTP_ACCEPT_CHARSET HTTP_ACCEPT_ENCODING
HTTP_ACCEPT_LANGUAGE HTTP_CACHE_CONTROL HTTP_FROM
HTTP_NEGOTIATE HTTP_PRAGMA ].freeze
ENV_METHODS.each do |env|
class_eval <<-METHOD, __FILE__, __LINE__ + 1
def #{env.sub(/^HTTP_/n, '').downcase} # def accept_charset
@@ -35,14 +35,6 @@ module ActionDispatch
METHOD
end
def self.new(env)
if request = env["action_dispatch.request"] && request.instance_of?(self)
return request
end
super
end
def key?(key)
@env.key?(key)
end
@@ -64,7 +56,12 @@ module ActionDispatch
RFC5789 = %w(PATCH)
HTTP_METHODS = RFC2616 + RFC2518 + RFC3253 + RFC3648 + RFC3744 + RFC5323 + RFC5789
HTTP_METHOD_LOOKUP = Hash.new { |h, m| h[m] = m.underscore.to_sym if HTTP_METHODS.include?(m) }
HTTP_METHOD_LOOKUP = {}
# Populate the HTTP method lookup cache
HTTP_METHODS.each do |method|
HTTP_METHOD_LOOKUP[method] = method.underscore.to_sym
end
# Returns the HTTP \method that the application should see.
# In the case where the \method was overridden by a middleware
@@ -94,31 +91,31 @@ module ActionDispatch
end
# Is this a GET (or HEAD) request?
# Equivalent to <tt>request.request_method == :get</tt>.
# Equivalent to <tt>request.request_method_symbol == :get</tt>.
def get?
HTTP_METHOD_LOOKUP[request_method] == :get
end
# Is this a POST request?
# Equivalent to <tt>request.request_method == :post</tt>.
# Equivalent to <tt>request.request_method_symbol == :post</tt>.
def post?
HTTP_METHOD_LOOKUP[request_method] == :post
end
# Is this a PUT request?
# Equivalent to <tt>request.request_method == :put</tt>.
# Equivalent to <tt>request.request_method_symbol == :put</tt>.
def put?
HTTP_METHOD_LOOKUP[request_method] == :put
end
# Is this a DELETE request?
# Equivalent to <tt>request.request_method == :delete</tt>.
# Equivalent to <tt>request.request_method_symbol == :delete</tt>.
def delete?
HTTP_METHOD_LOOKUP[request_method] == :delete
end
# Is this a HEAD request?
# Equivalent to <tt>request.method == :head</tt>.
# Equivalent to <tt>request.method_symbol == :head</tt>.
def head?
HTTP_METHOD_LOOKUP[method] == :head
end
@@ -142,11 +139,6 @@ module ActionDispatch
base_url + original_fullpath
end
def forgery_whitelisted?
get?
end
deprecate :forgery_whitelisted? => "it is just an alias for 'get?' now, update your code"
def media_type
content_mime_type.to_s
end
@@ -168,28 +160,21 @@ module ActionDispatch
@ip ||= super
end
# Which IP addresses are "trusted proxies" that can be stripped from
# the right-hand-side of X-Forwarded-For.
#
# http://en.wikipedia.org/wiki/Private_network#Private_IPv4_address_spaces.
TRUSTED_PROXIES = %r{
^127\.0\.0\.1$ | # localhost
^(10 | # private IP 10.x.x.x
172\.(1[6-9]|2[0-9]|3[0-1]) | # private IP in the range 172.16.0.0 .. 172.31.255.255
192\.168 # private IP 192.168.x.x
)\.
}x
# Determines originating IP address. REMOTE_ADDR is the standard
# but will fail if the user is behind a proxy. HTTP_CLIENT_IP and/or
# HTTP_X_FORWARDED_FOR are set by proxies so check for these if
# REMOTE_ADDR is a proxy. HTTP_X_FORWARDED_FOR may be a comma-
# delimited list in the case of multiple chained proxies; the last
# address which is not trusted is the originating IP.
# Originating IP address, usually set by the RemoteIp middleware.
def remote_ip
@remote_ip ||= (@env["action_dispatch.remote_ip"] || ip).to_s
end
# Returns the unique request id, which is based off either the X-Request-Id header that can
# be generated by a firewall, load balancer, or web server or by the RequestId middleware
# (which sets the action_dispatch.request_id environment variable).
#
# This unique ID is useful for tracing a request from end-to-end as part of logging or debugging.
# This relies on the rack variable set by the ActionDispatch::RequestId middleware.
def uuid
@uuid ||= env["action_dispatch.request_id"]
end
# Returns the lowercase name of the HTTP server software.
def server_software
(@env['SERVER_SOFTWARE'] && /^([a-zA-Z]+)/ =~ @env['SERVER_SOFTWARE']) ? $1.downcase : nil
@@ -199,8 +184,9 @@ module ActionDispatch
# work with raw requests directly.
def raw_post
unless @env.include? 'RAW_POST_DATA'
@env['RAW_POST_DATA'] = body.read(@env['CONTENT_LENGTH'].to_i)
body.rewind if body.respond_to?(:rewind)
raw_post_body = body
@env['RAW_POST_DATA'] = raw_post_body.read(@env['CONTENT_LENGTH'].to_i)
raw_post_body.rewind if raw_post_body.respond_to?(:rewind)
end
@env['RAW_POST_DATA']
end
@@ -242,13 +228,13 @@ module ActionDispatch
# Override Rack's GET method to support indifferent access
def GET
@env["action_dispatch.request.query_parameters"] ||= (normalize_parameters(super) || {})
@env["action_dispatch.request.query_parameters"] ||= deep_munge(normalize_parameters(super) || {})
end
alias :query_parameters :GET
# Override Rack's POST method to support indifferent access
def POST
@env["action_dispatch.request.request_parameters"] ||= (normalize_parameters(super) || {})
@env["action_dispatch.request.request_parameters"] ||= deep_munge(normalize_parameters(super) || {})
end
alias :request_parameters :POST
@@ -267,18 +253,14 @@ module ActionDispatch
LOCALHOST.any? { |local_ip| local_ip === remote_addr && local_ip === remote_ip }
end
protected
# Remove nils from the params hash
def deep_munge(hash)
keys = hash.keys.find_all { |k| hash[k] == [nil] }
keys.each { |k| hash[k] = nil }
hash.each_value do |v|
hash.each do |k, v|
case v
when Array
v.grep(Hash) { |x| deep_munge(x) }
v.compact!
hash[k] = nil if v.empty?
when Hash
deep_munge(v)
end
@@ -287,6 +269,8 @@ module ActionDispatch
hash
end
protected
def parse_query(qs)
deep_munge(super)
end

View File

@@ -33,7 +33,8 @@ module ActionDispatch # :nodoc:
# end
# end
class Response
attr_accessor :request, :header, :status
attr_accessor :request, :header
attr_reader :status
attr_writer :sending_file
alias_method :headers=, :header=
@@ -52,8 +53,10 @@ module ActionDispatch # :nodoc:
# information.
attr_accessor :charset, :content_type
CONTENT_TYPE = "Content-Type"
CONTENT_TYPE = "Content-Type".freeze
SET_COOKIE = "Set-Cookie".freeze
LOCATION = "Location".freeze
cattr_accessor(:default_charset) { "utf-8" }
include Rack::Response::Helpers
@@ -65,10 +68,10 @@ module ActionDispatch # :nodoc:
@sending_file = false
@blank = false
if content_type = self["Content-Type"]
if content_type = self[CONTENT_TYPE]
type, charset = content_type.split(/;\s*charset=/)
@content_type = Mime::Type.lookup(type)
@charset = charset || "UTF-8"
@charset = charset || self.class.default_charset
end
prepare_cache_control!
@@ -115,32 +118,9 @@ module ActionDispatch # :nodoc:
EMPTY = " "
class BodyBuster #:nodoc:
def initialize(response)
@response = response
@body = ""
end
def bust(body)
body.call(@response, self)
body.close if body.respond_to?(:close)
@body
end
def write(string)
@body << string.to_s
end
end
def body=(body)
@blank = true if body == EMPTY
if body.respond_to?(:call)
ActiveSupport::Deprecation.warn "Setting a Proc or an object that responds to call " \
"in response_body is no longer supported", caller
body = BodyBuster.new(self).bust(body)
end
# Explicitly check for strings. This is *wrong* theoretically
# but if we don't check this, the performance on string bodies
# is bad on Ruby 1.8 (because strings responds to each then).
@@ -164,12 +144,12 @@ module ActionDispatch # :nodoc:
end
def location
headers['Location']
headers[LOCATION]
end
alias_method :redirect_url, :location
def location=(url)
headers['Location'] = url
headers[LOCATION] = url
end
def close
@@ -180,10 +160,10 @@ module ActionDispatch # :nodoc:
assign_default_content_type_and_charset!
handle_conditional_get!
@header["Set-Cookie"] = @header["Set-Cookie"].join("\n") if @header["Set-Cookie"].respond_to?(:join)
@header[SET_COOKIE] = @header[SET_COOKIE].join("\n") if @header[SET_COOKIE].respond_to?(:join)
if [204, 304].include?(@status)
@header.delete "Content-Type"
@header.delete CONTENT_TYPE
[@status, @header, []]
else
[@status, @header, self]
@@ -197,7 +177,7 @@ module ActionDispatch # :nodoc:
# assert_equal 'AuthorOfNewPage', r.cookies['author']
def cookies
cookies = {}
if header = self["Set-Cookie"]
if header = self[SET_COOKIE]
header = header.split("\n") if header.respond_to?(:to_str)
header.each do |cookie|
if pair = cookie.split(';').first

View File

@@ -11,26 +11,15 @@ module ActionDispatch
raise(ArgumentError, ':tempfile is required') unless @tempfile
end
def open
@tempfile.open
end
def path
@tempfile.path
end
def read(*args)
@tempfile.read(*args)
end
def rewind
@tempfile.rewind
# Delegate these methods to the tempfile.
[:open, :path, :rewind, :size].each do |method|
class_eval "def #{method}; @tempfile.#{method}; end"
end
def size
@tempfile.size
end
private
def encode_filename(filename)
# Encode the filename in the utf8 encoding, unless it is nil or we're in 1.8

View File

@@ -43,9 +43,13 @@ module ActionDispatch
params = options[:params] || {}
params.reject! {|k,v| v.to_param.nil? }
rewritten_url << (options[:trailing_slash] ? path.sub(/\?|\z/) { "/" + $& } : path)
if options[:trailing_slash] && !path.ends_with?('/')
rewritten_url << path.sub(/(\?|\z)/) { "/" + $& }
else
rewritten_url << path
end
rewritten_url << "?#{params.to_query}" unless params.empty?
rewritten_url << "##{Rack::Mount::Utils.escape_uri(options[:anchor].to_param.to_s)}" if options[:anchor]
rewritten_url << "##{Journey::Router::Utils.escape_fragment(options[:anchor].to_param.to_s)}" if options[:anchor]
rewritten_url
end

View File

@@ -15,7 +15,15 @@ module ActionDispatch
def call(env)
status, headers, body = @app.call(env)
headers["X-UA-Compatible"] = @header
if headers["X-UA-Compatible"] && @header
unless headers["X-UA-Compatible"][@header]
headers["X-UA-Compatible"] << "," << @header.to_s
end
else
headers["X-UA-Compatible"] = @header
end
[status, headers, body]
end
end

Some files were not shown because too many files have changed in this diff Show More