Skip to content
This repository
Browse code

Merge branch 'master' of git@github.com:rails/rails

  • Loading branch information...
commit 46a458206f1117b87e672bc5aae046eaa832ee00 2 parents a540725 + 0b9bfbd
Jeremy Kemper authored July 31, 2008

Showing 74 changed files with 82 additions and 51 deletions. Show diff stats Hide diff stats

  1. 0  action_controller.rb b/actionpack/lib/action_controller.rb
  2. 0  action_controller/base.rb b/actionpack/lib/action_controller/base.rb
  3. 0  action_controller/request.rb b/actionpack/lib/action_controller/request.rb
  4. 0  action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb
  5. 0  action_controller/response.rb b/actionpack/lib/action_controller/response.rb
  6. 0  action_mailer.rb b/actionmailer/lib/action_mailer.rb
  7. 0  action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb
  8. 0  actionmailer/README
  9. 0  actionmailer/Rakefile
  10. 0  actionmailer/test/mail_service_test.rb
  11. 14  actionpack/lib/action_controller/session/drb_server.rb
  12. 2  actionpack/lib/action_view/helpers/prototype_helper.rb
  13. 0  actionpack/test/controller/cgi_test.rb
  14. 0  actionpack/test/controller/redirect_test.rb
  15. 0  actionpack/test/controller/session/cookie_store_test.rb
  16. 0  actionpack/test/template/date_helper_test.rb
  17. 6  actionpack/test/template/prototype_helper_test.rb
  18. 0  active_record.rb b/activerecord/lib/active_record.rb
  19. 0  active_record/associations.rb b/activerecord/lib/active_record/associations.rb
  20. 0  ...ociations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb
  21. 0  ...ymorphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb
  22. 0  ...rd/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb
  23. 0  active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb
  24. 0  ...ction_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
  25. 0  active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb
  26. 0  ...te/generators/generate_tables.rb b/activesupport/lib/active_support/multibyte/generators/generate_tables.rb
  27. 0  activemodel/Rakefile
  28. 0  activerecord/README
  29. 0  activerecord/Rakefile
  30. 10  activerecord/lib/active_record/base.rb
  31. 4  activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
  32. 4  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb
  33. 4  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
  34. 46  activerecord/lib/active_record/validations.rb
  35. 0  activerecord/test/cases/associations/belongs_to_associations_test.rb
  36. 2  activerecord/test/cases/associations/has_many_associations_test.rb
  37. 9  activerecord/test/cases/associations/has_many_through_associations_test.rb
  38. 0  activerecord/test/cases/associations/has_one_associations_test.rb
  39. 0  activerecord/test/cases/associations_test.rb
  40. 0  activerecord/test/cases/attribute_methods_test.rb
  41. 8  activerecord/test/cases/base_test.rb
  42. 0  activerecord/test/cases/deprecated_finder_test.rb
  43. 0  activerecord/test/cases/fixtures_test.rb
  44. 0  activerecord/test/cases/inheritance_test.rb
  45. 0  activerecord/test/cases/lifecycle_test.rb
  46. 0  activerecord/test/cases/readonly_test.rb
  47. 0  activerecord/test/cases/unconnected_test.rb
  48. 0  activerecord/test/cases/validations_test.rb
  49. 0  activerecord/test/models/company.rb
  50. 0  activerecord/test/models/reply.rb
  51. 0  activerecord/test/models/topic.rb
  52. 0  ...ts/plugin/templates/Rakefile b/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile
  53. 2  railties/CHANGELOG
  54. 0  railties/bin/about
  55. 0  railties/bin/console
  56. 0  railties/bin/destroy
  57. 0  railties/bin/generate
  58. 0  railties/bin/performance/benchmarker
  59. 0  railties/bin/performance/profiler
  60. 0  railties/bin/performance/request
  61. 0  railties/bin/plugin
  62. 0  railties/bin/process/inspector
  63. 0  railties/bin/process/reaper
  64. 0  railties/bin/process/spawner
  65. 0  railties/bin/runner
  66. 0  railties/bin/server
  67. 0  railties/configs/apache.conf
  68. 2  railties/dispatches/dispatch.fcgi
  69. 4  railties/dispatches/dispatch.rb
  70. 4  railties/dispatches/gateway.cgi
  71. 2  railties/lib/commands/dbconsole.rb
  72. 4  railties/lib/commands/ncgi/listener
  73. 4  railties/lib/commands/ncgi/tracker
  74. 2  railties/lib/initializer.rb
0  action_controller.rb b/actionpack/lib/action_controller.rb 100755 → 100644
File mode changed
0  action_controller/base.rb b/actionpack/lib/action_controller/base.rb 100755 → 100644
File mode changed
0  action_controller/request.rb b/actionpack/lib/action_controller/request.rb 100755 → 100644
File mode changed
0  action_controller/request_profiler.rb b/actionpack/lib/action_controller/request_profiler.rb 100755 → 100644
File mode changed
0  action_controller/response.rb b/actionpack/lib/action_controller/response.rb 100755 → 100644
File mode changed
0  action_mailer.rb b/actionmailer/lib/action_mailer.rb 100755 → 100644
File mode changed
0  action_view/helpers/date_helper.rb b/actionpack/lib/action_view/helpers/date_helper.rb 100755 → 100644
File mode changed
0  actionmailer/README 100755 → 100644
File mode changed
0  actionmailer/Rakefile 100755 → 100644
File mode changed
0  actionmailer/test/mail_service_test.rb 100755 → 100644
File mode changed
14  actionpack/lib/action_controller/session/drb_server.rb 100644 → 100755
... ...
@@ -1,8 +1,8 @@
1  
-#!/usr/local/bin/ruby -w
2  
-                                                                                
3  
-# This is a really simple session storage daemon, basically just a hash, 
  1
+#!/usr/bin/env ruby
  2
+
  3
+# This is a really simple session storage daemon, basically just a hash,
4 4
 # which is enabled for DRb access.
5  
-                                                                                
  5
+
6 6
 require 'drb'
7 7
 
8 8
 session_hash = Hash.new
@@ -14,13 +14,13 @@ def []=(key, value)
14 14
       super(key, value)
15 15
     end
16 16
   end
17  
-  
  17
+
18 18
   def [](key)
19 19
     @mutex.synchronize do
20 20
       super(key)
21 21
     end
22 22
   end
23  
-  
  23
+
24 24
   def delete(key)
25 25
     @mutex.synchronize do
26 26
       super(key)
@@ -29,4 +29,4 @@ def delete(key)
29 29
 end
30 30
 
31 31
 DRb.start_service('druby://127.0.0.1:9192', session_hash)
32  
-DRb.thread.join
  32
+DRb.thread.join
2  actionpack/lib/action_view/helpers/prototype_helper.rb
@@ -111,7 +111,7 @@ module PrototypeHelper
111 111
                          (100..599).to_a)
112 112
         AJAX_OPTIONS = Set.new([ :before, :after, :condition, :url,
113 113
                          :asynchronous, :method, :insertion, :position,
114  
-                         :form, :with, :update, :script ]).merge(CALLBACKS)
  114
+                         :form, :with, :update, :script, :type ]).merge(CALLBACKS)
115 115
       end
116 116
 
117 117
       # Returns a link to a remote action defined by <tt>options[:url]</tt>
0  actionpack/test/controller/cgi_test.rb 100755 → 100644
File mode changed
0  actionpack/test/controller/redirect_test.rb 100755 → 100644
File mode changed
0  actionpack/test/controller/session/cookie_store_test.rb 100755 → 100644
File mode changed
0  actionpack/test/template/date_helper_test.rb 100755 → 100644
File mode changed
6  actionpack/test/template/prototype_helper_test.rb
@@ -77,6 +77,8 @@ def test_link_to_remote
77 77
       link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot"  })
78 78
     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>),
79 79
       link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })
  80
+    assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:false, evalScripts:true}); return false;\">Remote outauthor</a>),
  81
+      link_to_remote("Remote outauthor", :url => { :action => "whatnot" }, :type => :synchronous)
80 82
   end
81 83
 
82 84
   def test_link_to_remote_html_options
@@ -429,6 +431,8 @@ def test_visual_effect_toggle
429 431
   def test_sortable
430 432
     assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:true, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
431 433
       @generator.sortable('blah', :url => { :action => "order" })
  434
+    assert_equal %(Sortable.create("blah", {onUpdate:function(){new Ajax.Request('http://www.example.com/order', {asynchronous:false, evalScripts:true, parameters:Sortable.serialize("blah")})}});),
  435
+      @generator.sortable('blah', :url => { :action => "order" }, :type => :synchronous)
432 436
   end
433 437
 
434 438
   def test_draggable
@@ -439,6 +443,8 @@ def test_draggable
439 443
   def test_drop_receiving
440 444
     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)})}});),
441 445
       @generator.drop_receiving('blah', :url => { :action => "order" })
  446
+    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)})}});),
  447
+      @generator.drop_receiving('blah', :url => { :action => "order" }, :type => :synchronous)
442 448
   end
443 449
 
444 450
   def test_collection_first_and_last
0  active_record.rb b/activerecord/lib/active_record.rb 100755 → 100644
File mode changed
0  active_record/associations.rb b/activerecord/lib/active_record/associations.rb 100755 → 100644
File mode changed
0  ...ations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb 100755 → 100644
File mode changed
0  ...rphic_association.rb b/activerecord/lib/active_record/associations/belongs_to_polymorphic_association.rb 100755 → 100644
File mode changed
0  ...associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb 100755 → 100644
File mode changed
0  active_record/callbacks.rb b/activerecord/lib/active_record/callbacks.rb 100755 → 100644
File mode changed
0  ...on_adapters/abstract_adapter.rb b/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb 100755 → 100644
File mode changed
0  active_record/fixtures.rb b/activerecord/lib/active_record/fixtures.rb 100755 → 100644
File mode changed
0  ...generators/generate_tables.rb b/activesupport/lib/active_support/multibyte/generators/generate_tables.rb 100644 → 100755
File mode changed
0  activemodel/Rakefile 100644 → 100755
File mode changed
0  activerecord/README 100755 → 100644
File mode changed
0  activerecord/Rakefile 100755 → 100644
File mode changed
10  activerecord/lib/active_record/base.rb 100755 → 100644
@@ -122,6 +122,10 @@ class DangerousAttributeError < ActiveRecordError
122 122
   class MissingAttributeError < NoMethodError
123 123
   end
124 124
 
  125
+  # Raised when unknown attributes are supplied via mass assignment.
  126
+  class UnknownAttributeError < NoMethodError
  127
+  end
  128
+
125 129
   # Raised when an error occurred while doing a mass assignment to an attribute through the
126 130
   # <tt>attributes=</tt> method. The exception has an +attribute+ property that is the name of the
127 131
   # offending attribute.
@@ -2400,7 +2404,11 @@ def attributes=(new_attributes, guard_protected_attributes = true)
2400 2404
         attributes = remove_attributes_protected_from_mass_assignment(attributes) if guard_protected_attributes
2401 2405
 
2402 2406
         attributes.each do |k, v|
2403  
-          k.include?("(") ? multi_parameter_attributes << [ k, v ] : send(k + "=", v)
  2407
+          if k.include?("(")
  2408
+            multi_parameter_attributes << [ k, v ]
  2409
+          else
  2410
+            respond_to?(:"#{k}=") ? send(:"#{k}=", v) : raise(UnknownAttributeError, "unknown attribute: #{k}")
  2411
+          end
2404 2412
         end
2405 2413
 
2406 2414
         assign_multiparameter_attributes(multi_parameter_attributes)
4  activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
@@ -149,6 +149,10 @@ def empty_insert_statement(table_name)
149 149
         "INSERT INTO #{quote_table_name(table_name)} VALUES(DEFAULT)"
150 150
       end
151 151
 
  152
+      def case_sensitive_equality_operator
  153
+        "="
  154
