From 098fa943565e06dafa67ca59ccf433939d2941b4 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Mon, 7 Feb 2005 14:15:53 +0000 Subject: [PATCH] Fixed documentation snafus #575, #576, #577, #585 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@525 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- .../assertions/action_pack_assertions.rb | 2 +- actionpack/lib/action_controller/base.rb | 2 +- actionpack/lib/action_controller/caching.rb | 2 +- .../lib/action_controller/cgi_ext/cgi_ext.rb | 4 +- actionpack/lib/action_controller/cookies.rb | 2 +- actionpack/lib/action_controller/filters.rb | 2 +- actionpack/lib/action_controller/flash.rb | 6 +-- actionpack/lib/action_controller/layout.rb | 4 +- actionpack/lib/action_controller/request.rb | 2 +- actionpack/lib/action_controller/rescue.rb | 2 +- .../lib/action_controller/scaffolding.rb | 8 ++-- .../session/mem_cache_store.rb | 4 +- .../lib/action_controller/url_rewriter.rb | 2 +- actionpack/lib/action_view/base.rb | 4 +- .../helpers/active_record_helper.rb | 2 +- .../helpers/form_options_helper.rb | 12 +++--- actionpack/lib/action_view/partials.rb | 2 +- .../lib/action_view/vendor/builder/xmlbase.rb | 6 +-- .../controller/action_pack_assertions_test.rb | 2 +- .../lib/active_record/aggregations.rb | 4 +- .../lib/active_record/associations.rb | 10 ++--- .../associations/association_collection.rb | 2 +- activerecord/lib/active_record/base.rb | 18 ++++----- activerecord/lib/active_record/callbacks.rb | 4 +- .../connection_adapters/abstract_adapter.rb | 2 +- .../connection_adapters/sqlserver_adapter.rb | 6 +-- activerecord/lib/active_record/fixtures.rb | 2 +- .../lib/active_record/transactions.rb | 4 +- activerecord/lib/active_record/validations.rb | 6 +-- activerecord/lib/active_record/wrappings.rb | 4 +- activerecord/test/associations_test.rb | 38 +++++++++---------- activerecord/test/base_test.rb | 2 +- .../test/deprecated_associations_test.rb | 8 ++-- activesupport/lib/inflector.rb | 4 +- railties/CHANGELOG | 2 + 35 files changed, 94 insertions(+), 92 deletions(-) diff --git a/actionpack/lib/action_controller/assertions/action_pack_assertions.rb b/actionpack/lib/action_controller/assertions/action_pack_assertions.rb index 5ffc0f90a1d..c26941cd6bd 100644 --- a/actionpack/lib/action_controller/assertions/action_pack_assertions.rb +++ b/actionpack/lib/action_controller/assertions/action_pack_assertions.rb @@ -99,7 +99,7 @@ module Test #:nodoc: assert_block(msg) { !response.has_flash? } end - # ensure the flash is empty but existant + # ensure the flash is empty but existent def assert_flash_empty(message=nil) response = acquire_assertion_target msg = build_message(message, "the flash is not empty ", response.flash) diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb index a11c86b1077..cfcd46d985b 100755 --- a/actionpack/lib/action_controller/base.rb +++ b/actionpack/lib/action_controller/base.rb @@ -558,7 +558,7 @@ module ActionController #:nodoc: @performed_redirect = true end - # Resets the session by clearsing out all the objects stored within and initializing a new session object. + # Resets the session by clearing out all the objects stored within and initializing a new session object. def reset_session #:doc: @request.reset_session @session = @request.session diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb index cc5544241e2..996b5af08d5 100644 --- a/actionpack/lib/action_controller/caching.rb +++ b/actionpack/lib/action_controller/caching.rb @@ -23,7 +23,7 @@ module ActionController #:nodoc: # are treated the same. Content management systems -- including weblogs and wikis -- have many pages that are a great fit # for this approach, but account-based systems where people log in and manipulate their own data are often less likely candidates. # - # Specifying which actions to cach is done through the caches class method: + # Specifying which actions to cache is done through the caches class method: # # class WeblogController < ActionController::Base # caches_page :show, :new diff --git a/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb b/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb index 371ead695bf..c8ebd57d267 100755 --- a/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb +++ b/actionpack/lib/action_controller/cgi_ext/cgi_ext.rb @@ -4,7 +4,7 @@ require 'cgi/session/pstore' require 'action_controller/cgi_ext/cgi_methods' # Wrapper around the CGIMethods that have been secluded to allow testing without -# an instatiated CGI object +# an instantiated CGI object class CGI #:nodoc: class << self alias :escapeHTML_fail_on_nil :escapeHTML @@ -40,4 +40,4 @@ class CGI #:nodoc: parameters['database_manager'] = CGI::Session::PStore CGI::Session.new(self, parameters) end -end \ No newline at end of file +end diff --git a/actionpack/lib/action_controller/cookies.rb b/actionpack/lib/action_controller/cookies.rb index 0a45684f6bb..b82aa5ee086 100644 --- a/actionpack/lib/action_controller/cookies.rb +++ b/actionpack/lib/action_controller/cookies.rb @@ -1,7 +1,7 @@ module ActionController #:nodoc: # Cookies are read and written through ActionController#cookies. The cookies being read is what was received along with the request, # the cookies being written is what will be sent out will the response. Cookies are read by value (so you won't get the cookie object - # itself back -- just the value it holds). Examples for writting: + # itself back -- just the value it holds). Examples for writing: # # cookies["user_name"] = "david" # => Will set a simple session cookie # cookies["login"] = { :value => "XJ-122", :expires => Time.now + 360} # => Will set a cookie that expires in 1 hour diff --git a/actionpack/lib/action_controller/filters.rb b/actionpack/lib/action_controller/filters.rb index 1bf9bb22174..83e3045859f 100644 --- a/actionpack/lib/action_controller/filters.rb +++ b/actionpack/lib/action_controller/filters.rb @@ -100,7 +100,7 @@ module ActionController #:nodoc: # == Around filters # # In addition to the individual before and after filters, it's also possible to specify that a single object should handle - # both the before and after call. That's especially usefuly when you need to keep state active between the before and after, + # both the before and after call. That's especially useful when you need to keep state active between the before and after, # such as the example of a benchmark filter below: # # class WeblogController < ActionController::Base diff --git a/actionpack/lib/action_controller/flash.rb b/actionpack/lib/action_controller/flash.rb index 220ed8c77a1..b4e8d75bf6c 100644 --- a/actionpack/lib/action_controller/flash.rb +++ b/actionpack/lib/action_controller/flash.rb @@ -1,13 +1,13 @@ module ActionController #:nodoc: # The flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed # to the very next action and then cleared out. This is a great way of doing notices and alerts, such as a create action - # that sets flash["notice"] = "Succesfully created" before redirecting to a display action that can then expose + # that sets flash["notice"] = "Successfully created" before redirecting to a display action that can then expose # the flash to its template. Actually, that exposure is automatically done. Example: # # class WeblogController < ActionController::Base # def create # # save post - # flash["notice"] = "Succesfully created post" + # flash["notice"] = "Successfully created post" # redirect_to :action => "display", :params => { "id" => post.id } # end # @@ -62,4 +62,4 @@ module ActionController #:nodoc: end end end -end \ No newline at end of file +end diff --git a/actionpack/lib/action_controller/layout.rb b/actionpack/lib/action_controller/layout.rb index 82fd9569c3f..aca3dbd7972 100644 --- a/actionpack/lib/action_controller/layout.rb +++ b/actionpack/lib/action_controller/layout.rb @@ -65,7 +65,7 @@ module ActionController #:nodoc: # app/views/layouts/weblog.rhtml or app/views/layouts/weblog.rxml exists then it will be automatically set as # the layout for your WeblogController. You can create a layout with the name application.rhtml or application.rxml # and this will be set as the default controller if there is no layout with the same name as the current controller and there is - # no layout explicitly assigned with the +layout+ method. Setting a layout explicity will always override the automatic behaviour. + # no layout explicitly assigned with the +layout+ method. Setting a layout explicitly will always override the automatic behaviour. # # == Inheritance for layouts # @@ -136,7 +136,7 @@ module ActionController #:nodoc: # This will assign "weblog_standard" as the WeblogController's layout except for the +rss+ action, which will not wrap a layout # around the rendered view. # - # Both the +:only+ and +:except+ condition can accept an aribtrary number of method references, so +:except => [ :rss, :text_only ]+ + # Both the +:only+ and +:except+ condition can accept an arbitrary number of method references, so +:except => [ :rss, :text_only ]+ # is valid, as is # +:except => :rss+. # # == Using a different layout in the action render call diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb index 94ec7d27afd..3e2344c3cb4 100755 --- a/actionpack/lib/action_controller/request.rb +++ b/actionpack/lib/action_controller/request.rb @@ -65,7 +65,7 @@ module ActionController parts - parts.last(1 + tld_length) end - # Recieve the raw post data. + # Receive the raw post data. # This is useful for services such as REST, XMLRPC and SOAP # which communicate over HTTP POST but don't use the traditional parameter format. def raw_post diff --git a/actionpack/lib/action_controller/rescue.rb b/actionpack/lib/action_controller/rescue.rb index 9d7c3d95b24..eb7f614de0e 100644 --- a/actionpack/lib/action_controller/rescue.rb +++ b/actionpack/lib/action_controller/rescue.rb @@ -51,7 +51,7 @@ module ActionController #:nodoc: render_text "

