Permalink
Browse files

Merge branch 'master' into nested_has_many_through

Conflicts:
	activerecord/lib/active_record/associations/has_many_through_association.rb
	activerecord/test/cases/associations/has_many_through_associations_test.rb
  • Loading branch information...
2 parents e05162c + 401c183 commit 1bc90044b655572a4b8aa3b323905e26d37e0f2b @jonleighton jonleighton committed Nov 17, 2010
Showing with 3,968 additions and 1,793 deletions.
  1. +1 −0 .gitignore
  2. +1 −1 Gemfile
  3. +34 −22 Rakefile
  4. +4 −0 actionmailer/CHANGELOG
  5. +2 −2 actionmailer/lib/action_mailer/version.rb
  6. +4 −0 actionpack/CHANGELOG
  7. +17 −15 actionpack/lib/abstract_controller/callbacks.rb
  8. +2 −1 actionpack/lib/action_dispatch/http/url.rb
  9. +228 −22 actionpack/lib/action_dispatch/routing/mapper.rb
  10. +2 −1 actionpack/lib/action_dispatch/routing/route.rb
  11. +2 −2 actionpack/lib/action_pack/version.rb
  12. +13 −488 actionpack/lib/action_view/helpers/asset_tag_helper.rb
  13. +133 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/asset_include_tag.rb
  14. +153 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/asset_paths.rb
  15. +173 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/javascript_tag_helpers.rb
  16. +144 −0 actionpack/lib/action_view/helpers/asset_tag_helpers/stylesheet_tag_helpers.rb
  17. +2 −0 actionpack/lib/action_view/helpers/date_helper.rb
  18. +17 −4 actionpack/lib/action_view/helpers/form_helper.rb
  19. +18 −0 actionpack/lib/action_view/helpers/text_helper.rb
  20. +2 −2 actionpack/lib/action_view/railtie.rb
  21. +4 −3 actionpack/lib/action_view/renderer/partial_renderer.rb
  22. +20 −0 actionpack/test/activerecord/active_record_store_test.rb
  23. +8 −0 actionpack/test/controller/action_pack_assertions_test.rb
  24. +79 −2 actionpack/test/controller/filters_test.rb
  25. +8 −0 actionpack/test/controller/routing_test.rb
  26. +3 −0 actionpack/test/dispatch/request_test.rb
  27. +2 −0 actionpack/test/fixtures/layouts/_partial_and_yield.erb
  28. +1 −0 actionpack/test/fixtures/layouts/_yield_only.erb
  29. +1 −0 actionpack/test/fixtures/layouts/_yield_with_params.erb
  30. +2 −0 actionpack/test/fixtures/layouts/yield_with_render_partial_inside.erb
  31. +2 −0 actionpack/test/fixtures/test/_partial_with_layout.erb
  32. +4 −0 actionpack/test/fixtures/test/_partial_with_layout_block_content.erb
  33. +4 −0 actionpack/test/fixtures/test/_partial_with_layout_block_partial.erb
  34. +2 −0 actionpack/test/fixtures/test/_partial_with_partial.erb
  35. +10 −0 actionpack/test/lib/controller/fake_models.rb
  36. +13 −3 actionpack/test/template/asset_tag_helper_test.rb
  37. +41 −0 actionpack/test/template/date_helper_test.rb
  38. +21 −0 actionpack/test/template/form_helper_test.rb
  39. +45 −0 actionpack/test/template/render_test.rb
  40. +4 −0 activemodel/CHANGELOG
  41. +5 −5 activemodel/lib/active_model/attribute_methods.rb
  42. +2 −2 activemodel/lib/active_model/version.rb
  43. +29 −0 activerecord/CHANGELOG
  44. +1 −1 activerecord/activerecord.gemspec
  45. +1 −1 activerecord/lib/active_record/aggregations.rb
  46. +1 −1 activerecord/lib/active_record/associations.rb
  47. +23 −27 activerecord/lib/active_record/associations/association_collection.rb
  48. +5 −5 activerecord/lib/active_record/associations/association_proxy.rb
  49. +3 −3 activerecord/lib/active_record/associations/belongs_to_association.rb
  50. +1 −1 activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
  51. +2 −3 activerecord/lib/active_record/associations/has_many_through_association.rb
  52. +6 −6 activerecord/lib/active_record/associations/has_one_association.rb
  53. +1 −1 activerecord/lib/active_record/associations/has_one_through_association.rb
  54. +4 −3 activerecord/lib/active_record/attribute_methods/primary_key.rb
  55. +7 −7 activerecord/lib/active_record/autosave_association.rb
  56. +19 −9 activerecord/lib/active_record/base.rb
  57. +1 −1 activerecord/lib/active_record/locking/optimistic.rb
  58. +1 −1 activerecord/lib/active_record/locking/pessimistic.rb
  59. +2 −0 activerecord/lib/active_record/migration.rb
  60. +1 −1 activerecord/lib/active_record/nested_attributes.rb
  61. +6 −5 activerecord/lib/active_record/persistence.rb
  62. +1 −1 activerecord/lib/active_record/railtie.rb
  63. +26 −13 activerecord/lib/active_record/relation/calculations.rb
  64. +1 −1 activerecord/lib/active_record/relation/finder_methods.rb
  65. +5 −0 activerecord/lib/active_record/relation/predicate_builder.rb
  66. +5 −4 activerecord/lib/active_record/session_store.rb
  67. +6 −6 activerecord/lib/active_record/transactions.rb
  68. +1 −1 activerecord/lib/active_record/validations.rb
  69. +1 −1 activerecord/lib/active_record/validations/uniqueness.rb
  70. +2 −2 activerecord/lib/active_record/version.rb
  71. +6 −6 activerecord/test/cases/associations/belongs_to_associations_test.rb
  72. +1 −1 activerecord/test/cases/associations/eager_load_includes_full_sti_class_test.rb
  73. +6 −6 activerecord/test/cases/associations/eager_test.rb
  74. +15 −17 activerecord/test/cases/associations/has_and_belongs_to_many_associations_test.rb
  75. +45 −15 activerecord/test/cases/associations/has_many_associations_test.rb
  76. +7 −0 activerecord/test/cases/associations/has_many_through_associations_test.rb
  77. +2 −2 activerecord/test/cases/associations/has_one_associations_test.rb
  78. +2 −2 activerecord/test/cases/associations/inverse_associations_test.rb
  79. +8 −8 activerecord/test/cases/associations/join_model_test.rb
  80. +1 −1 activerecord/test/cases/associations_test.rb
  81. +1 −1 activerecord/test/cases/attribute_methods_test.rb
  82. +45 −47 activerecord/test/cases/autosave_association_test.rb
  83. +16 −8 activerecord/test/cases/base_test.rb
  84. +13 −0 activerecord/test/cases/calculations_test.rb
  85. +32 −22 activerecord/test/cases/finder_test.rb
  86. +3 −3 activerecord/test/cases/fixtures_test.rb
  87. +19 −4 activerecord/test/cases/migration_test.rb
  88. +1 −1 activerecord/test/cases/named_scope_test.rb
  89. +16 −8 activerecord/test/cases/nested_attributes_test.rb
  90. +10 −2 activerecord/test/cases/persistence_test.rb
  91. +0 −1 activerecord/test/cases/query_cache_test.rb
  92. +0 −2 activerecord/test/cases/relation_scoping_test.rb
  93. +30 −5 activerecord/test/cases/relations_test.rb
  94. +2 −2 activerecord/test/cases/session_store/sql_bypass.rb
  95. +1 −1 activerecord/test/cases/timestamp_test.rb
  96. +9 −9 activerecord/test/cases/transactions_test.rb
  97. +2 −2 activerecord/test/cases/validations/association_validation_test.rb
  98. +2 −2 activerecord/test/cases/validations/uniqueness_validation_test.rb
  99. +1 −1 activerecord/test/models/eye.rb
  100. +1 −1 activerecord/test/models/pirate.rb
  101. +1 −1 activerecord/test/models/subject.rb
  102. +1 −1 activerecord/test/models/topic.rb
  103. +4 −0 activeresource/CHANGELOG
  104. +2 −2 activeresource/lib/active_resource/version.rb
  105. +4 −0 activesupport/CHANGELOG
  106. +0 −1 activesupport/lib/active_support/core_ext/cgi.rb
  107. +0 −19 activesupport/lib/active_support/core_ext/cgi/escape_skipping_slashes.rb
  108. +1 −0 activesupport/lib/active_support/core_ext/hash.rb
  109. +11 −0 activesupport/lib/active_support/core_ext/hash/deep_dup.rb
  110. +0 −31 activesupport/lib/active_support/core_ext/object/instance_variables.rb
  111. +13 −1 activesupport/lib/active_support/core_ext/object/try.rb
  112. +1 −1 activesupport/lib/active_support/hash_with_indifferent_access.rb
  113. +1 −1 activesupport/lib/active_support/time_with_zone.rb
  114. +2 −2 activesupport/lib/active_support/version.rb
  115. +1 −2 activesupport/lib/active_support/xml_mini/nokogirisax.rb
  116. +0 −15 activesupport/test/core_ext/cgi_ext_test.rb
  117. +32 −0 activesupport/test/core_ext/hash_ext_test.rb
  118. +10 −31 activesupport/test/core_ext/object_and_class_ext_test.rb
  119. +11 −0 activesupport/test/core_ext/time_with_zone_test.rb
  120. +1 −1 rails.gemspec
  121. +3 −1 railties/CHANGELOG
  122. +8 −1 railties/guides/source/action_controller_overview.textile
  123. +2 −2 railties/guides/source/action_mailer_basics.textile
  124. +6 −33 railties/guides/source/active_support_core_extensions.textile
  125. +6 −8 railties/guides/source/api_documentation_guidelines.textile
  126. +3 −3 railties/guides/source/configuring.textile
  127. +4 −4 railties/guides/source/debugging_rails_applications.textile
  128. +15 −15 railties/guides/source/form_helpers.textile
  129. +0 −8 railties/guides/source/getting_started.textile
  130. +5 −5 railties/guides/source/initialization.textile
  131. +1 −1 railties/guides/source/layouts_and_rendering.textile
  132. +1 −1 railties/guides/source/plugins.textile
  133. +20 −0 railties/guides/source/routing.textile
  134. +0 −1 railties/lib/rails/application.rb
  135. +6 −4 railties/lib/rails/cli.rb
  136. +14 −6 railties/lib/rails/commands.rb
  137. +10 −0 railties/lib/rails/commands/plugin_new.rb
  138. +8 −0 railties/lib/rails/configuration.rb
  139. +2 −5 railties/lib/rails/engine.rb
  140. +1 −0 railties/lib/rails/engine/configuration.rb
  141. +176 −0 railties/lib/rails/generators/app_base.rb
  142. +22 −17 railties/lib/rails/generators/named_base.rb
  143. +10 −127 railties/lib/rails/generators/rails/app/app_generator.rb
  144. +2 −19 railties/lib/rails/generators/rails/app/templates/Gemfile
  145. +4 −0 railties/lib/rails/generators/rails/app/templates/config/application.rb
  146. +640 −344 railties/lib/rails/generators/rails/app/templates/public/javascripts/jquery.js
  147. +7 −0 railties/lib/rails/generators/rails/plugin/plugin_generator.rb
  148. +10 −0 railties/lib/rails/generators/rails/plugin_new/USAGE
  149. +249 −0 railties/lib/rails/generators/rails/plugin_new/plugin_new_generator.rb
  150. +9 −0 railties/lib/rails/generators/rails/plugin_new/templates/%name%.gemspec
  151. +11 −0 railties/lib/rails/generators/rails/plugin_new/templates/Gemfile
  152. +20 −0 railties/lib/rails/generators/rails/plugin_new/templates/MIT-LICENSE
  153. +3 −0 railties/lib/rails/generators/rails/plugin_new/templates/README.rdoc
  154. +18 −0 railties/lib/rails/generators/rails/plugin_new/templates/Rakefile
  155. +4 −0 ...b/rails/generators/rails/plugin_new/templates/app/controllers/%name%/application_controller.rb.tt
  156. +4 −0 railties/lib/rails/generators/rails/plugin_new/templates/app/helpers/%name%/application_helper.rb.tt
  157. +3 −0 railties/lib/rails/generators/rails/plugin_new/templates/config/routes.rb
  158. +6 −0 railties/lib/rails/generators/rails/plugin_new/templates/gitignore
  159. +6 −0 railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%.rb
  160. +7 −0 railties/lib/rails/generators/rails/plugin_new/templates/lib/%name%/engine.rb
  161. +4 −0 railties/lib/rails/generators/rails/plugin_new/templates/lib/tasks/%name%_tasks.rake
  162. +16 −0 railties/lib/rails/generators/rails/plugin_new/templates/rails/application.rb
  163. +10 −0 railties/lib/rails/generators/rails/plugin_new/templates/rails/boot.rb
  164. +4 −0 railties/lib/rails/generators/rails/plugin_new/templates/rails/routes.rb
  165. +5 −0 railties/lib/rails/generators/rails/plugin_new/templates/script/rails.tt
  166. +7 −0 railties/lib/rails/generators/rails/plugin_new/templates/test/%name%_test.rb
  167. +11 −0 railties/lib/rails/generators/rails/plugin_new/templates/test/integration/navigation_test.rb
  168. +15 −0 railties/lib/rails/generators/rails/plugin_new/templates/test/test_helper.rb
  169. +2 −2 railties/lib/rails/generators/rails/resource/resource_generator.rb
  170. +2 −0 railties/lib/rails/generators/rails/scaffold_controller/templates/controller.rb
  171. +3 −3 railties/lib/rails/generators/resource_helpers.rb
  172. +2 −0 railties/lib/rails/generators/test_unit/scaffold/templates/functional_test.rb
  173. +0 −1 railties/lib/rails/info.rb
  174. +2 −2 railties/lib/rails/version.rb
  175. +12 −0 railties/test/application/generators_test.rb
  176. +9 −0 railties/test/application/rake_test.rb
  177. 0 railties/test/fixtures/lib/{ → app_builders}/empty_builder.rb
  178. +7 −0 railties/test/fixtures/lib/app_builders/simple_builder.rb
  179. +7 −0 railties/test/fixtures/lib/app_builders/tweak_builder.rb
  180. +1 −0 railties/test/fixtures/lib/create_test_dummy_template.rb
  181. +2 −0 railties/test/fixtures/lib/plugin_builders/empty_builder.rb
  182. +7 −0 railties/test/fixtures/lib/plugin_builders/simple_builder.rb
  183. +19 −0 railties/test/fixtures/lib/plugin_builders/spec_builder.rb
  184. +7 −0 railties/test/fixtures/lib/plugin_builders/tweak_builder.rb
  185. +0 −7 railties/test/fixtures/lib/simple_builder.rb
  186. +0 −7 railties/test/fixtures/lib/tweak_builder.rb
  187. +22 −149 railties/test/generators/app_generator_test.rb
  188. +153 −0 railties/test/generators/namespaced_generators_test.rb
  189. +12 −6 railties/test/generators/plugin_generator_test.rb
  190. +196 −0 railties/test/generators/plugin_new_generator_test.rb
  191. +5 −0 railties/test/generators/resource_generator_test.rb
  192. +187 −0 railties/test/generators/shared_generator_tests.rb
  193. +27 −29 railties/test/railties/engine_test.rb
  194. +0 −11 release.rb
  195. +96 −0 tasks/release.rb
  196. +2 −2 version.rb
View
@@ -13,6 +13,7 @@ activesupport/doc
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
View
@@ -39,7 +39,7 @@ end
platforms :ruby do
gem 'json'
gem 'yajl-ruby'
- gem "nokogiri", ">= 1.4.3.1"
+ gem "nokogiri", ">= 1.4.4"
# AR
gem "sqlite3-ruby", "~> 1.3.1", :require => 'sqlite3'
View
@@ -3,7 +3,16 @@ require 'rdoc'
require 'rake'
require 'rdoc/task'
-require 'rake/gempackagetask'
+require 'net/http'
+
+$:.unshift File.expand_path('..', __FILE__)
+require "tasks/release"
+
+desc "Build gem files for all projects"
+task :build => "all:build"
+
+desc "Release all gems to gemcutter and create a tag"
+task :release => "all:release"
# RDoc skips some files in the Rails tree due to its binary? predicate. This is a quick
# hack for edge docs, until we decide which is the correct way to address this issue.
@@ -54,27 +63,6 @@ task :smoke do
system %(cd activerecord && #{$0} sqlite3:isolated_test)
end
-spec = eval(File.read('rails.gemspec'))
-Rake::GemPackageTask.new(spec) do |pkg|
- pkg.gem_spec = spec
-end
-
-desc "Release all gems to gemcutter. Package rails, package & push components, then push rails"
-task :release => :release_projects do
- require 'rake/gemcutter'
- Rake::Gemcutter::Tasks.new(spec).define
- Rake::Task['gem:push'].invoke
-end
-
-desc "Release all components to gemcutter."
-task :release_projects => :package do
- errors = []
- PROJECTS.each do |project|
- system(%(cd #{project} && #{$0} release)) || errors << project
- end
- fail("Errors in #{errors.join(', ')}") unless errors.empty?
-end
-
desc "Install gems for all projects."
task :install => :gem do
version = File.read("RAILS_VERSION").strip
@@ -172,3 +160,27 @@ task :update_versions do
end
end
end
+
+#
+# We have a webhook configured in Github that gets invoked after pushes.
+# This hook triggers the following tasks:
+#
+# * updates the local checkout
+# * updates Rails Contributors
+# * generates and publishes edge docs
+# * if there's a new stable tag, generates and publishes stable docs
+#
+# Everything is automated and you do NOT need to run this task normally.
+#
+# We publish a new verion by tagging, and pushing a tag does not trigger
+# that webhook. Stable docs would be updated by any subsequent regular
+# push, but if you want that to happen right away just run this.
+#
+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|
+ request = Net::HTTP::Post.new('/rails-master-hook')
+ response = http.request(request)
+ puts response.body
+ end
+end
@@ -2,6 +2,10 @@
* No changes
+*Rails 3.0.2 (unreleased)*
+
+* No changes
+
*Rails 3.0.1 (October 15, 2010)*
* No Changes, just a version bump.
@@ -3,8 +3,8 @@ module VERSION #:nodoc:
MAJOR = 3
MINOR = 1
TINY = 0
- BUILD = "beta"
+ PRE = "beta"
- STRING = [MAJOR, MINOR, TINY, BUILD].join('.')
+ STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.')
end
end
@@ -23,6 +23,10 @@
* Add Rack::Cache to the default stack. Create a Rails store that delegates to the Rails cache, so by default, whatever caching layer you are using will be used for HTTP caching. Note that Rack::Cache will be used if you use #expires_in, #fresh_when or #stale with :public => true. Otherwise, the caching rules will apply to the browser only. [Yehuda Katz, Carl Lerche]
+*Rails 3.0.2 (unreleased)*
+
+* The helper number_to_currency accepts a new :negative_format option to be able to configure how to render negative amounts. [Don Wilson]
+
*Rails 3.0.1 (October 15, 2010)*
* No Changes, just a version bump.
@@ -81,27 +81,29 @@ def _insert_callbacks(callbacks, block)
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) # def before_filter(*names, &blk)
- _insert_callbacks(names, blk) do |name, options| # _insert_callbacks(names, blk) do |name, options}
- set_callback(:process_action, :#{filter}, name, options) # set_callback(:process_action, :before_filter, name, options)
- end # end
- end # end
+ 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
# Prepend a before, after or around filter. See _insert_callbacks
# for details on the allowed parameters.
- 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|
- set_callback(:process_action, :#{filter}, name, options.merge(:prepend => true)) # set_callback(:process_action, :before, name, options.merge(:prepend => true))
- end # end
- end # end
+ 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
# Skip a before, after or around filter. See _insert_callbacks
# for details on the allowed parameters.
- 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
+ def skip_#{filter}_filter(*names, &blk)
+ _insert_callbacks(names, blk) do |name, options|
+ skip_callback(:process_action, :#{filter}, name, options)
+ end
+ end
# *_filter is the same as append_*_filter
alias_method :append_#{filter}_filter, :#{filter}_filter
@@ -2,6 +2,7 @@ module ActionDispatch
module Http
module URL
mattr_accessor :tld_length
+ self.tld_length = 1
# Returns the complete URL used for this request.
def url
@@ -67,7 +68,7 @@ def server_port
# Returns the \domain part of a \host, such as "rubyonrails.org" in "www.rubyonrails.org". You can specify
# a different <tt>tld_length</tt>, such as 2 to catch rubyonrails.co.uk in "www.rubyonrails.co.uk".
- def domain(tld_length = 1)
+ def domain(tld_length = @@tld_length)
return nil unless named_host?(host)
host.split('.').last(1 + tld_length).join('.')
Oops, something went wrong.

0 comments on commit 1bc9004

Please sign in to comment.