+      end
  155
+
152 156
       protected
153 157
         # Returns an array of record hashes with the column names as keys and
154 158
         # column values as values.
4  activerecord/lib/active_record/connection_adapters/mysql_adapter.rb 100755 → 100644
@@ -511,6 +511,10 @@ def pk_and_sequence_for(table) #:nodoc:
511 511
         keys.length == 1 ? [keys.first, nil] : nil
512 512
       end
513 513
 
  514
+      def case_sensitive_equality_operator
  515
+        "= BINARY"
  516
+      end
  517
+
514 518
       private
515 519
         def connect
516 520
           @connection.reconnect = true if @connection.respond_to?(:reconnect=)
4  activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
@@ -182,8 +182,8 @@ def simplified_type(field_type)
182 182
         def self.extract_value_from_default(default)
183 183
           case default
184 184
             # Numeric types
185  
-            when /\A-?\d+(\.\d*)?\z/
186  
-              default
  185
+            when /\A\(?(-?\d+(\.\d*)?\)?)\z/
  186
+              $1
187 187
             # Character types
188 188
             when /\A'(.*)'::(?:character varying|bpchar|text)\z/m
189 189
               $1
46  activerecord/lib/active_record/validations.rb 100755 → 100644
@@ -625,13 +625,25 @@ def validates_uniqueness_of(*attr_names)
625 625
           # class (which has a database table to query from).
626 626
           finder_class = class_hierarchy.detect { |klass| !klass.abstract_class? }
627 627
 
628  
-          if value.nil? || (configuration[:case_sensitive] || !finder_class.columns_hash[attr_name.to_s].text?)
629  
-            condition_sql = "#{record.class.quoted_table_name}.#{attr_name} #{attribute_condition(value)}"
  628
+          is_text_column = finder_class.columns_hash[attr_name.to_s].text?
  629
+
  630
+          if value.nil?
  631
+            comparison_operator = "IS ?"
  632
+          else
  633
+            comparison_operator = "#{connection.case_sensitive_equality_operator} ?"
  634
+
  635
+            if is_text_column
  636
+              value = value.to_s
  637
+            end
  638
+          end
  639
+
  640
+          sql_attribute = "#{record.class.quoted_table_name}.#{connection.quote_column_name(attr_name)}"
  641
+
  642
+          if value.nil? || (configuration[:case_sensitive] || !is_text_column)
  643
+            condition_sql = "#{sql_attribute} #{comparison_operator}"
630 644
             condition_params = [value]
631 645
           else
632  
-            # sqlite has case sensitive SELECT query, while MySQL/Postgresql don't.
633  
-            # Hence, this is needed only for sqlite.
634  
-            condition_sql = "LOWER(#{record.class.quoted_table_name}.#{attr_name}) #{attribute_condition(value)}"
  646
+            condition_sql = "LOWER(#{sql_attribute}) #{comparison_operator}"
635 647
             condition_params = [value.downcase]
636 648
           end
637 649
 
@@ -648,28 +660,10 @@ def validates_uniqueness_of(*attr_names)
648 660
             condition_params << record.send(:id)
649 661
           end
650 662
 
651  
-          results = finder_class.with_exclusive_scope do
652  
-            connection.select_all(
653  
-              construct_finder_sql(
654  
-                :select     => "#{connection.quote_column_name(attr_name)}",
655  
-                :from       => "#{finder_class.quoted_table_name}",
656  
-                :conditions => [condition_sql, *condition_params]
657  
-              )
658  
-            )
659  
-          end
660  
-
661  
-          unless results.length.zero?
662  
-            found = true
663  
-
664  
-            # As MySQL/Postgres don't have case sensitive SELECT queries, we try to find duplicate
665  
-            # column in ruby when case sensitive option
666  
-            if configuration[:case_sensitive] && finder_class.columns_hash[attr_name.to_s].text?
667  
-              found = results.any? { |a| a[attr_name.to_s] == value.to_s }
668  
-            end
669  
-            
670  
-            if found
  663
+          finder_class.with_exclusive_scope do
  664
