Permalink
Browse files

Merge josevalim/deprecations branch.

I maintained on purpose the DeprecatedUrlOptions in ActionMailer and the Deprecated configuration in Railties because they were already addressed by Piotr in his RSoC work.
  • Loading branch information...
2 parents 3c8e1f9 + b422cda commit d37a65307d280e47eb5c15b61c0b20ac6cab6a84 @josevalim josevalim committed Aug 30, 2010
View
@@ -0,0 +1,3 @@
+--exclude /templates/
+--quiet
+act*/lib/**/*.rb
View
@@ -144,6 +144,7 @@ task :rdoc do
FileUtils.copy "activerecord/examples/associations.png", "doc/rdoc/files/examples/associations.png"
end
+desc 'Bump all versions to match version.rb'
task :update_versions do
require File.dirname(__FILE__) + "/version"
@@ -1,36 +1,20 @@
-*Rails 3.0.0 (unreleased)*
+*Rails 3.1.0 (unreleased)*
* No changes
-*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [release candidate] (July 26th, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [beta 4] (June 8th, 2010)*
+*Rails 3.0.0 (August 29, 2010)*
* subject is automatically looked up on I18n using mailer_name and action_name as scope as in t(".subject") [JK]
* Changed encoding behaviour of mail, so updated tests in actionmailer and bumped mail version to 2.2.1 [ML]
* Added ability to pass Proc objects to the defaults hash [ML]
-
-*Rails 3.0.0 [beta 3] (April 13th, 2010)*
-
* Removed all quoting.rb type files from ActionMailer and put Mail 2.2.0 in instead [ML]
* Lot of updates to various test cases that now work better with the new Mail and so have different expectations
-
-*Rails 3.0.0 [beta 2] (April 1st, 2010)*
-
* Added interceptors and observers from Mail [ML]
ActionMailer::Base.register_interceptor calls Mail.register_interceptor
@@ -48,9 +32,6 @@
* Whole new API added with tests. See base.rb for full details. Old API is deprecated.
-
-*Rails 3.0.0 [beta 1] (February 4, 2010)*
-
* The Mail::Message class has helped methods for all the field types that return 'common' defaults for the common use case, so to get the subject, mail.subject will give you a string, mail.date will give you a DateTime object, mail.from will give you an array of address specs (mikel@test.lindsaar.net) etc. If you want to access the field object itself, call mail[:field_name] which will return the field object you want, which you can then chain, like mail[:from].formatted
* Mail#content_type now returns the content_type field as a string. If you want the mime type of a mail, then you call Mail#mime_type (eg, text/plain), if you want the parameters of the content type field, you call Mail#content_type_parameters which gives you a hash, eg {'format' => 'flowed', 'charset' => 'utf-8'}
View
@@ -1,23 +1,22 @@
-*Rails 3.0.0 (unreleased)*
+*Rails 3.1.0 (unreleased)*
+
+* No changes
+
+
+*Rails 3.0.0 (August 29, 2010)*
* password_field renders with nil value by default making the use of passwords secure by default, if you want to render you should do for instance f.password_field(:password, :value => @user.password) [Santiago Pastorino]
* Symbols and strings in routes should yield the same behavior. Note this may break existing apps that were using symbols with the new routes API. [José Valim]
* Add clear_helpers as a way to clean up all helpers added to this controller, maintaing just the helper with the same name as the controller. [José Valim]
-
-*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
-
* See http://github.com/rails/rails/compare/v3.0.0_RC...v3.0.0_RC2 for gory details
* Support routing constraints in functional tests. [Andrew White]
* Add a header that tells Internet Explorer (all versions) to use the best available standards support. [Yehuda Katz]
-
-*Rails 3.0.0 [release candidate] (July 26th, 2010)*
-
* Allow stylesheet/javascript extensions to be changed through railties. [Josh Kalderimis]
* link_to, button_to, and tag/tag_options now rely on html_escape instead of escape_once. [fxn]
@@ -51,9 +50,6 @@
* Removed textilize, textilize_without_paragraph and markdown helpers. [Santiago Pastorino]
-
-*Rails 3.0.0 [beta 4] (June 8th, 2010)*
-
* Remove middleware laziness [José Valim]
* Make session stores rely on request.cookie_jar and change set_session semantics to return the cookie value instead of a boolean. [José Valim]
@@ -70,9 +66,6 @@
* Changed translate helper so that it doesn’t mark every translation as safe HTML. Only keys with a "_html" suffix and keys named "html" are considered to be safe HTML. All other translations are left untouched. [Craig Davey]
-
-*Rails 3.0.0 [beta 3] (April 13th, 2010)*
-
* New option :as added to form_for allows to change the object name. The old <% form_for :client, @post %> becomes <% form_for @post, :as => :client %> [spastorino]
* Removed verify method in controllers. [JV]
@@ -107,9 +100,6 @@
"HEAD" and #request_method returns "GET" in HEAD requests). This
is for compatibility with Rack::Request [YK]
-
-*Rails 3.0.0 [beta 2] (April 1st, 2010)*
-
* #concat is now deprecated in favor of using <%= %> helpers [YK]
* Block helpers now return Strings, so you can use <%= form_for @foo do |f| %>.
@@ -138,9 +128,6 @@
# for just url_for
include Rails.application.router.url_for
-
-*Rails 3.0.0 [beta 1] (February 4, 2010)*
-
* Fixed that PrototypeHelper#update_page should return html_safe [DHH]
* Fixed that much of DateHelper wouldn't return html_safe? strings [DHH]
View
@@ -1,30 +1,14 @@
-*Rails 3.0.0 (unreleased)*
+*Rails 3.1.0 (unreleased)*
* No changes
-*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [release candidate] (July 26th, 2010)*
+*Rails 3.0.0 (August 29, 2010)*
* Added ActiveModel::MassAssignmentSecurity [Eric Chapweske, Josh Kalderimis]
-
-*Rails 3.0.0 [beta 4] (June 8th, 2010)*
-
* JSON supports a custom root option: to_json(:root => 'custom') #4515 [Jatinder Singh]
-
-*Rails 3.0.0 [beta 3] (April 13th, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [beta 2] (April 1st, 2010)*
-
* #new_record? and #destroyed? were removed from ActiveModel::Lint. Use
persisted? instead. A model is persisted if it's not a new_record? and it was
not destroyed? [MG]
@@ -37,19 +21,15 @@
* #to_key was added to ActiveModel::Lint so we can generate DOM IDs for
AMo objects with composite keys [MG]
-
-*Rails 3.0.0 [beta 1] (February 4, 2010)*
-
* ActiveModel::Observer#add_observer!
It has a custom hook to define after_find that should really be in a
ActiveRecord::Observer subclass:
- def add_observer!(klass)
- klass.add_observer(self)
- klass.class_eval 'def after_find() end' unless
- klass.respond_to?(:after_find)
- end
+ def add_observer!(klass)
+ klass.add_observer(self)
+ klass.class_eval 'def after_find() end' unless klass.respond_to?(:after_find)
+ end
* Change the ActiveModel::Base.include_root_in_json default to true for Rails 3 [DHH]
@@ -1,14 +1,9 @@
-*Rails 3.0.0 (unreleased)*
+*Rails 3.1.0 (unreleased)*
* No changes
-*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [release candidate] (July 26th, 2010)*
+*Rails 3.0.0 (August 29, 2010)*
* Changed update_attribute to not run callbacks and update the record directly in the database [Neeraj Singh]
@@ -20,9 +15,6 @@
* PostgreSQL: ensure the database time zone matches Ruby's time zone #4895 [Aaron Patterson]
-
-*Rails 3.0.0 [beta 4] (June 8th, 2010)*
-
* Fixed that ActiveRecord::Base.compute_type would swallow NoMethodError #4751 [Andrew Bloomgarden, Andrew White]
* Add index length support for MySQL. #1852 [Emili Parreno, Pratik Naik]
@@ -47,9 +39,6 @@
* Observers can prevent records from saving by returning false, just like before_save and friends. #4087 [Mislav Marohnić]
-
-*Rails 3.0.0 [beta 3] (April 13th, 2010)*
-
* Add Relation extensions. [Pratik Naik]
users = User.where(:admin => true).extending(User::AdminPowers)
@@ -64,9 +53,6 @@
* Silenced "SHOW FIELDS" and "SET SQL_AUTO_IS_NULL=0" statements from the MySQL driver to improve log signal to noise ration in development [DHH]
-
-*Rails 3.0.0 [Beta 1] (February 4th, 2010)*
-
* PostgreSQLAdapter: set time_zone to UTC when Base.default_timezone == :utc so that Postgres doesn't incorrectly offset-adjust values inserted into TIMESTAMP WITH TIME ZONE columns. #3777 [Jack Christensen]
* Allow relations to be used as scope.
@@ -23,6 +23,6 @@ Gem::Specification.new do |s|
s.add_dependency('activesupport', version)
s.add_dependency('activemodel', version)
- s.add_dependency('arel', '~> 1.0.0')
+ s.add_dependency('arel', '~> 1.0.1')
s.add_dependency('tzinfo', '~> 0.3.23')
end
@@ -1,30 +1,12 @@
-*Rails 3.0.0 (unreleased)*
+*Rails 3.1.0 (unreleased)*
* No changes
-*Rails 3.0.0 [release candidate 2] (August 23rd, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [release candidate] (July 26th, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [beta 4] (June 8th, 2010)*
+*Rails 3.0.0 (August 29, 2010)*
* JSON: set Base.include_root_in_json = true to include a root value in the JSON: {"post": {"title": ...}}. Mirrors the Active Record option. [Santiago Pastorino]
-
-*Rails 3.0.0 [beta 3] (April 13th, 2010)*
-
-* No changes
-
-
-*Rails 3.0.0 [beta 1] (February 4, 2010)*
-
* Add support for errors in JSON format. #1956 [Fabien Jakimowicz]
* Recognizes 410 as Resource Gone. #2316 [Jordan Brough, Jatinder Singh]
@@ -29,7 +29,8 @@ class InvalidRequestError < StandardError; end #:nodoc:
#
# In order for a mock to deliver its content, the incoming request must match by the <tt>http_method</tt>,
# +path+ and <tt>request_headers</tt>. If no match is found an InvalidRequestError exception
- # will be raised letting you know you need to create a new mock for that request.
+ # will be raised showing you what request it could not find a response for and also what requests and response
+ # pairs have been recorded so you can create a new mock for that request.
#
# ==== Example
# def setup
@@ -97,10 +98,79 @@ def responses
@@responses ||= []
end
- # Accepts a block which declares a set of requests and responses for the HttpMock to respond to. See the main
- # ActiveResource::HttpMock description for a more detailed explanation.
- def respond_to(pairs = {}) #:yields: mock
- reset!
+ # Accepts a block which declares a set of requests and responses for the HttpMock to respond to in
+ # the following format:
+ #
+ # mock.http_method(path, request_headers = {}, body = nil, status = 200, response_headers = {})
+ #
+ # === Example
+ #
+ # @matz = { :id => 1, :name => "Matz" }.to_xml(:root => "person")
+ # ActiveResource::HttpMock.respond_to do |mock|
+ # mock.post "/people.xml", {}, @matz, 201, "Location" => "/people/1.xml"
+ # mock.get "/people/1.xml", {}, @matz
+ # mock.put "/people/1.xml", {}, nil, 204
+ # mock.delete "/people/1.xml", {}, nil, 200
+ # end
+ #
+ # Alternatively, accepts a hash of <tt>{Request => Response}</tt> pairs allowing you to generate
+ # these the following format:
+ #
+ # ActiveResource::Request.new(method, path, body, request_headers)
+ # ActiveResource::Response.new(body, status, response_headers)
+ #
+ # === Example
+ #
+ # Request.new(:#{method}, path, nil, request_headers)
+ #
+ # @matz = { :id => 1, :name => "Matz" }.to_xml(:root => "person")
+ #
+ # create_matz = ActiveResource::Request.new(:post, '/people.xml', @matz, {})
+ # created_response = ActiveResource::Response.new("", 201, {"Location" => "/people/1.xml"})
+ # get_matz = ActiveResource::Request.new(:get, '/people/1.xml', nil)
+ # ok_response = ActiveResource::Response.new("", 200, {})
+ #
+ # pairs = {create_matz => created_response, get_matz => ok_response}
+ #
+ # ActiveResource::HttpMock.respond_to(pairs)
+ #
+ # Note, by default, every time you call +respond_to+, any previous request and response pairs stored
+ # in HttpMock will be deleted giving you a clean slate to work on.
+ #
+ # If you want to override this behaviour, pass in +false+ as the last argument to +respond_to+
+ #
+ # === Example
+ #
+ # ActiveResource::HttpMock.respond_to do |mock|
+ # mock.send(:get, "/people/1", {}, "XML1")
+ # end
+ # ActiveResource::HttpMock.responses.length #=> 1
+ #
+ # ActiveResource::HttpMock.respond_to(false) do |mock|
+ # mock.send(:get, "/people/2", {}, "XML2")
+ # end
+ # ActiveResource::HttpMock.responses.length #=> 2
+ #
+ # This also works with passing in generated pairs of requests and responses, again, just pass in false
+ # as the last argument:
+ #
+ # === Example
+ #
+ # ActiveResource::HttpMock.respond_to do |mock|
+ # mock.send(:get, "/people/1", {}, "XML1")
+ # end
+ # ActiveResource::HttpMock.responses.length #=> 1
+ #
+ # get_matz = ActiveResource::Request.new(:get, '/people/1.xml', nil)
+ # ok_response = ActiveResource::Response.new("", 200, {})
+ #
+ # pairs = {get_matz => ok_response}
+ #
+ # ActiveResource::HttpMock.respond_to(pairs, false)
+ # ActiveResource::HttpMock.responses.length #=> 2
+ def respond_to(*args) #:yields: mock
+ pairs = args.first || {}
+ reset! if args.last.class != FalseClass
responses.concat pairs.to_a
if block_given?
yield Responder.new(responses)
Oops, something went wrong. Retry.

0 comments on commit d37a653

Please sign in to comment.