aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--[-rwxr-xr-x]actionmailer/README0
-rw-r--r--[-rwxr-xr-x]actionmailer/Rakefile0
-rw-r--r--[-rwxr-xr-x]actionmailer/lib/action_mailer.rb0
-rw-r--r--[-rwxr-xr-x]actionmailer/test/mail_service_test.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_controller.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_controller/base.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_controller/request.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_controller/request_profiler.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_controller/response.rb0
-rwxr-xr-x[-rw-r--r--]actionpack/lib/action_controller/session/drb_server.rb14
-rw-r--r--[-rwxr-xr-x]actionpack/lib/action_view/helpers/date_helper.rb0
-rw-r--r--actionpack/lib/action_view/helpers/prototype_helper.rb2
-rw-r--r--[-rwxr-xr-x]actionpack/test/controller/cgi_test.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/test/controller/redirect_test.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/test/controller/session/cookie_store_test.rb0
-rw-r--r--[-rwxr-xr-x]actionpack/test/template/date_helper_test.rb0
-rw-r--r--actionpack/test/template/prototype_helper_test.rb6
-rwxr-xr-x[-rw-r--r--]activemodel/Rakefile0
-rw-r--r--[-rwxr-xr-x]activerecord/README0
-rw-r--r--[-rwxr-xr-x]activerecord/Rakefile0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/associations.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/associations/belongs_to_association.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/associations/has_one_association.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/base.rb10
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/callbacks.rb0
-rw-r--r--activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb4
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/connection_adapters/abstract_adapter.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/connection_adapters/mysql_adapter.rb4
-rw-r--r--activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb4
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/fixtures.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/lib/active_record/validations.rb46
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/associations/belongs_to_associations_test.rb0
-rw-r--r--activerecord/test/cases/associations/has_many_associations_test.rb2
-rw-r--r--activerecord/test/cases/associations/has_many_through_associations_test.rb9
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/associations/has_one_associations_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/associations_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/attribute_methods_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/base_test.rb8
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/deprecated_finder_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/fixtures_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/inheritance_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/lifecycle_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/readonly_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/unconnected_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/cases/validations_test.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/models/company.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/models/reply.rb0
-rw-r--r--[-rwxr-xr-x]activerecord/test/models/topic.rb0
-rwxr-xr-x[-rw-r--r--]activesupport/lib/active_support/multibyte/generators/generate_tables.rb0
-rw-r--r--railties/CHANGELOG2
-rwxr-xr-x[-rw-r--r--]railties/bin/about0
-rwxr-xr-x[-rw-r--r--]railties/bin/console0
-rwxr-xr-x[-rw-r--r--]railties/bin/destroy0
-rwxr-xr-x[-rw-r--r--]railties/bin/generate0
-rwxr-xr-x[-rw-r--r--]railties/bin/performance/benchmarker0
-rwxr-xr-x[-rw-r--r--]railties/bin/performance/profiler0
-rwxr-xr-x[-rw-r--r--]railties/bin/performance/request0
-rwxr-xr-x[-rw-r--r--]railties/bin/plugin0
-rwxr-xr-x[-rw-r--r--]railties/bin/process/inspector0
-rwxr-xr-x[-rw-r--r--]railties/bin/process/reaper0
-rwxr-xr-x[-rw-r--r--]railties/bin/process/spawner0
-rwxr-xr-x[-rw-r--r--]railties/bin/runner0
-rwxr-xr-x[-rw-r--r--]railties/bin/server0
-rw-r--r--[-rwxr-xr-x]railties/configs/apache.conf0
-rwxr-xr-xrailties/dispatches/dispatch.fcgi2
-rwxr-xr-xrailties/dispatches/dispatch.rb4
-rwxr-xr-x[-rw-r--r--]railties/dispatches/gateway.cgi4
-rw-r--r--railties/lib/commands/dbconsole.rb2
-rwxr-xr-x[-rw-r--r--]railties/lib/commands/ncgi/listener4
-rwxr-xr-x[-rw-r--r--]railties/lib/commands/ncgi/tracker4
-rw-r--r--railties/lib/initializer.rb2
-rw-r--r--[-rwxr-xr-x]railties/lib/rails_generator/generators/components/plugin/templates/Rakefile0
74 files changed, 82 insertions, 51 deletions
diff --git a/actionmailer/README b/actionmailer/README
index 0e16ea6ec6..0e16ea6ec6 100755..100644
--- a/actionmailer/README
+++ b/actionmailer/README
diff --git a/actionmailer/Rakefile b/actionmailer/Rakefile
index 612bd27774..612bd27774 100755..100644
--- a/actionmailer/Rakefile
+++ b/actionmailer/Rakefile
diff --git a/actionmailer/lib/action_mailer.rb b/actionmailer/lib/action_mailer.rb
index 2e324d4637..2e324d4637 100755..100644
--- a/actionmailer/lib/action_mailer.rb
+++ b/actionmailer/lib/action_mailer.rb
diff --git a/actionmailer/test/mail_service_test.rb b/actionmailer/test/mail_service_test.rb
index e5ecb0e254..e5ecb0e254 100755..100644
--- a/actionmailer/test/mail_service_test.rb
+++ b/actionmailer/test/mail_service_test.rb
diff --git a/actionpack/lib/action_controller.rb b/actionpack/lib/action_controller.rb
index 3c4a339d50..3c4a339d50 100755..100644
--- a/actionpack/lib/action_controller.rb
+++ b/actionpack/lib/action_controller.rb
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index ac10a956f3..ac10a956f3 100755..100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
diff --git a/actionpack/lib/action_controller/request.rb b/actionpack/lib/action_controller/request.rb
index c55788a531..c55788a531 100755..100644
--- a/actionpack/lib/action_controller/request.rb
+++ b/actionpack/lib/action_controller/request.rb
diff --git a/actionpack/lib/action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb
index a6471d0c08..a6471d0c08 100755..100644
--- a/actionpack/lib/action_controller/request_profiler.rb
+++ b/actionpack/lib/action_controller/request_profiler.rb
diff --git a/actionpack/lib/action_controller/response.rb b/actionpack/lib/action_controller/response.rb
index da352b6993..da352b6993 100755..100644
--- a/actionpack/lib/action_controller/response.rb
+++ b/actionpack/lib/action_controller/response.rb
diff --git a/actionpack/lib/action_controller/session/drb_server.rb b/actionpack/lib/action_controller/session/drb_server.rb
index 6f90db6747..2caa27f62a 100644..100755
--- a/actionpack/lib/action_controller/session/drb_server.rb
+++ b/actionpack/lib/action_controller/session/drb_server.rb
@@ -1,8 +1,8 @@
-#!/usr/local/bin/ruby -w
-
-# This is a really simple session storage daemon, basically just a hash,
+#!/usr/bin/env ruby
+
+# This is a really simple session storage daemon, basically just a hash,
# which is enabled for DRb access.
-
+
require 'drb'
session_hash = Hash.new
@@ -14,13 +14,13 @@ class <<session_hash
super(key, value)
end
end
-
+
def [](key)
@mutex.synchronize do
super(key)
end
end
-
+
def delete(key)
@mutex.synchronize do
super(key)
@@ -29,4 +29,4 @@ class <<session_hash
end
DRb.start_service('druby://127.0.0.1:9192', session_hash)
-DRb.thread.join \ No newline at end of file
+DRb.thread.join
diff --git a/actionpack/lib/action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
index c7a1d40ff2..c7a1d40ff2 100755..100644
--- a/actionpack/lib/action_view/helpers/date_helper.rb
+++ b/actionpack/lib/action_view/helpers/date_helper.rb
diff --git a/actionpack/lib/action_view/helpers/prototype_helper.rb b/actionpack/lib/action_view/helpers/prototype_helper.rb
index 5194f00382..4c3a8311a5 100644
--- a/actionpack/lib/action_view/helpers/prototype_helper.rb
+++ b/actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -111,7 +111,7 @@ module ActionView
(100..599).to_a)
AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
:asynchronous, :method, :insertion, :position,
- :form, :with, :update, :script ]).merge(CALLBACKS)
+ :form, :with, :update, :script, :type ]).merge(CALLBACKS)
end
# Returns a link to a remote action defined by <tt>options[:url]</tt>
diff --git a/actionpack/test/controller/cgi_test.rb b/actionpack/test/controller/cgi_test.rb
index 8ca70f8595..8ca70f8595 100755..100644
--- a/actionpack/test/controller/cgi_test.rb
+++ b/actionpack/test/controller/cgi_test.rb
diff --git a/actionpack/test/controller/redirect_test.rb b/actionpack/test/controller/redirect_test.rb
index 2f8bf7b6ee..2f8bf7b6ee 100755..100644
--- a/actionpack/test/controller/redirect_test.rb
+++ b/actionpack/test/controller/redirect_test.rb
diff --git a/actionpack/test/controller/session/cookie_store_test.rb b/actionpack/test/controller/session/cookie_store_test.rb
index 5adaeaf5c5..5adaeaf5c5 100755..100644
--- a/actionpack/test/controller/session/cookie_store_test.rb
+++ b/actionpack/test/controller/session/cookie_store_test.rb
diff --git a/actionpack/test/template/date_helper_test.rb b/actionpack/test/template/date_helper_test.rb
index d8c07e731b..d8c07e731b 100755..100644
--- a/actionpack/test/template/date_helper_test.rb
+++ b/actionpack/test/template/date_helper_test.rb
diff --git a/actionpack/test/template/prototype_helper_test.rb b/actionpack/test/template/prototype_helper_test.rb
index eb3517ef91..abc9f930dd 100644
--- a/actionpack/test/template/prototype_helper_test.rb
+++ b/actionpack/test/template/prototype_helper_test.rb
@@ -77,6 +77,8 @@ class PrototypeHelperTest < PrototypeHelperBaseTest
link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot" })
assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot?a=10&amp;b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>),
link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })
+ assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\">Remote outauthor</a>),
+ link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :type => :synchronous)
end
def test_link_to_remote_html_options
@@ -429,6 +431,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
def test_sortable
assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
@generator.sortable('blah', :url => { :action => "order" })
+ assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
+ @generator.sortable('blah', :url => { :action => "order" }, :type => :synchronous)
end
def test_draggable
@@ -439,6 +443,8 @@ Element.update("baz", "\\u003Cp\\u003EThis is a test\\u003C/p\\u003E");
def test_drop_receiving
assert_equal %(Droppables.add("blah", {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});),
@generator.drop_receiving('blah', :url => { :action => "order" })
+ assert_equal %(Droppables.add("blah", {onDrop:function(element){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:'id=' + encodeURIComponent(element.id)})}});),
+ @generator.drop_receiving('blah', :url => { :action => "order" }, :type => :synchronous)
end
def test_collection_first_and_last
diff --git a/activemodel/Rakefile b/activemodel/Rakefile
index 4b60f8d682..4b60f8d682 100644..100755
--- a/activemodel/Rakefile
+++ b/activemodel/Rakefile
diff --git a/activerecord/README b/activerecord/README
index d68eb28a64..d68eb28a64 100755..100644
--- a/activerecord/README
+++ b/activerecord/README
diff --git a/activerecord/Rakefile b/activerecord/Rakefile
index 983528aff7..983528aff7 100755..100644
--- a/activerecord/Rakefile
+++ b/activerecord/Rakefile
diff --git a/activerecord/lib/active_record.rb b/activerecord/lib/active_record.rb
index 17a7949959..17a7949959 100755..100644
--- a/activerecord/lib/active_record.rb
+++ b/activerecord/lib/active_record.rb
diff --git a/activerecord/lib/active_record/associations.rb b/activerecord/lib/active_record/associations.rb
index 4e33dfe69f..4e33dfe69f 100755..100644
--- a/activerecord/lib/active_record/associations.rb
+++ b/activerecord/lib/active_record/associations.rb
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb
index 7c28cbdd07..7c28cbdd07 100755..100644
--- a/activerecord/lib/active_record/associations/belongs_to_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_association.rb
diff --git a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
index d8146daa54..d8146daa54 100755..100644
--- a/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
+++ b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb
index fdc0fa52c9..fdc0fa52c9 100755..100644
--- a/activerecord/lib/active_record/associations/has_one_association.rb
+++ b/activerecord/lib/active_record/associations/has_one_association.rb
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index 9cb64223e2..29c2995334 100755..100644
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -122,6 +122,10 @@ module ActiveRecord #:nodoc:
class MissingAttributeError < NoMethodError
end
+ # Raised when unknown attributes are supplied via mass assignment.
+ class UnknownAttributeError < NoMethodError
+ end
+
# Raised when an error occurred while doing a mass assignment to an attribute through the
# <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
# offending attribute.
@@ -2400,7 +2404,11 @@ module ActiveRecord #:nodoc:
attributes = remove_attributes_protected_from_mass_assignment(attributes) if guard_protected_attributes
attributes.each do |k, v|
- k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
+ if k.include?("(")
+ multi_parameter_attributes << [ k, v ]
+ else
+ respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
+ end
end
assign_multiparameter_attributes(multi_parameter_attributes)
diff --git a/activerecord/lib/active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
index be2621fdb6..be2621fdb6 100755..100644
--- a/activerecord/lib/active_record/callbacks.rb
+++ b/activerecord/lib/active_record/callbacks.rb
diff --git a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
index 5358491cde..aaf9e2e73f 100644
--- a/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -149,6 +149,10 @@ module ActiveRecord
"INSERT INTO #{quote_table_name(table_name)} VALUES(DEFAULT)"
end
+ def case_sensitive_equality_operator
+ "="
+ end
+
protected
# Returns an array of record hashes with the column names as keys and
# column values as values.
diff --git a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
index 47dbf5a5f3..47dbf5a5f3 100755..100644
--- a/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
diff --git a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
index 35b9ed4746..204ebaa2e2 100755..100644
--- a/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
@@ -511,6 +511,10 @@ module ActiveRecord
keys.length == 1 ? [keys.first, nil] : nil
end
+ def case_sensitive_equality_operator
+ "= BINARY"
+ end
+
private
def connect
@connection.reconnect = true if @connection.respond_to?(:reconnect=)
diff --git a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
index 6a20f41a4b..856435517a 100644
--- a/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
+++ b/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -182,8 +182,8 @@ module ActiveRecord
def self.extract_value_from_default(default)
case default
# Numeric types
- when /\A-?\d+(\.\d*)?\z/
- default
+ when /\A\(?(-?\d+(\.\d*)?\)?)\z/
+ $1
# Character types
when /\A'(.*)'::(?:character varying|bpchar|text)\z/m
$1
diff --git a/activerecord/lib/active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
index 622cfc3c3f..622cfc3c3f 100755..100644
--- a/activerecord/lib/active_record/fixtures.rb
+++ b/activerecord/lib/active_record/fixtures.rb
diff --git a/activerecord/lib/active_record/validations.rb b/activerecord/lib/active_record/validations.rb
index b957ee3b9e..e7a9676394 100755..100644
--- a/activerecord/lib/active_record/validations.rb
+++ b/activerecord/lib/active_record/validations.rb
@@ -625,13 +625,25 @@ module ActiveRecord
# class (which has a database table to query from).
finder_class = class_hierarchy.detect { |klass| !klass.abstract_class? }
- if value.nil? || (configuration[:case_sensitive] || !finder_class.columns_hash[attr_name.to_s].text?)
- condition_sql = "#{record.class.quoted_table_name}.#{attr_name} #{attribute_condition(value)}"
+ is_text_column = finder_class.columns_hash[attr_name.to_s].text?
+
+ if value.nil?
+ comparison_operator = "IS ?"
+ else
+ comparison_operator = "#{connection.case_sensitive_equality_operator} ?"
+
+ if is_text_column
+ value = value.to_s
+ end
+ end
+
+ sql_attribute = "#{record.class.quoted_table_name}.#{connection.quote_column_name(attr_name)}"
+
+ if value.nil? || (configuration[:case_sensitive] || !is_text_column)
+ condition_sql = "#{sql_attribute} #{comparison_operator}"
condition_params = [value]
else
- # sqlite has case sensitive SELECT query, while MySQL/Postgresql don't.
- # Hence, this is needed only for sqlite.
- condition_sql = "LOWER(#{record.class.quoted_table_name}.#{attr_name}) #{attribute_condition(value)}"
+ condition_sql = "LOWER(#{sql_attribute}) #{comparison_operator}"
condition_params = [value.downcase]
end
@@ -648,28 +660,10 @@ module ActiveRecord
condition_params << record.send(:id)
end
- results = finder_class.with_exclusive_scope do
- connection.select_all(
- construct_finder_sql(
- :select => "#{connection.quote_column_name(attr_name)}",
- :from => "#{finder_class.quoted_table_name}",
- :conditions => [condition_sql, *condition_params]
- )
- )
- end
-
- unless results.length.zero?
- found = true
-
- # As MySQL/Postgres don't have case sensitive SELECT queries, we try to find duplicate
- # column in ruby when case sensitive option
- if configuration[:case_sensitive] && finder_class.columns_hash[attr_name.to_s].text?
- found = results.any? { |a| a[attr_name.to_s] == value.to_s }
- end
-
- if found
+ finder_class.with_exclusive_scope do
+ if finder_class.exists?([condition_sql, *condition_params])
message = record.errors.generate_message(attr_name, :taken, :default => configuration[:message])
- record.errors.add(attr_name, message)
+ record.errors.add(attr_name, message)
end
end
end
diff --git a/activerecord/test/cases/associations/belongs_to_associations_test.rb b/activerecord/test/cases/associations/belongs_to_associations_test.rb
index 9c718c4fef..9c718c4fef 100755..100644
--- a/activerecord/test/cases/associations/belongs_to_associations_test.rb
+++ b/activerecord/test/cases/associations/belongs_to_associations_test.rb
diff --git a/activerecord/test/cases/associations/has_many_associations_test.rb b/activerecord/test/cases/associations/has_many_associations_test.rb
index f8b8b1f96d..47e4b3527d 100644
--- a/activerecord/test/cases/associations/has_many_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1007,7 +1007,7 @@ class HasManyAssociationsTest < ActiveRecord::TestCase
firm.clients.create({ :name => 'Some Client' })
stats = Namespaced::Firm.find(firm.id, {
- :select => "#{Namespaced::Firm.table_name}.*, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
+ :select => "#{Namespaced::Firm.table_name}.id, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
:joins => :clients,
:group => "#{Namespaced::Firm.table_name}.id"
})
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb
index be5170f830..d51a3c7e1c 100644
--- a/activerecord/test/cases/associations/has_many_through_associations_test.rb
+++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -2,15 +2,18 @@ require "cases/helper"
require 'models/post'
require 'models/person'
require 'models/reader'
+require 'models/comment'
class HasManyThroughAssociationsTest < ActiveRecord::TestCase
- fixtures :posts, :readers, :people
+ fixtures :posts, :readers, :people, :comments
def test_associate_existing
assert_queries(2) { posts(:thinking);people(:david) }
-
+
+ posts(:thinking).people
+
assert_queries(1) do
- posts(:thinking).people << people(:david)
+ posts(:thinking).people << people(:david)
end
assert_queries(1) do
diff --git a/activerecord/test/cases/associations/has_one_associations_test.rb b/activerecord/test/cases/associations/has_one_associations_test.rb
index 99639849a5..99639849a5 100755..100644
--- a/activerecord/test/cases/associations/has_one_associations_test.rb
+++ b/activerecord/test/cases/associations/has_one_associations_test.rb
diff --git a/activerecord/test/cases/associations_test.rb b/activerecord/test/cases/associations_test.rb
index 4904feeb7d..4904feeb7d 100755..100644
--- a/activerecord/test/cases/associations_test.rb
+++ b/activerecord/test/cases/associations_test.rb
diff --git a/activerecord/test/cases/attribute_methods_test.rb b/activerecord/test/cases/attribute_methods_test.rb
index 7999e29264..7999e29264 100755..100644
--- a/activerecord/test/cases/attribute_methods_test.rb
+++ b/activerecord/test/cases/attribute_methods_test.rb
diff --git a/activerecord/test/cases/base_test.rb b/activerecord/test/cases/base_test.rb
index 9e4f268db7..e6d1b5ddfd 100755..100644
--- a/activerecord/test/cases/base_test.rb
+++ b/activerecord/test/cases/base_test.rb
@@ -904,6 +904,14 @@ class BasicsTest < ActiveRecord::TestCase
assert_nil keyboard.id
end
+ def test_mass_assigning_invalid_attribute
+ firm = Firm.new
+
+ assert_raises(ActiveRecord::UnknownAttributeError) do
+ firm.attributes = { "id" => 5, "type" => "Client", "i_dont_even_exist" => 20 }
+ end
+ end
+
def test_mass_assignment_protection_on_defaults
firm = Firm.new
firm.attributes = { "id" => 5, "type" => "Client" }
diff --git a/activerecord/test/cases/deprecated_finder_test.rb b/activerecord/test/cases/deprecated_finder_test.rb
index 2afc91b769..2afc91b769 100755..100644
--- a/activerecord/test/cases/deprecated_finder_test.rb
+++ b/activerecord/test/cases/deprecated_finder_test.rb
diff --git a/activerecord/test/cases/fixtures_test.rb b/activerecord/test/cases/fixtures_test.rb
index 6ba7597f56..6ba7597f56 100755..100644
--- a/activerecord/test/cases/fixtures_test.rb
+++ b/activerecord/test/cases/fixtures_test.rb
diff --git a/activerecord/test/cases/inheritance_test.rb b/activerecord/test/cases/inheritance_test.rb
index 4fd38bfbc9..4fd38bfbc9 100755..100644
--- a/activerecord/test/cases/inheritance_test.rb
+++ b/activerecord/test/cases/inheritance_test.rb
diff --git a/activerecord/test/cases/lifecycle_test.rb b/activerecord/test/cases/lifecycle_test.rb
index ab005c6b00..ab005c6b00 100755..100644
--- a/activerecord/test/cases/lifecycle_test.rb
+++ b/activerecord/test/cases/lifecycle_test.rb
diff --git a/activerecord/test/cases/readonly_test.rb b/activerecord/test/cases/readonly_test.rb
index b921cbdc9c..b921cbdc9c 100755..100644
--- a/activerecord/test/cases/readonly_test.rb
+++ b/activerecord/test/cases/readonly_test.rb
diff --git a/activerecord/test/cases/unconnected_test.rb b/activerecord/test/cases/unconnected_test.rb
index 23ad10f3f9..23ad10f3f9 100755..100644
--- a/activerecord/test/cases/unconnected_test.rb
+++ b/activerecord/test/cases/unconnected_test.rb
diff --git a/activerecord/test/cases/validations_test.rb b/activerecord/test/cases/validations_test.rb
index 4b2d28c80b..4b2d28c80b 100755..100644
--- a/activerecord/test/cases/validations_test.rb
+++ b/activerecord/test/cases/validations_test.rb
diff --git a/activerecord/test/models/company.rb b/activerecord/test/models/company.rb
index cd435948a1..cd435948a1 100755..100644
--- a/activerecord/test/models/company.rb
+++ b/activerecord/test/models/company.rb
diff --git a/activerecord/test/models/reply.rb b/activerecord/test/models/reply.rb
index 812bc1f535..812bc1f535 100755..100644
--- a/activerecord/test/models/reply.rb
+++ b/activerecord/test/models/reply.rb
diff --git a/activerecord/test/models/topic.rb b/activerecord/test/models/topic.rb
index 39ca1bf42a..39ca1bf42a 100755..100644
--- a/activerecord/test/models/topic.rb
+++ b/activerecord/test/models/topic.rb
diff --git a/activesupport/lib/active_support/multibyte/generators/generate_tables.rb b/activesupport/lib/active_support/multibyte/generators/generate_tables.rb
index 7f807585c5..7f807585c5 100644..100755
--- a/activesupport/lib/active_support/multibyte/generators/generate_tables.rb
+++ b/activesupport/lib/active_support/multibyte/generators/generate_tables.rb
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index 5ff1867568..6df7c568dc 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*Edge*
+* Turn cache_classes on by default [Josh Peek]
+
* Added configurable eager load paths. Defaults to app/models, app/controllers, and app/helpers [Josh Peek]
* Introduce simple internationalization support. [Ruby i18n team]
diff --git a/railties/bin/about b/railties/bin/about
index ed8deb0dfc..ed8deb0dfc 100644..100755
--- a/railties/bin/about
+++ b/railties/bin/about
diff --git a/railties/bin/console b/railties/bin/console
index 498077ab33..498077ab33 100644..100755
--- a/railties/bin/console
+++ b/railties/bin/console
diff --git a/railties/bin/destroy b/railties/bin/destroy
index a4df765a39..a4df765a39 100644..100755
--- a/railties/bin/destroy
+++ b/railties/bin/destroy
diff --git a/railties/bin/generate b/railties/bin/generate
index 173a9f147d..173a9f147d 100644..100755
--- a/railties/bin/generate
+++ b/railties/bin/generate
diff --git a/railties/bin/performance/benchmarker b/railties/bin/performance/benchmarker
index c842d35d33..c842d35d33 100644..100755
--- a/railties/bin/performance/benchmarker
+++ b/railties/bin/performance/benchmarker
diff --git a/railties/bin/performance/profiler b/railties/bin/performance/profiler
index d855ac8b13..d855ac8b13 100644..100755
--- a/railties/bin/performance/profiler
+++ b/railties/bin/performance/profiler
diff --git a/railties/bin/performance/request b/railties/bin/performance/request
index ae3f38c74b..ae3f38c74b 100644..100755
--- a/railties/bin/performance/request
+++ b/railties/bin/performance/request
diff --git a/railties/bin/plugin b/railties/bin/plugin
index 87cd2070fe..87cd2070fe 100644..100755
--- a/railties/bin/plugin
+++ b/railties/bin/plugin
diff --git a/railties/bin/process/inspector b/railties/bin/process/inspector
index bf25ad86d1..bf25ad86d1 100644..100755
--- a/railties/bin/process/inspector
+++ b/railties/bin/process/inspector
diff --git a/railties/bin/process/reaper b/railties/bin/process/reaper
index c77f04535f..c77f04535f 100644..100755
--- a/railties/bin/process/reaper
+++ b/railties/bin/process/reaper
diff --git a/railties/bin/process/spawner b/railties/bin/process/spawner
index 7118f3983c..7118f3983c 100644..100755
--- a/railties/bin/process/spawner
+++ b/railties/bin/process/spawner
diff --git a/railties/bin/runner b/railties/bin/runner
index a4a7cb25ba..a4a7cb25ba 100644..100755
--- a/railties/bin/runner
+++ b/railties/bin/runner
diff --git a/railties/bin/server b/railties/bin/server
index 3c67f39b69..3c67f39b69 100644..100755
--- a/railties/bin/server
+++ b/railties/bin/server
diff --git a/railties/configs/apache.conf b/railties/configs/apache.conf
index d9d211c058..d9d211c058 100755..100644
--- a/railties/configs/apache.conf
+++ b/railties/configs/apache.conf
diff --git a/railties/dispatches/dispatch.fcgi b/railties/dispatches/dispatch.fcgi
index 65188f380b..664dbbbee8 100755
--- a/railties/dispatches/dispatch.fcgi
+++ b/railties/dispatches/dispatch.fcgi
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
#
# You may specify the path to the FastCGI crash log (a log of unhandled
# exceptions which forced the FastCGI instance to exit, great for debugging)
diff --git a/railties/dispatches/dispatch.rb b/railties/dispatches/dispatch.rb
index 9b5ae760ff..32fa3b2665 100755
--- a/railties/dispatches/dispatch.rb
+++ b/railties/dispatches/dispatch.rb
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
@@ -7,4 +7,4 @@ require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_
require "dispatcher"
ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
-Dispatcher.dispatch \ No newline at end of file
+Dispatcher.dispatch
diff --git a/railties/dispatches/gateway.cgi b/railties/dispatches/gateway.cgi
index fb1fa22f04..0305b7f810 100644..100755
--- a/railties/dispatches/gateway.cgi
+++ b/railties/dispatches/gateway.cgi
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require 'drb'
@@ -94,4 +94,4 @@ end
$stdout.write output
$stdout.flush
-$stdout.close \ No newline at end of file
+$stdout.close
diff --git a/railties/lib/commands/dbconsole.rb b/railties/lib/commands/dbconsole.rb
index 17acb7b68f..442526ae32 100644
--- a/railties/lib/commands/dbconsole.rb
+++ b/railties/lib/commands/dbconsole.rb
@@ -41,6 +41,8 @@ when "mysql"
if config['password'] && include_password
args << "--password=#{config['password']}"
+ elsif config['password'] && !config['password'].empty?
+ args << "-p"
end
args << config['database']
diff --git a/railties/lib/commands/ncgi/listener b/railties/lib/commands/ncgi/listener
index 421c453f23..7079ef78a6 100644..100755
--- a/railties/lib/commands/ncgi/listener
+++ b/railties/lib/commands/ncgi/listener
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require 'stringio'
require 'fileutils'
@@ -83,4 +83,4 @@ end
socket_path = ARGV.shift
timeout = (ARGV.shift || 90).to_i
-Listener.new(timeout, socket_path) \ No newline at end of file
+Listener.new(timeout, socket_path)
diff --git a/railties/lib/commands/ncgi/tracker b/railties/lib/commands/ncgi/tracker
index 859c9fa0e0..4ca12d779b 100644..100755
--- a/railties/lib/commands/ncgi/tracker
+++ b/railties/lib/commands/ncgi/tracker
@@ -1,4 +1,4 @@
-#!/usr/local/bin/ruby
+#!/usr/bin/env ruby
require 'drb'
require 'thread'
@@ -66,4 +66,4 @@ end
socket_path = ARGV.shift
instances = ARGV.shift.to_i
t = Tracker.new(instances, socket_path)
-t.background(ARGV.first ? ARGV.shift.to_i : 90) \ No newline at end of file
+t.background(ARGV.first ? ARGV.shift.to_i : 90)
diff --git a/railties/lib/initializer.rb b/railties/lib/initializer.rb
index 611e348acb..a2d08e2938 100644
--- a/railties/lib/initializer.rb
+++ b/railties/lib/initializer.rb
@@ -904,7 +904,7 @@ Run `rake gems:install` to install the missing gems.
end
def default_cache_classes
- false
+ true
end
def default_whiny_nils
diff --git a/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile b/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile
index 1824fb10fe..1824fb10fe 100755..100644
--- a/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile
+++ b/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile