Commit Graph

17138 Commits

Author SHA1 Message Date
wycats
d4c7d3fd94 Create a deprecation behavior that triggers a notification for deprecation notices, and make the behaviors independent of the environment names.
* In Rails 2.3 apps being upgraded, you will need to add the deprecation
  configuration to each of your environments. Failing to do so will
  result in the same behavior as Rails 2.3, but with an outputted warning
  to provide information on how to set up the setting.
* New Rails 3 applications generate the setting
* The notification style will send deprecation notices using
  ActiveSupport::Notifications. Third-party tools can listen in to
  these notifications to provide a streamlined view of the
  deprecation notices occurring in your app.
* The payload in the notification is the deprecation warning itself
  as well as the callstack from the point that triggered the
  notification.
2010-06-29 12:20:15 -07:00
J. Pablo Fernández
21957b72ea Test that adding an index also doesn't raise an exception.
[#4809 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:12 +02:00
Paul Barry
0baf83fa18 Replaced statement in comment with an assertion
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:08 +02:00
J. Pablo Fernández
ff22b9d451 Fixed error when removing an index from a table name values, which is a reserved word, with test.
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 21:17:07 +02:00
José Valim
af6ec607fa No need to check if the attribute exists (this is the same behavior as in 2.3) [#4994 state:resolved] and [#5003 state:resolved] 2010-06-29 20:15:32 +02:00
José Valim
67582f08bf Push a failing test for issues [#4994] and [#5003]. 2010-06-29 19:50:09 +02:00
Jeremy Kemper
7ea85ff516 Revert "Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2."
This reverts commit 9013227e00.

minitest was 'running' compiled templates beginning with test!
2010-06-29 09:22:53 -07:00
José Valim
caab176116 Rename _snowman_ to _snowman to be in sync with _method and _csrf_token. 2010-06-29 18:02:39 +02:00
Neeraj Singh
dabf74b495 array subtraction should be faster than iterating over all the elements
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 17:57:06 +02:00
Neeraj Singh
e8f88a3298 splitting a really long line into multiple lines which is easy on eyes
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 17:57:01 +02:00
David Trasbo
735a4db685 Remove ActiveRecord::Base#class_name [#379 state:committed]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 17:54:51 +02:00
José Valim
417125e795 Tidy up deprecation message for with_exclusive_scope. 2010-06-29 17:42:20 +02:00
José Valim
bd1666ad1d Add scoping and unscoped as the syntax to replace the old with_scope and with_exclusive_scope. A few examples:
* with_scope now should be scoping:

Before:

  Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do
    Comment.first #=> SELECT * FROM comments WHERE post_id = 1
  end

After:

  Comment.where(:post_id => 1).scoping do
    Comment.first #=> SELECT * FROM comments WHERE post_id = 1
  end

* with_exclusive_scope now should be unscoped:

  class Post < ActiveRecord::Base
    default_scope :published => true
  end

  Post.all #=> SELECT * FROM posts WHERE published = true

Before:

  Post.with_exclusive_scope do
    Post.all #=> SELECT * FROM posts
  end

After:

  Post.unscoped do
    Post.all #=> SELECT * FROM posts
  end

Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values:

  Post.unscoped.all #=> SELECT * FROM posts
2010-06-29 17:18:55 +02:00
José Valim
9013227e00 Revert "Name compiled render methods". This caused several failures on AP test suite for 1.9.2.
This reverts commit 2c4f8aae5c.
2010-06-29 10:54:07 +02:00
Santiago Pastorino
093c4eedd0 Remove unneeded reject 2010-06-28 19:14:40 -07:00
Neeraj Singh
40e87ac669 with_exclusive_scope does not work properly if ARel is passed. It does work nicely if hash is passed. Blow up if user is attempting it pass ARel to with_exclusive_scope.
[#3838 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-29 01:18:20 +02:00
Jeremy Kemper
f8011e67b0 Use caller for helpers_dir deprecation warnings 2010-06-28 14:48:44 -07:00
Jeremy Kemper
b3318bd937 Slice new buffer from beginning of old buffer to skip encoding special case 2010-06-28 14:46:23 -07:00
Jeremy Kemper
2c4f8aae5c Name compiled render methods 2010-06-28 14:46:23 -07:00
Jeremy Kemper
198ec03f52 returning -> tap 2010-06-28 14:46:23 -07:00
Jeremy Kemper
ec18719b81 ETag: use body instead of @body since the method will always return a string 2010-06-28 14:46:22 -07:00
Santiago Pastorino
b2633f9f93 Don't store incorrect values in zones_map
[#4942 state:committed]

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 19:35:33 +02:00
Leigh Caplan
97a92a4cfd test that unknown zones don't store mapping keys
[#4942]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 19:35:27 +02:00
José Valim
b5b42af33f Make the sentinel flag for route a bit more robust. 2010-06-28 17:09:09 +02:00
José Valim
6dfa8d8e95 Tidy up valid conditions in router a bit. 2010-06-28 16:57:14 +02:00
Andrew White
02a1a4edc8 Add :controller and :action to the list of valid conditions
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 16:51:39 +02:00
José Valim
e4f9132f6a Do not trigger the old mapper to avoid deprecation messages. 2010-06-28 15:36:52 +02:00
Andrew White
0b6ce34223 Restores the escaping of urls generated from hashes. [#4765 state:resolved]
HTML specifications recommend the escaping of urls in web pages,
which url_for does by default for string urls and consquently
urls generated by path helpers as these return strings.

Hashes passed to url_for are not escaped by default and this
commit reverses this default so that they are escaped.

Undoes the changes of this commit:
1b3195b63c

Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 15:35:38 +02:00
Andrew White
e717631a84 Merge :constraints from scope into resource options [#2694 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 14:22:35 +02:00
rohit
ccb21f20d8 Convert instance_variables to symbols before excluding internal vars [#4965 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 13:27:06 +02:00
Andrew White
19ccd4628c Remove invalid conditions from route [#4989 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 12:25:19 +02:00
José Valim
6d04fa6dc4 Deprecate the old router DSL. Since it is still used intensively across ActionPack test suite, patches that translates Rails internal tests to the new router DSL are welcome (note though that a few tests shouldn't be translated since they are testing exactly the old mapper API, like the ones in actionpack/test/controller/resource_test.rb and actionpack/test/controller/routing_test.rb) 2010-06-28 12:23:41 +02:00
Bruno Michel
2002e5877e Strip_tags never ending attribute should not raise a TypeError [#4870 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 11:40:27 +02:00
José Valim
dd8b7417a9 Update CHANGELOGs. 2010-06-28 11:37:14 +02:00
Łukasz Strzałkowski
be994e2c50 Information about new rake task in CHANGELOG
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 11:27:15 +02:00
wycats
6fe424aeca Small typo 2010-06-27 21:50:33 -07:00
Santiago Pastorino
ab96c71a52 Add this rule to run common tests and specifics ones from adapters dir 2010-06-27 21:20:53 -07:00
Akira Matsuda
4f74d449ee Avoid "no such table" exception when schema migrations table does not exist
[#4990 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-27 21:16:34 -07:00
Akira Matsuda
0e5d7c6f64 Use ActiveRecord::Migrator.schema_migrations_table_name instead of hardcoding "schema_migrations"
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
2010-06-27 21:16:09 -07:00
wycats
25215d7285 Fix several known web encoding issues:
* Specify accept-charset on all forms. All recent browsers,
  as well as IE5+, will use the encoding specified for form
  parameters
* Unfortunately, IE5+ will not look at accept-charset unless
  at least one character in the form's values is not in the
  page's charset. Since the user can override the default
  charset (which Rails sets to UTF-8), we provide a hidden
  input containing a unicode character, forcing IE to look
  at the accept-charset.
* Now that the vast majority of web input is UTF-8, we set
  the inbound parameters to UTF-8. This will eliminate many
  cases of incompatible encodings between ASCII-8BIT and
  UTF-8.
* You can safely ignore params[:_snowman_]

TODO:

* Validate inbound text to confirm it is UTF-8
* Combine the whole_form implementations in form_helper_test
  and form_tag_helper_test
2010-06-27 21:13:55 -07:00
Santiago Pastorino
06b0d6e5cd Add missing require, Base use deprecate method 2010-06-27 20:45:09 -07:00
Kevin Skoglund
8e3e117dbe rake db:migrate:status displays status of migrations [#4947 state:resolved]
Signed-off-by: Michael Koziarski <michael@koziarski.com>
2010-06-28 14:08:40 +12:00
Jeremy Kemper
fb7715b249 Warn that ActiveRecord::Base.reset_subclasses is gone in Rails 3 final. 2010-06-27 18:58:18 -07:00
Jeremy Kemper
f3bb185b03 Upgrade to Rack 1.2.1 2010-06-27 17:55:23 -07:00
Santiago Pastorino
6cc29ab65f Implemented getbyte as an aliased method and RDoc added
Signed-off-by: Xavier Noria <fxn@hashref.com>
2010-06-28 01:45:57 +02:00
Jeremy Kemper
f61d923d28 Update to latest rails.js
[#4411 state:resolved]
2010-06-27 16:42:30 -07:00
Jeremy Kemper
6549291901 Vendor unreleased rack-mount 0.6.6.pre dependency 2010-06-27 16:28:04 -07:00
Jeremy Kemper
d15256af6c Missing BigDecimal dependency 2010-06-27 16:28:04 -07:00
Santiago Pastorino
6c28959e86 Move sqlite to sqlite3 for this tests to be run only on sqlite3 adapter
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:25 +02:00
Santiago Pastorino
3ab296fd59 AV::logger returns AC::logger if it's defined, workaround meanwhile AV doesn't have it's own logger
Signed-off-by: José Valim <jose.valim@gmail.com>
2010-06-28 01:26:17 +02:00