+            if finder_class.exists?([condition_sql, *condition_params])
671 665
               message = record.errors.generate_message(attr_name, :taken, :default => configuration[:message])
672  
-              record.errors.add(attr_name, message) 
  666
+              record.errors.add(attr_name, message)
673 667
             end
674 668
           end
675 669
         end
0  activerecord/test/cases/associations/belongs_to_associations_test.rb 100755 → 100644
File mode changed
2  activerecord/test/cases/associations/has_many_associations_test.rb
@@ -1007,7 +1007,7 @@ def test_joins_with_namespaced_model_should_use_correct_type
1007 1007
     firm.clients.create({ :name => 'Some Client' })
1008 1008
 
1009 1009
     stats = Namespaced::Firm.find(firm.id, {
1010  
-      :select => "#{Namespaced::Firm.table_name}.*, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
  1010
+      :select => "#{Namespaced::Firm.table_name}.id, COUNT(#{Namespaced::Client.table_name}.id) AS num_clients",
1011 1011
       :joins  => :clients,
1012 1012
       :group  => "#{Namespaced::Firm.table_name}.id"
1013 1013
     })
9  activerecord/test/cases/associations/has_many_through_associations_test.rb
@@ -2,15 +2,18 @@
2 2
 require 'models/post'
3 3
 require 'models/person'
4 4
 require 'models/reader'
  5
+require 'models/comment'
5 6
 
6 7
 class HasManyThroughAssociationsTest < ActiveRecord::TestCase
7  
-  fixtures :posts, :readers, :people
  8
+  fixtures :posts, :readers, :people, :comments
8 9
 
9 10
   def test_associate_existing
10 11
     assert_queries(2) { posts(:thinking);people(:david) }
11  
-    
  12
+
  13
+    posts(:thinking).people
  14
+
12 15
     assert_queries(1) do
13  
-       posts(:thinking).people << people(:david)
  16
+      posts(:thinking).people << people(:david)
14 17
     end
15 18
     
16 19
     assert_queries(1) do
0  activerecord/test/cases/associations/has_one_associations_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/associations_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/attribute_methods_test.rb 100755 → 100644
File mode changed
8  activerecord/test/cases/base_test.rb 100755 → 100644
@@ -904,6 +904,14 @@ def test_customized_primary_key_remains_protected_when_referred_to_as_id
904 904
     assert_nil keyboard.id
905 905
   end
906 906
 
  907
+  def test_mass_assigning_invalid_attribute
  908
+    firm = Firm.new
  909
+
  910
+    assert_raises(ActiveRecord::UnknownAttributeError) do
  911
+      firm.attributes = { "id" => 5, "type" => "Client", "i_dont_even_exist" => 20 }
  912
+    end
  913
+  end
  914
+
907 915
   def test_mass_assignment_protection_on_defaults
908 916
     firm = Firm.new
909 917
     firm.attributes = { "id" => 5, "type" => "Client" }
0  activerecord/test/cases/deprecated_finder_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/fixtures_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/inheritance_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/lifecycle_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/readonly_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/unconnected_test.rb 100755 → 100644
File mode changed
0  activerecord/test/cases/validations_test.rb 100755 → 100644
File mode changed
0  activerecord/test/models/company.rb 100755 → 100644
File mode changed
0  activerecord/test/models/reply.rb 100755 → 100644
File mode changed
0  activerecord/test/models/topic.rb 100755 → 100644
File mode changed
0  ...plugin/templates/Rakefile b/railties/lib/rails_generator/generators/components/plugin/templates/Rakefile 100755 → 100644
File mode changed
2  railties/CHANGELOG
... ...
@@ -1,5 +1,7 @@
1 1
 *Edge*
2 2
 
  3
+* Turn cache_classes on by default [Josh Peek]
  4
+
3 5
 * Added configurable eager load paths. Defaults to app/models, app/controllers, and app/helpers [Josh Peek]
4 6
 
5 7
 * Introduce simple internationalization support.  [Ruby i18n team]