Application error (Rails)

" end - # Overwrite to expand the meaning of a local request in order to show local rescues on other occurances than + # Overwrite to expand the meaning of a local request in order to show local rescues on other occurences than # the remote IP being 127.0.0.1. For example, this could include the IP of the developer machine when debugging # remotely. def local_request? #:doc: diff --git a/actionpack/lib/action_controller/scaffolding.rb b/actionpack/lib/action_controller/scaffolding.rb index 49b35b37dfc..9c1311efa38 100644 --- a/actionpack/lib/action_controller/scaffolding.rb +++ b/actionpack/lib/action_controller/scaffolding.rb @@ -44,7 +44,7 @@ module ActionController # def create # @entry = Entry.new(@params["entry"]) # if @entry.save - # flash["notice"] = "Entry was succesfully created" + # flash["notice"] = "Entry was successfully created" # redirect_to :action => "list" # else # render "entry/new" @@ -61,7 +61,7 @@ module ActionController # @entry.attributes = @params["entry"] # # if @entry.save - # flash["notice"] = "Entry was succesfully updated" + # flash["notice"] = "Entry was successfully updated" # redirect_to :action => "show/" + @entry.id.to_s # else # render "entry/edit" @@ -123,7 +123,7 @@ module ActionController def create#{suffix} @#{singular_name} = #{class_name}.new(@params["#{singular_name}"]) if @#{singular_name}.save - flash["notice"] = "#{class_name} was succesfully created" + flash["notice"] = "#{class_name} was successfully created" redirect_to :action => "list#{suffix}" else render "#{singular_name}/new#{suffix}" @@ -140,7 +140,7 @@ module ActionController @#{singular_name}.attributes = @params["#{singular_name}"] if @#{singular_name}.save - flash["notice"] = "#{class_name} was succesfully updated" + flash["notice"] = "#{class_name} was successfully updated" redirect_to :action => "show#{suffix}/" + @#{singular_name}.id.to_s else render "#{singular_name}/edit#{suffix}" diff --git a/actionpack/lib/action_controller/session/mem_cache_store.rb b/actionpack/lib/action_controller/session/mem_cache_store.rb index 1073b408cc0..6fc80d9e564 100644 --- a/actionpack/lib/action_controller/session/mem_cache_store.rb +++ b/actionpack/lib/action_controller/session/mem_cache_store.rb @@ -33,7 +33,7 @@ begin # characters; automatically generated session ids observe # this requirement. # - # +option+ is a hash of options for the initialiser. The + # +option+ is a hash of options for the initializer. The # following options are recognized: # # cache:: an instance of a MemCache client to use as the @@ -92,4 +92,4 @@ begin end rescue LoadError # MemCache wasn't available so neither can the store be -end \ No newline at end of file +end diff --git a/actionpack/lib/action_controller/url_rewriter.rb b/actionpack/lib/action_controller/url_rewriter.rb index dadae7c34b4..ea82dffee9b 100644 --- a/actionpack/lib/action_controller/url_rewriter.rb +++ b/actionpack/lib/action_controller/url_rewriter.rb @@ -1,5 +1,5 @@ module ActionController - # Rewrites urls for Base.redirect_to and Base.url_for in the controller. + # Rewrites URLs for Base.redirect_to and Base.url_for in the controller. class UrlRewriter #:nodoc: VALID_OPTIONS = [:action, :action_prefix, :action_suffix, :application_prefix, :module, :controller, :controller_prefix, :anchor, :params, :path_params, :id, :only_path, :overwrite_params, :host, :protocol ] diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index ad809e2bff0..3f94a76cd0e 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -61,12 +61,12 @@ module ActionView #:nodoc: # # The parsing of ERb templates are cached by default, but the reading of them are not. This means that the application by default # will reflect changes to the templates immediatly. If you'd like to sacrifice that immediacy for the speed gain given by also - # caching the loading of templates (reading from the file systen), you can turn that on with + # caching the loading of templates (reading from the file system), you can turn that on with # ActionView::Base.cache_template_loading = true. # # == Builder # - # Builder templates are a more programatic alternative to ERb. They are especially useful for generating XML content. An +XmlMarkup+ object + # Builder templates are a more programmatic alternative to ERb. They are especially useful for generating XML content. An +XmlMarkup+ object # named +xml+ is automatically made available to templates with a +.rxml+ extension. # # Here are some basic examples: diff --git a/actionpack/lib/action_view/helpers/active_record_helper.rb b/actionpack/lib/action_view/helpers/active_record_helper.rb index 82c6d1cd81f..45a5aff8bd8 100644 --- a/actionpack/lib/action_view/helpers/active_record_helper.rb +++ b/actionpack/lib/action_view/helpers/active_record_helper.rb @@ -10,7 +10,7 @@ module ActionView module Helpers # The Active Record Helper makes it easier to create forms for records kept in instance variables. The most far-reaching is the form # method that creates a complete form for all the basic content types of the record (not associations or aggregations, though). This - # is a great of making the record quickly available for editing, but likely to prove lacklusters for a complicated real-world form. + # is a great of making the record quickly available for editing, but likely to prove lackluster for a complicated real-world form. # In that case, it's better to use the input method and the specialized form methods in link:classes/ActionView/Helpers/FormHelper.html module ActiveRecordHelper # Returns a default input tag for the type of object returned by the method. Example diff --git a/actionpack/lib/action_view/helpers/form_options_helper.rb b/actionpack/lib/action_view/helpers/form_options_helper.rb index 4f0a0fbfe0e..aa448764da7 100644 --- a/actionpack/lib/action_view/helpers/form_options_helper.rb +++ b/actionpack/lib/action_view/helpers/form_options_helper.rb @@ -9,7 +9,7 @@ module ActionView include ERB::Util # Create a select tag and a series of contained option tags for the provided object and method. - # The option currenlty held by the object will be selected, provided that the object is available. + # The option currently held by the object will be selected, provided that the object is available. # # This can be used to provide a default set of options in the standard way: before rendering the create form, a # new model instance is assigned the default options and bound to @model_name. Usually this model is not saved @@ -40,14 +40,14 @@ module ActionView # options_for_select([["Dollar", "$"], ["Kroner", "DKK"]]) # \n # - # options_for_select([ "VISA", "Mastercard" ], "Mastercard") - # \n + # options_for_select([ "VISA", "MasterCard" ], "MasterCard") + # \n # # options_for_select({ "Basic" => "$20", "Plus" => "$40" }, "$40") # \n # - # options_for_select([ "VISA", "Mastercard", "Discover" ], ["VISA", "Discover"]) - # \n\n + # options_for_select([ "VISA", "MasterCard", "Discover" ], ["VISA", "Discover"]) + # \n\n def options_for_select(container, selected = nil) container = container.to_a if Hash === container @@ -87,7 +87,7 @@ module ActionView # An array of group objects are passed. Each group should return an array of options when calling group_method # Each group should should return its name when calling group_label_method. # - # html_option_groups_from_collection(@continents, "countries", "contient_name", "country_id", "country_name", @selected_country.id) + # html_option_groups_from_collection(@continents, "countries", "continent_name", "country_id", "country_name", @selected_country.id) # # Could become: # diff --git a/actionpack/lib/action_view/partials.rb b/actionpack/lib/action_view/partials.rb index 1255a060ddf..f771f0a826e 100644 --- a/actionpack/lib/action_view/partials.rb +++ b/actionpack/lib/action_view/partials.rb @@ -12,7 +12,7 @@ module ActionView # # == Rendering a collection of partials # - # The example of partial use describes a familar pattern where a template needs to iterate over an array and render a sub + # The example of partial use describes a familiar pattern where a template needs to iterate over an array and render a sub # template for each of the elements. This pattern has been implemented as a single method that accepts an array and renders # a partial by the same name as the elements contained within. So the three-lined example in "Using partials" can be rewritten # with a single line: diff --git a/actionpack/lib/action_view/vendor/builder/xmlbase.rb b/actionpack/lib/action_view/vendor/builder/xmlbase.rb index d065d6fae16..7202bb2ead8 100644 --- a/actionpack/lib/action_view/vendor/builder/xmlbase.rb +++ b/actionpack/lib/action_view/vendor/builder/xmlbase.rb @@ -76,7 +76,7 @@ module Builder #:nodoc: end # Append text to the output target. Escape any markup. May be - # used within the markup brakets as: + # used within the markup brackets as: # # builder.p { br; text! "HI" } #=>


HI

def text!(text) @@ -84,7 +84,7 @@ module Builder #:nodoc: end # Append text to the output target without escaping any markup. - # May be used within the markup brakets as: + # May be used within the markup brackets as: # # builder.p { |x| x << "
HI" } #=>


HI

# @@ -94,7 +94,7 @@ module Builder #:nodoc: # # It is also useful for stacking builder objects. Builders only # use << to append to the target, so by supporting this - # method/operation builders can use oother builders as their + # method/operation builders can use other builders as their # targets. def <<(text) _text(text) diff --git a/actionpack/test/controller/action_pack_assertions_test.rb b/actionpack/test/controller/action_pack_assertions_test.rb index 1389e02e0e0..b1875b83288 100644 --- a/actionpack/test/controller/action_pack_assertions_test.rb +++ b/actionpack/test/controller/action_pack_assertions_test.rb @@ -195,7 +195,7 @@ class ActionPackAssertionsControllerTest < Test::Unit::TestCase assert_success end - # -- standard request/reponse object testing -------------------------------- + # -- standard request/response object testing -------------------------------- # ensure our session is working properly def test_session_objects diff --git a/activerecord/lib/active_record/aggregations.rb b/activerecord/lib/active_record/aggregations.rb index 82011018a28..6a82e53b039 100644 --- a/activerecord/lib/active_record/aggregations.rb +++ b/activerecord/lib/active_record/aggregations.rb @@ -94,7 +94,7 @@ module ActiveRecord # relational unique identifiers (such as primary keys). Normal ActiveRecord::Base classes are entity objects. # # It's also important to treat the value objects as immutable. Don't allow the Money object to have its amount changed after - # creation. Create a new money object with the new value instead. This is examplified by the Money#exchanged_to method that + # creation. Create a new money object with the new value instead. This is exemplified by the Money#exchanged_to method that # returns a new value object instead of changing its own values. Active Record won't persist value objects that have been # changed through other means than the writer method. # @@ -108,7 +108,7 @@ module ActiveRecord # composed_of :address would add address and address=(new_address). # # Options are: - # * :class_name - specify the class name of the association. Use it only if that name can't be infered + # * :class_name - specify the class name of the association. Use it only if that name can't be inferred # from the part id. So composed_of :address will by default be linked to the +Address+ class, but # if the real class name is +CompanyAddress+, you'll have to specify it with this option. # * :mapping - specifies a number of mapping arrays (attribute, parameter) that bind an attribute name diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb index b9cae482aae..baa3f178f32 100755 --- a/activerecord/lib/active_record/associations.rb +++ b/activerecord/lib/active_record/associations.rb @@ -160,7 +160,7 @@ module ActiveRecord # * collection.find(id) - finds an associated object responding to the +id+ and that # meets the condition that it has to be associated with this object. # * collection.find_all(conditions = nil, orderings = nil, limit = nil, joins = nil) - finds all associated objects responding - # criterias mentioned (like in the standard find_all) and that meets the condition that it has to be associated with this object. + # criteria mentioned (like in the standard find_all) and that meets the condition that it has to be associated with this object. # * collection.build(attributes = {}) - returns a new object of the collection type that has been instantiated # with +attributes+ and linked to this object through a foreign key but has not yet been saved. # * collection.create(attributes = {}) - returns a new object of the collection type that has been instantiated @@ -180,7 +180,7 @@ module ActiveRecord # The declaration can also include an options hash to specialize the behavior of the association. # # Options are: - # * :class_name - specify the class name of the association. Use it only if that name can't be infered + # * :class_name - specify the class name of the association. Use it only if that name can't be inferred # from the association name. So has_many :products will by default be linked to the +Product+ class, but # if the real class name is +SpecialProduct+, you'll have to specify it with this option. # * :conditions - specify the conditions that the associated objects must meet in order to be included as a "WHERE" @@ -263,7 +263,7 @@ module ActiveRecord # The declaration can also include an options hash to specialize the behavior of the association. # # Options are: - # * :class_name - specify the class name of the association. Use it only if that name can't be infered + # * :class_name - specify the class name of the association. Use it only if that name can't be inferred # from the association name. So has_one :manager will by default be linked to the +Manager+ class, but # if the real class name is +Person+, you'll have to specify it with this option. # * :conditions - specify the conditions that the associated object must meet in order to be included as a "WHERE" @@ -330,7 +330,7 @@ module ActiveRecord # The declaration can also include an options hash to specialize the behavior of the association. # # Options are: - # * :class_name - specify the class name of the association. Use it only if that name can't be infered + # * :class_name - specify the class name of the association. Use it only if that name can't be inferred # from the association name. So has_one :author will by default be linked to the +Author+ class, but # if the real class name is +Person+, you'll have to specify it with this option. # * :conditions - specify the conditions that the associated object must meet in order to be included as a "WHERE" @@ -432,7 +432,7 @@ module ActiveRecord # The declaration may include an options hash to specialize the behavior of the association. # # Options are: - # * :class_name - specify the class name of the association. Use it only if that name can't be infered + # * :class_name - specify the class name of the association. Use it only if that name can't be inferred # from the association name. So has_and_belongs_to_many :projects will by default be linked to the # +Project+ class, but if the real class name is +SuperProject+, you'll have to specify it with this option. # * :join_table - specify the name of the join table if the default based on lexical order isn't what you want. diff --git a/activerecord/lib/active_record/associations/association_collection.rb b/activerecord/lib/active_record/associations/association_collection.rb index cf1d0ecefc7..1eac8a2a0b1 100644 --- a/activerecord/lib/active_record/associations/association_collection.rb +++ b/activerecord/lib/active_record/associations/association_collection.rb @@ -99,7 +99,7 @@ module ActiveRecord false end - # Array#flatten has problems with rescursive arrays. Going one level deeper solves the majority of the problems. + # Array#flatten has problems with recursive arrays. Going one level deeper solves the majority of the problems. def flatten_deeper(array) array.collect { |element| element.respond_to?(:flatten) ? element.flatten : element }.flatten end diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 3342fc7092e..e763eb381cd 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -112,7 +112,7 @@ module ActiveRecord #:nodoc: # is actually Payment.find_all_by_amount(amount, orderings = nil, limit = nil, joins = nil). And the full interface to Person.find_by_user_name is # actually Person.find_by_user_name(user_name, orderings = nil) # - # == Saving arrays, hashes, and other non-mappeable objects in text columns + # == Saving arrays, hashes, and other non-mappable objects in text columns # # Active Record can serialize any object in text columns using YAML. To do so, you must specify this with a call to the class method +serialize+. # This makes it possible to store arrays, hashes, and other non-mappeable objects without doing any additional work. Example: @@ -168,7 +168,7 @@ module ActiveRecord #:nodoc: # * +ActiveRecordError+ -- generic error class and superclass of all other errors raised by Active Record # * +AdapterNotSpecified+ -- the configuration hash used in establish_connection didn't include a # :adapter key. - # * +AdapterNotSpecified+ -- the :adapter key used in establish_connection specified an unexisting adapter + # * +AdapterNotSpecified+ -- the :adapter key used in establish_connection specified an non-existent adapter # (or a bad spelling of an existing one). # * +AssociationTypeMismatch+ -- the object assigned to the association wasn't of the type specified in the association definition. # * +SerializationTypeMismatch+ -- the object serialized wasn't of the class specified as the second parameter. @@ -221,7 +221,7 @@ module ActiveRecord #:nodoc: @@primary_key_prefix_type = nil # Accessor for the name of the prefix string to prepend to every table name. So if set to "basecamp_", all - # table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convinient way of creating a namespace + # table names will be named like "basecamp_projects", "basecamp_people", etc. This is a convenient way of creating a namespace # for tables in a shared database. By default, the prefix is the empty string. cattr_accessor :table_name_prefix @@table_name_prefix = "" @@ -447,7 +447,7 @@ module ActiveRecord #:nodoc: write_inheritable_array("attr_protected", attributes) end - # Returns an array of all the attributes that have been protected from mass-assigment. + # Returns an array of all the attributes that have been protected from mass-assignment. def protected_attributes # :nodoc: read_inheritable_attribute("attr_protected") end @@ -460,14 +460,14 @@ module ActiveRecord #:nodoc: write_inheritable_array("attr_accessible", attributes) end - # Returns an array of all the attributes that have been made accessible to mass-assigment. + # Returns an array of all the attributes that have been made accessible to mass-assignment. def accessible_attributes # :nodoc: read_inheritable_attribute("attr_accessible") end # Specifies that the attribute by the name of +attr_name+ should be serialized before saving to the database and unserialized # after loading from the database. The serialization is done through YAML. If +class_name+ is specified, the serialized - # object must be of that class on retrival or +SerializationTypeMismatch+ will be raised. + # object must be of that class on retrieval or +SerializationTypeMismatch+ will be raised. def serialize(attr_name, class_name = Object) write_inheritable_attribute("attr_serialized", serialized_attributes.update(attr_name.to_s => class_name)) end @@ -507,7 +507,7 @@ module ActiveRecord #:nodoc: table_name_prefix + undecorated_table_name(class_name_of_active_record_descendant(self)) + table_name_suffix end - # Defines the primary key field -- can be overridden in subclasses. Overwritting will negate any effect of the + # Defines the primary key field -- can be overridden in subclasses. Overwriting will negate any effect of the # primary_key_prefix_type setting, though. def primary_key case primary_key_prefix_type @@ -1170,7 +1170,7 @@ module ActiveRecord #:nodoc: # by calling new on the column type or aggregation type (through composed_of) object with these parameters. # So having the pairs written_on(1) = "2004", written_on(2) = "6", written_on(3) = "24", will instantiate # written_on (a date type) with Date.new("2004", "6", "24"). You can also specify a typecast character in the - # parenteses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float, + # parentheses to have the parameters typecasted before they're used in the constructor. Use i for Fixnum, f for Float, # s for String, and a for Array. If all the values for a given attribute is empty, the attribute will be set to nil. def assign_multiparameter_attributes(pairs) execute_callstack_for_multiparameter_attributes( @@ -1253,4 +1253,4 @@ module ActiveRecord #:nodoc: string[0..3] == "--- " end end -end +end \ No newline at end of file diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb index b70d27f413a..1346000d001 100755 --- a/activerecord/lib/active_record/callbacks.rb +++ b/activerecord/lib/active_record/callbacks.rb @@ -22,7 +22,7 @@ module ActiveRecord # * (9) after_save # # That's a total of nine callbacks, which gives you immense power to react and prepare for each state in the - # Active Record lifecyle. + # Active Record lifecycle. # # Examples: # class CreditCard < ActiveRecord::Base @@ -125,7 +125,7 @@ module ActiveRecord # end # # def decrypt(value) - # # Secrecy is unvieled + # # Secrecy is unveiled # end # end # diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb index a2bab29b420..6a9ca8fcf10 100755 --- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb @@ -326,7 +326,7 @@ module ActiveRecord # Commits the transaction (and turns on auto-committing). def commit_db_transaction() end - # Rollsback the transaction (and turns on auto-committing). Must be done if the transaction block + # Rolls back the transaction (and turns on auto-committing). Must be done if the transaction block # raises an exception or returns false. def rollback_db_transaction() end diff --git a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb index d01085c3950..b4c9323b80e 100644 --- a/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb +++ b/activerecord/lib/active_record/connection_adapters/sqlserver_adapter.rb @@ -23,7 +23,7 @@ require 'active_record/connection_adapters/abstract_adapter' # with User Id replaced with your proper login, and Password with your # password. # -# I have tested this code on a WindowsXP Pro SP1 system, +# I have tested this code on a Windows XP Pro SP1 system, # ruby 1.8.2 (2004-07-29) [i386-mswin32], SQL Server 2000. # module ActiveRecord @@ -122,7 +122,7 @@ EOL execute enable_identity_insert(table_name, true) ii_enabled = true rescue Exception => e - # Coulnd't turn on IDENTITY_INSERT + # Couldn't turn on IDENTITY_INSERT end end end @@ -285,4 +285,4 @@ EOL end end end -end \ No newline at end of file +end diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb index 2e356cd8fbd..9cbcf1c786e 100755 --- a/activerecord/lib/active_record/fixtures.rb +++ b/activerecord/lib/active_record/fixtures.rb @@ -39,7 +39,7 @@ require 'active_record/support/inflector' # Fixtures can also be kept in the Comma Separated Value format. Akin to YAML fixtures, CSV fixtures are stored # in a single file, but, instead end with the .csv file extension (Rails example: "/test/fixtures/web_sites.csv") # -# The format of this tye of fixture file is much more compact than the others, but also a little harder to read by us +# The format of this type of fixture file is much more compact than the others, but also a little harder to read by us # humans. The first line of the CSV file is a comma-separated list of field names. The rest of the file is then comprised # of the actual data (1 per line). Here's an example: # diff --git a/activerecord/lib/active_record/transactions.rb b/activerecord/lib/active_record/transactions.rb index 3deaef68662..937955dd720 100644 --- a/activerecord/lib/active_record/transactions.rb +++ b/activerecord/lib/active_record/transactions.rb @@ -20,7 +20,7 @@ module ActiveRecord end # Transactions are protective blocks where SQL statements are only permanent if they can all succeed as one atomic action. - # The classic example is a transfer between two accounts where you can only have a deposit if the withdrawal succedded and + # The classic example is a transfer between two accounts where you can only have a deposit if the withdrawal succeeded and # vice versa. Transaction enforce the integrity of the database and guards the data against program errors or database break-downs. # So basically you should use transaction blocks whenever you have a number of statements that must be executed together or # not at all. Example: @@ -121,4 +121,4 @@ module ActiveRecord transaction { save_without_transactions(perform_validation) } end end -end \ No newline at end of file +end diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb index 4d1c92330bd..1e5d4287b01 100755 --- a/activerecord/lib/active_record/validations.rb +++ b/activerecord/lib/active_record/validations.rb @@ -19,7 +19,7 @@ module ActiveRecord # end # # def validate_on_update - # errors.add_to_base("No changes have occured") if unchanged_attributes? + # errors.add_to_base("No changes have occurred") if unchanged_attributes? # end # end # @@ -253,7 +253,7 @@ module ActiveRecord # # Configuration options: # * in - An enumerable object of available items - # * message - Specifieds a customer error message (default is: "is not included in the list") + # * message - Specifies a customer error message (default is: "is not included in the list") # * allow_nil - If set to true, skips this validation if the attribute is null (default is: false) def validates_inclusion_of(*attr_names) configuration = { :message => ActiveRecord::Errors.default_error_messages[:inclusion], :on => :save } @@ -272,7 +272,7 @@ module ActiveRecord end end - # Validates whether the associated object or objects are all themselves valid. Works with any kind of assocation. + # Validates whether the associated object or objects are all themselves valid. Works with any kind of association. # # class Book < ActiveRecord::Base # has_many :pages diff --git a/activerecord/lib/active_record/wrappings.rb b/activerecord/lib/active_record/wrappings.rb index 43e5e3151dd..01976417b71 100644 --- a/activerecord/lib/active_record/wrappings.rb +++ b/activerecord/lib/active_record/wrappings.rb @@ -1,7 +1,7 @@ module ActiveRecord # A plugin framework for wrapping attribute values before they go in and unwrapping them after they go out of the database. # This was intended primarily for YAML wrapping of arrays and hashes, but this behavior is now native in the Base class. - # So for now this framework is laying dorment until a need pops up. + # So for now this framework is laying dormant until a need pops up. module Wrappings #:nodoc: module ClassMethods #:nodoc: def wrap_with(wrapper, *attributes) @@ -56,4 +56,4 @@ module ActiveRecord def unwrap(attribute) end end end -end \ No newline at end of file +end diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 1133446fa86..63d06de4dd6 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -705,36 +705,36 @@ class HasAndBelongsToManyAssociationsTest < Test::Unit::TestCase end def test_adding_multiple - aridridel = Developer.new("name" => "Aridridel") - aridridel.save - aridridel.projects.reload - aridridel.projects.push(Project.find(1), Project.find(2)) - assert_equal 2, aridridel.projects.size - assert_equal 2, aridridel.projects(true).size + aredridel = Developer.new("name" => "Aridridel") + aredridel.save + aredridel.projects.reload + aredridel.projects.push(Project.find(1), Project.find(2)) + assert_equal 2, aredridel.projects.size + assert_equal 2, aredridel.projects(true).size end def test_adding_a_collection - aridridel = Developer.new("name" => "Aridridel") - aridridel.save - aridridel.projects.reload - aridridel.projects.concat([Project.find(1), Project.find(2)]) - assert_equal 2, aridridel.projects.size - assert_equal 2, aridridel.projects(true).size + aredridel = Developer.new("name" => "Aridridel") + aredridel.save + aredridel.projects.reload + aredridel.projects.concat([Project.find(1), Project.find(2)]) + assert_equal 2, aredridel.projects.size + assert_equal 2, aredridel.projects(true).size end def test_habtm_adding_before_save no_of_devels = Developer.count no_of_projects = Project.count - aridridel = Developer.new("name" => "Aridridel") - aridridel.projects.concat([Project.find(1), p = Project.new("name" => "Projekt")]) - assert aridridel.new_record? + aredridel = Developer.new("name" => "Aridridel") + aredridel.projects.concat([Project.find(1), p = Project.new("name" => "Projekt")]) + assert aredridel.new_record? assert p.new_record? - assert aridridel.save - assert !aridridel.new_record? + assert aredridel.save + assert !aredridel.new_record? assert_equal no_of_devels+1, Developer.count assert_equal no_of_projects+1, Project.count - assert_equal 2, aridridel.projects.size - assert_equal 2, aridridel.projects(true).size + assert_equal 2, aredridel.projects.size + assert_equal 2, aredridel.projects(true).size end def test_habtm_adding_before_save_with_join_attributes diff --git a/activerecord/test/base_test.rb b/activerecord/test/base_test.rb index cbccacdbf53..c1f9a776387 100755 --- a/activerecord/test/base_test.rb +++ b/activerecord/test/base_test.rb @@ -575,7 +575,7 @@ class BasicsTest < Test::Unit::TestCase if Default.connection.class.name == 'ActiveRecord::ConnectionAdapters::PostgreSQLAdapter' default = Default.new - # dates / timestampts + # dates / timestamps time_format = "%m/%d/%Y %H:%M" assert_equal Time.now.strftime(time_format), default.modified_time.strftime(time_format) assert_equal Date.today, default.modified_date diff --git a/activerecord/test/deprecated_associations_test.rb b/activerecord/test/deprecated_associations_test.rb index f7462752151..ed1b9be6155 100755 --- a/activerecord/test/deprecated_associations_test.rb +++ b/activerecord/test/deprecated_associations_test.rb @@ -249,11 +249,11 @@ class DeprecatedAssociationsTest < Test::Unit::TestCase end def test_has_and_belongs_to_many_adding_a_collection - aridridel = Developer.new("name" => "Aridridel") - aridridel.save + aredridel = Developer.new("name" => "Aredridel") + aredridel.save - aridridel.add_projects([ Project.find(1), Project.find(2) ]) - assert_equal 2, aridridel.projects_count + aredridel.add_projects([ Project.find(1), Project.find(2) ]) + assert_equal 2, aredridel.projects_count end def test_belongs_to_counter diff --git a/activesupport/lib/inflector.rb b/activesupport/lib/inflector.rb index 6c8a60e6c45..065fad37622 100644 --- a/activesupport/lib/inflector.rb +++ b/activesupport/lib/inflector.rb @@ -1,4 +1,4 @@ -# The Inflector transforms words from singular to plural, class names to table names, modulized class names to ones without, +# The Inflector transforms words from singular to plural, class names to table names, modularized class names to ones without, # and class names to foreign keys. module Inflector extend self @@ -81,4 +81,4 @@ module Inflector [/s$/, ''] ] end -end \ No newline at end of file +end diff --git a/railties/CHANGELOG b/railties/CHANGELOG index 7de2f06c888..857cc917b92 100644 --- a/railties/CHANGELOG +++ b/railties/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Added that the 'fixture :posts' syntax can be used for has_and_belongs_to_many fixtures where a model doesn't exist #572 [bitsweat] + * Added that running test_units and test_functional now performs the clone_structure_to_test as well #566 [rasputnik] * Added new generator framework that informs about its doings on generation and enables updating and destruction of generated artifacts. See the new script/destroy and script/update for more details #487 [bitsweat]