0  railties/bin/about 100644 → 100755
File mode changed
0  railties/bin/console 100644 → 100755
File mode changed
0  railties/bin/destroy 100644 → 100755
File mode changed
0  railties/bin/generate 100644 → 100755
File mode changed
0  railties/bin/performance/benchmarker 100644 → 100755
File mode changed
0  railties/bin/performance/profiler 100644 → 100755
File mode changed
0  railties/bin/performance/request 100644 → 100755
File mode changed
0  railties/bin/plugin 100644 → 100755
File mode changed
0  railties/bin/process/inspector 100644 → 100755
File mode changed
0  railties/bin/process/reaper 100644 → 100755
File mode changed
0  railties/bin/process/spawner 100644 → 100755
File mode changed
0  railties/bin/runner 100644 → 100755
File mode changed
0  railties/bin/server 100644 → 100755
File mode changed
0  railties/configs/apache.conf 100755 → 100644
File mode changed
2  railties/dispatches/dispatch.fcgi
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/local/bin/ruby
  1
+#!/usr/bin/env ruby
2 2
 #
3 3
 # You may specify the path to the FastCGI crash log (a log of unhandled
4 4
 # exceptions which forced the FastCGI instance to exit, great for debugging)
4  railties/dispatches/dispatch.rb
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/local/bin/ruby
  1
+#!/usr/bin/env ruby
2 2
 
3 3
 require File.dirname(__FILE__) + "/../config/environment" unless defined?(RAILS_ROOT)
4 4
 
@@ -7,4 +7,4 @@
7 7
 require "dispatcher"
8 8
 
9 9
 ADDITIONAL_LOAD_PATHS.reverse.each { |dir| $:.unshift(dir) if File.directory?(dir) } if defined?(Apache::RubyRun)
10  
-Dispatcher.dispatch
  10
+Dispatcher.dispatch
4  railties/dispatches/gateway.cgi 100644 → 100755
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/local/bin/ruby
  1
+#!/usr/bin/env ruby
2 2
 
3 3
 require 'drb'
4 4
 
@@ -94,4 +94,4 @@ end
94 94
 
95 95
 $stdout.write output
96 96
 $stdout.flush
97  
-$stdout.close
  97
+$stdout.close
2  railties/lib/commands/dbconsole.rb
@@ -41,6 +41,8 @@ def find_cmd(*commands)
41 41
 
42 42
   if config['password'] && include_password
43 43
     args << "--password=#{config['password']}"
  44
+  elsif config['password'] && !config['password'].empty?
  45
+    args << "-p"
44 46
   end
45 47
 
46 48
   args << config['database']
4  railties/lib/commands/ncgi/listener 100644 → 100755
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/local/bin/ruby
  1
+#!/usr/bin/env ruby
2 2
 
3 3
 require 'stringio'
4 4
 require 'fileutils'
@@ -83,4 +83,4 @@ end
83 83
 socket_path = ARGV.shift
84 84
 timeout = (ARGV.shift || 90).to_i
85 85
 
86  
-Listener.new(timeout, socket_path)
  86
+Listener.new(timeout, socket_path)
4  railties/lib/commands/ncgi/tracker 100644 → 100755
... ...
@@ -1,4 +1,4 @@
1  
-#!/usr/local/bin/ruby
  1
+#!/usr/bin/env ruby
2 2
 
3 3
 require 'drb'
4 4
 require 'thread'
@@ -66,4 +66,4 @@ end
66 66
 socket_path = ARGV.shift
67 67
 instances = ARGV.shift.to_i
68 68
 t = Tracker.new(instances, socket_path)
69  
-t.background(ARGV.first ? ARGV.shift.to_i : 90)
  69
+t.background(ARGV.first ? ARGV.shift.to_i : 90)
2  railties/lib/initializer.rb
@@ -904,7 +904,7 @@ def default_dependency_loading
904 904
       end
905 905
 
906 906
       def default_cache_classes
907  
-        false
  907
+        true
908 908
       end
909 909
 
910 910
       def default_whiny_nils

0 notes on commit 46a4582

Please sign in to comment.
Something went wrong with that request. Please try again.