Changeset 7666
- Timestamp:
- 09/28/07 14:18:47 (1 year ago)
- Files:
-
- trunk/actionmailer/install.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/base.rb (modified) (2 diffs)
- trunk/actionpack/lib/action_controller/caching.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/helpers.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/integration.rb (modified) (1 diff)
- trunk/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/capture_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/javascript_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/prototype_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/scriptaculous_helper.rb (modified) (1 diff)
- trunk/actionpack/lib/action_view/helpers/text_helper.rb (modified) (1 diff)
- trunk/actionpack/test/activerecord/active_record_store_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/caching_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/components_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/cookie_test.rb (modified) (2 diffs)
- trunk/actionpack/test/controller/routing_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/selector_test.rb (modified) (1 diff)
- trunk/actionpack/test/controller/test_test.rb (modified) (1 diff)
- trunk/actionpack/test/template/prototype_helper_test.rb (modified) (1 diff)
- trunk/actionwebservice/install.rb (modified) (1 diff)
- trunk/actionwebservice/setup.rb (modified) (1 diff)
- trunk/activerecord/install.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/associations.rb (modified) (2 diffs)
- trunk/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb (modified) (2 diffs)
- trunk/activerecord/lib/active_record/base.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb (modified) (3 diffs)
- trunk/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb (modified) (2 diffs)
- trunk/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb (modified) (1 diff)
- trunk/activerecord/lib/active_record/serializers/xml_serializer.rb (modified) (1 diff)
- trunk/activerecord/test/associations_test.rb (modified) (1 diff)
- trunk/activerecord/test/base_test.rb (modified) (1 diff)
- trunk/activerecord/test/migration_test.rb (modified) (2 diffs)
- trunk/activerecord/test/pk_test.rb (modified) (1 diff)
- trunk/activerecord/test/unconnected_test.rb (modified) (1 diff)
- trunk/activerecord/test/validations_test.rb (modified) (1 diff)
- trunk/activesupport/install.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/object/misc.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/string/unicode.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/core_ext/time/calculations.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/vendor/builder/xmlbase.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/vendor/xml_simple.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/date_ext_test.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/date_time_ext_test.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_ext_test.rb (modified) (1 diff)
- trunk/activesupport/test/multibyte_handler_test.rb (modified) (1 diff)
- trunk/railties/lib/commands/plugin.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/base.rb (modified) (1 diff)
- trunk/railties/lib/rails_generator/commands.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/actionmailer/install.rb
r2743 r7666 19 19 end 20 20 21 # the ac ual gruntwork21 # the actual gruntwork 22 22 Dir.chdir("lib") 23 23 trunk/actionpack/lib/action_controller/base.rb
r7596 r7666 578 578 # defaults. On it's own, this rule can account for much of the typical Rails URL behavior. 579 579 # Â 580 # Although a conv ienence, defaults can occasionaly get in your way. In some cases a default persists longer than desired.580 # Although a convenience, defaults can occasionally get in your way. In some cases a default persists longer than desired. 581 581 # The default may be cleared by adding <tt>:name => nil</tt> to <tt>url_for</tt>'s options. 582 582 # This is often required when writing form helpers, since the defaults in play may vary greatly depending upon where the … … 984 984 # When using <tt>redirect_to :back</tt>, if there is no referrer, 985 985 # RedirectBackError will be raised. You may specify some fallback 986 # behavior for this case by rescu eing RedirectBackError.986 # behavior for this case by rescuing RedirectBackError. 987 987 def redirect_to(options = {}) #:doc: 988 988 case options trunk/actionpack/lib/action_controller/caching.rb
r7598 r7666 292 292 293 293 def extract_extension(file_path) 294 # Don't want just what comes after the last '.' to accom odate multi part extensions294 # Don't want just what comes after the last '.' to accommodate multi part extensions 295 295 # such as tar.gz. 296 296 file_path[/^[^.]+\.(.+)$/, 1] trunk/actionpack/lib/action_controller/helpers.rb
r7644 r7666 103 103 # end 104 104 # 105 # Finally, all the above styles can be mixed together, and the +helper+ method can be invok ved with a mix of105 # Finally, all the above styles can be mixed together, and the +helper+ method can be invoked with a mix of 106 106 # +symbols+, +strings+, +modules+ and blocks. 107 107 # helper(:three, BlindHelper) { def mice() 'mice' end } trunk/actionpack/lib/action_controller/integration.rb
r7438 r7666 305 305 end 306 306 307 # Get a temporar ly URL writer object307 # Get a temporary URL writer object 308 308 def generic_url_rewriter 309 309 cgi = MockCGI.new('REQUEST_METHOD' => "GET", trunk/actionpack/lib/action_controller/vendor/html-scanner/html/selector.rb
r6057 r7666 795 795 # 796 796 # This method is called from four places, so it helps to put it here 797 # for re sue. The only logic deals with the need to detect comma797 # for reuse. The only logic deals with the need to detect comma 798 798 # separators (alternate) and apply them to the selector group of the 799 799 # top selector. trunk/actionpack/lib/action_view/helpers/capture_helper.rb
r7622 r7666 120 120 # The deprecated way of accessing a content_for block is to use an instance variable 121 121 # named <tt>@content_for_#{name_of_the_content_block}</tt>. So <tt><%= content_for :footer %></tt> 122 # would be avai able as <tt><%= @content_for_footer %></tt>. The preferred usage is now122 # would be available as <tt><%= @content_for_footer %></tt>. The preferred usage is now 123 123 # <tt><%= yield :footer %></tt>. 124 124 def content_for(name, content = nil, &block) trunk/actionpack/lib/action_view/helpers/javascript_helper.rb
r7567 r7666 141 141 end 142 142 143 # load other libra iries143 # load other libraries 144 144 (Dir.glob(File.join(JAVASCRIPT_PATH, '*')) - prototype_libs).each do |filename| 145 145 javascript << "\n" << IO.read(filename) trunk/actionpack/lib/action_view/helpers/prototype_helper.rb
r7596 r7666 512 512 # <tt>:bottom</tt>:: HTML is inserted inside the element, after the 513 513 # element's existing content. 514 # <tt>:before</tt>:: HTML is inserted immediately prece eding the element.514 # <tt>:before</tt>:: HTML is inserted immediately preceding the element. 515 515 # <tt>:after</tt>:: HTML is inserted immediately following the element. 516 516 # trunk/actionpack/lib/action_view/helpers/scriptaculous_helper.rb
r7396 r7666 31 31 # used for example with drop_receiving_element: 32 32 # 33 # <%= drop_rece ving_element (...), :loading => visual_effect(:fade) %>33 # <%= drop_receiving_element (...), :loading => visual_effect(:fade) %> 34 34 # 35 35 # This would fade the element that was dropped on the drop receiving trunk/actionpack/lib/action_view/helpers/text_helper.rb
r7595 r7666 83 83 84 84 # Extracts an excerpt from +text+ that matches the first instance of +phrase+. 85 # The +radius+ expands the excerpt on each side of the first occur ance of +phrase+ by the number of characters85 # The +radius+ expands the excerpt on each side of the first occurrence of +phrase+ by the number of characters 86 86 # defined in +radius+ (which defaults to 100). If the excerpt radius overflows the beginning or end of the +text+, 87 87 # then the +excerpt_string+ will be prepended/appended accordingly. If the +phrase+ trunk/actionpack/test/activerecord/active_record_store_test.rb
r6057 r7666 54 54 end 55 55 56 # this test only applies for eager sess sion saving56 # this test only applies for eager session saving 57 57 # def test_another_instance 58 58 # @another = CGI::Session.new(@cgi, 'session_id' => @new_session.session_id, 'database_manager' => CGI::Session::ActiveRecordStore) trunk/actionpack/test/controller/caching_test.rb
r7598 r7666 3 3 4 4 CACHE_DIR = 'test_cache' 5 # Don't change '/../temp/' cavalierly or you might ho ze something you don't want hozed5 # Don't change '/../temp/' cavalierly or you might hose something you don't want hosed 6 6 FILE_STORE_PATH = File.join(File.dirname(__FILE__), '/../temp/', CACHE_DIR) 7 7 ActionController::Base.page_cache_directory = FILE_STORE_PATH trunk/actionpack/test/controller/components_test.rb
r7403 r7666 128 128 end 129 129 130 def test_component_as_string_redirect_renders_redirecte _action130 def test_component_as_string_redirect_renders_redirected_action 131 131 get :calling_redirected_as_string 132 132 trunk/actionpack/test/controller/cookie_test.rb
r7535 r7666 7 7 end 8 8 9 def authenticate_for_fourte n_days9 def authenticate_for_fourteen_days 10 10 cookies["user_name"] = { "value" => "david", "expires" => Time.local(2005, 10, 10) } 11 11 end 12 12 13 def authenticate_for_fourte n_days_with_symbols13 def authenticate_for_fourteen_days_with_symbols 14 14 cookies[:user_name] = { :value => "david", :expires => Time.local(2005, 10, 10) } 15 15 end … … 56 56 57 57 def test_setting_cookie_for_fourteen_days 58 get :authenticate_for_fourte n_days58 get :authenticate_for_fourteen_days 59 59 assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], @response.headers["cookie"] 60 60 end 61 61 62 62 def test_setting_cookie_for_fourteen_days_with_symbols 63 get :authenticate_for_fourte n_days63 get :authenticate_for_fourteen_days 64 64 assert_equal [ CGI::Cookie::new("name" => "user_name", "value" => "david", "expires" => Time.local(2005, 10, 10)) ], @response.headers["cookie"] 65 65 end trunk/actionpack/test/controller/routing_test.rb
r7605 r7666 767 767 eval(segment.expiry_statement) 768 768 rescue RuntimeError 769 flunk "Expiry check should not have occur ed!"769 flunk "Expiry check should not have occurred!" 770 770 end 771 771 trunk/actionpack/test/controller/selector_test.rb
r6057 r7666 178 178 assert_equal "foo", @matches[0].attributes["href"] 179 179 assert_equal "baz", @matches[1].attributes["href"] 180 # And now for the three selector chall ange.180 # And now for the three selector challenge. 181 181 parse(%Q{<h1 id="1"><a href="foo"></a></h1><h2 id="2"><a href="bar"></a></h2><h3 id="2"><a href="baz"></a></h3>}) 182 182 select("h1 a, h2 a, h3 a") trunk/actionpack/test/controller/test_test.rb
r7478 r7666 226 226 process :test_html_output 227 227 228 # there is a tag prece eding a tag with id 'bar'228 # there is a tag preceding a tag with id 'bar' 229 229 assert_tag :before => { :attributes => { :id => "bar" } } 230 # there is no tag prece eding a 'form' tag230 # there is no tag preceding a 'form' tag 231 231 assert_no_tag :before => { :tag => "form" } 232 232 end trunk/actionpack/test/template/prototype_helper_test.rb
r7592 r7666 84 84 assert_dom_equal %(<a class=\"fine\" href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true}); return false;\">Remote outauthor</a>), 85 85 link_to_remote("Remote outauthor", { :url => { :action => "whatnot" }}, { :class => "fine" }) 86 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onComplete:function(request){alert(request.re ponseText)}}); return false;\">Remote outauthor</a>),87 link_to_remote("Remote outauthor", :complete => "alert(request.re ponseText)", :url => { :action => "whatnot" })88 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onSuccess:function(request){alert(request.re ponseText)}}); return false;\">Remote outauthor</a>),89 link_to_remote("Remote outauthor", :success => "alert(request.re ponseText)", :url => { :action => "whatnot" })90 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.re ponseText)}}); return false;\">Remote outauthor</a>),91 link_to_remote("Remote outauthor", :failure => "alert(request.re ponseText)", :url => { :action => "whatnot" })92 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot?a=10&b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.re ponseText)}}); return false;\">Remote outauthor</a>),93 link_to_remote("Remote outauthor", :failure => "alert(request.re ponseText)", :url => { :action => "whatnot", :a => '10', :b => '20' })86 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onComplete:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>), 87 link_to_remote("Remote outauthor", :complete => "alert(request.responseText)", :url => { :action => "whatnot" }) 88 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onSuccess:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>), 89 link_to_remote("Remote outauthor", :success => "alert(request.responseText)", :url => { :action => "whatnot" }) 90 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>), 91 link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot" }) 92 assert_dom_equal %(<a href=\"#\" onclick=\"new Ajax.Request('http://www.example.com/whatnot?a=10&b=20', {asynchronous:true, evalScripts:true, onFailure:function(request){alert(request.responseText)}}); return false;\">Remote outauthor</a>), 93 link_to_remote("Remote outauthor", :failure => "alert(request.responseText)", :url => { :action => "whatnot", :a => '10', :b => '20' }) 94 94 end 95 95 trunk/actionwebservice/install.rb
r2909 r7666 19 19 end 20 20 21 # the ac ual gruntwork21 # the actual gruntwork 22 22 Dir.chdir("lib") 23 23 trunk/actionwebservice/setup.rb
r3067 r7666 969 969 def print_usage(f) 970 970 super 971 f.puts 'In luded packages:'971 f.puts 'Included packages:' 972 972 f.puts ' ' + @packages.sort.join(' ') 973 973 f.puts trunk/activerecord/install.rb
r1053 r7666 19 19 end 20 20 21 # the ac ual gruntwork21 # the actual gruntwork 22 22 Dir.chdir("lib") 23 23 trunk/activerecord/lib/active_record/associations.rb
r7588 r7666 717 717 # Option examples: 718 718 # has_one :credit_card, :dependent => :destroy # destroys the associated credit card 719 # has_one :credit_card, :dependent => :nullify # updates the associated records for iegn key value to null rather than destroying it719 # has_one :credit_card, :dependent => :nullify # updates the associated records foreign key value to null rather than destroying it 720 720 # has_one :last_comment, :class_name => "Comment", :order => "posted_on" 721 721 # has_one :project_manager, :class_name => "Person", :conditions => "role = 'project_manager'" … … 858 858 # Deprecated: Any additional fields added to the join table will be placed as attributes when pulling records out through 859 859 # +has_and_belongs_to_many+ associations. Records returned from join tables with additional attributes will be marked as 860 # +ReadOnly+ (because we can't save changes to the additional attr butes). It's strongly recommended that you upgrade any860 # +ReadOnly+ (because we can't save changes to the additional attributes). It's strongly recommended that you upgrade any 861 861 # associations with attributes to a real join model (see introduction). 862 862 # trunk/activerecord/lib/active_record/associations/has_and_belongs_to_many_association.rb
r7511 r7666 66 66 options[:conditions] = conditions 67 67 options[:joins] = @join_sql 68 options[:readonly] = finding_with_ambig ious_select?(options[:select])68 options[:readonly] = finding_with_ambiguous_select?(options[:select]) 69 69 70 70 if options[:order] && @reflection.options[:order] … … 155 155 end 156 156 157 # Join tables with additional columns on top of the two foreign keys must be considered ambig ious unless a select157 # Join tables with additional columns on top of the two foreign keys must be considered ambiguous unless a select 158 158 # clause has been explicitly defined. Otherwise you can get broken records back, if, for example, the join column also has 159 159 # an id column. This will then overwrite the id column of the records coming back. 160 def finding_with_ambig ious_select?(select_clause)160 def finding_with_ambiguous_select?(select_clause) 161 161 !select_clause && @owner.connection.columns(@reflection.options[:join_table], "Join Table Columns").size != 2 162 162 end trunk/activerecord/lib/active_record/base.rb
r7561 r7666 151 151 # end 152 152 # 153 # You can alternatively use self[:attribute]=(value) and self[:attribute] instead of write_attribute(:attribute, va ule) and153 # You can alternatively use self[:attribute]=(value) and self[:attribute] instead of write_attribute(:attribute, value) and 154 154 # read_attribute(:attribute) as a shorter form. 155 155 # trunk/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
r7498 r7666 130 130 rescue Exception => e 131 131 # Log message and raise exception. 132 # Set last_ver fication to 0, so that connection gets verified132 # Set last_verification to 0, so that connection gets verified 133 133 # upon reentering the request loop 134 134 @last_verification = 0 trunk/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb
r7503 r7666 134 134 end 135 135 136 # Inserts the given fixture into the table. Overrid en in adapters that require136 # Inserts the given fixture into the table. Overridden in adapters that require 137 137 # something beyond a simple insert (eg. Oracle). 138 138 def insert_fixture(fixture, table_name) trunk/activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
r7356 r7666 143 143 # Sets a new default value for a column. If you want to set the default 144 144 # value to +NULL+, you are out of luck. You need to 145 # DatabaseStatements#execute the app propriate SQL statement yourself.145 # DatabaseStatements#execute the appropriate SQL statement yourself. 146 146 # ===== Examples 147 147 # change_column_default(:suppliers, :qualification, 'new') … … 238 238 execute "INSERT INTO #{ActiveRecord::Migrator.schema_info_table_name} (version) VALUES(0)" 239 239 rescue ActiveRecord::StatementInvalid 240 # Schema has been in tialized240 # Schema has been initialized 241 241 end 242 242 end … … 256 256 if native = native_database_types[type] 257 257 column_type_sql = native.is_a?(Hash) ? native[:name] : native 258 if type == :decimal # ignore limit, use precis on and scale258 if type == :decimal # ignore limit, use precision and scale 259 259 precision ||= native[:precision] 260 260 scale ||= native[:scale] trunk/activerecord/lib/active_record/connection_adapters/oracle_adapter.rb
r7498 r7666 261 261 262 262 263 # Inserts the given fixture into the table. Overrid en to properly handle lobs.263 # Inserts the given fixture into the table. Overridden to properly handle lobs. 264 264 def insert_fixture(fixture, table_name) 265 265 super trunk/activerecord/lib/active_record/connection_adapters/postgresql_adapter.rb
r7498 r7666 71 71 # Unescapes bytea output from a database to the binary string it represents. 72 72 def self.binary_to_string(value) 73 # In each case, check if the value actually is escaped Postgre sSQL bytea output73 # In each case, check if the value actually is escaped PostgreSQL bytea output 74 74 # or an unescaped Active Record attribute that was just written. 75 75 if PGconn.respond_to?(:unescape_bytea) … … 785 785 # If this is a money type column and there are any currency symbols, 786 786 # then strip them off. Indeed it would be prettier to do this in 787 # Postgre sSQLColumn.string_to_decimal but would break form input787 # PostgreSQLColumn.string_to_decimal but would break form input 788 788 # fields that call value_before_type_cast. 789 789 if res.type(cell_index) == MONEY_COLUMN_TYPE_OID trunk/activerecord/lib/active_record/connection_adapters/sybase_adapter.rb
r7498 r7666 1 # sybase_adapt or.rb1 # sybase_adapter.rb 2 2 # Author: John R. Sheets 3 3 # trunk/activerecord/lib/active_record/serializers/xml_serializer.rb
r7663 r7666 2 2 module Serialization 3 3 # Builds an XML document to represent the model. Some configuration is 4 # avail ble through +options+, however more complicated cases should use4 # available through +options+, however more complicated cases should use 5 5 # override ActiveRecord's to_xml. 6 6 # trunk/activerecord/test/associations_test.rb
r7588 r7666 1475 1475 end 1476 1476 1477 def test_ha tbm_attribute_access_and_respond_to1477 def test_habtm_attribute_access_and_respond_to 1478 1478 project = developers(:jamis).projects[0] 1479 1479 assert project.has_attribute?("name") trunk/activerecord/test/base_test.rb
r7500 r7666 801 801 end 802 802 803 def test_customized_primary_key_remains_protected_when_refer ed_to_as_id803 def test_customized_primary_key_remains_protected_when_referred_to_as_id 804 804 subscriber = Subscriber.new(:id => 'webster123', :name => 'nice try') 805 805 assert_nil subscriber.id trunk/activerecord/test/migration_test.rb
r7579 r7666 341 341 jonnyg.destroy 342 342 ensure 343 ActiveRecord::Migration.remove_column :people, :intellige ce_quotient rescue nil343 ActiveRecord::Migration.remove_column :people, :intelligence_quotient rescue nil 344 344 end 345 345 end … … 579 579 580 580 # This one is fun. The 'value_of_e' field is defined as 'DECIMAL' with 581 # precision/scale explic tly left out. By the SQL standard, numbers581 # precision/scale explicitly left out. By the SQL standard, numbers 582 582 # assigned to this field should be truncated but that's seldom respected. 583 583 if current_adapter?(:PostgreSQLAdapter, :SQLite2Adapter) trunk/activerecord/test/pk_test.rb
r6364 r7666 96 96 assert_nothing_raised { MixedCaseMonkey.find(1).save } 97 97 end 98 def test_instance_destr y_should_quote_pkey98 def test_instance_destroy_should_quote_pkey 99 99 assert_nothing_raised { MixedCaseMonkey.find(1).destroy } 100 100 end trunk/activerecord/test/unconnected_test.rb
r3674 r7666 4 4 end 5 5 6 class TestUnconnectedAdapt or < Test::Unit::TestCase6 class TestUnconnectedAdapter < Test::Unit::TestCase 7 7 self.use_transactional_fixtures = false 8 8 trunk/activerecord/test/validations_test.rb
r7511 r7666 662 662 end 663 663 664 def test_validates_length_with_global y_modified_error_message664 def test_validates_length_with_globally_modified_error_message 665 665 ActiveRecord::Errors.default_error_messages[:too_short] = 'tu est trops petit hombre %d' 666 666 Topic.validates_length_of :title, :minimum => 10 trunk/activesupport/install.rb
r1053 r7666 19 19 end 20 20 21 # the ac ual gruntwork21 # the actual gruntwork 22 22 Dir.chdir("lib") 23 23 trunk/activesupport/lib/active_support/core_ext/object/misc.rb
r7658 r7666 38 38 # end 39 39 # 40 # Can also be used with an explicit rec iever:40 # Can also be used with an explicit receiver: 41 41 # 42 42 # map.with_options :controller => "people" do |people| trunk/activesupport/lib/active_support/core_ext/string/unicode.rb
r5223 r7666 2 2 module CoreExtensions #:nodoc: 3 3 module String #:nodoc: 4 # Define methods for hand eling unicode data.4 # Define methods for handling unicode data. 5 5 module Unicode 6 6 # +chars+ is a Unicode safe proxy for string methods. It creates and returns an instance of the trunk/activesupport/lib/active_support/core_ext/time/calculations.rb
r7508 r7666 30 30 end 31 31 32 # Returns a new Time if requested year can be accom odated by Ruby's Time class32 # Returns a new Time if requested year can be accommodated by Ruby's Time class 33 33 # (i.e., if year is within either 1970..2038 or 1902..2038, depending on system architecture); 34 34 # otherwise returns a DateTime trunk/activesupport/lib/active_support/vendor/builder/xmlbase.rb
r7474 r7666 27 27 28 28 # Create a tag named +sym+. Other than the first argument which 29 # is the tag name, the argu ements are the same as the tags29 # is the tag name, the arguments are the same as the tags 30 30 # implemented via <tt>method_missing</tt>. 31 31 def tag!(sym, *args, &block) trunk/activesupport/lib/active_support/vendor/builder/xmlmarkup.rb
r5813 r7666 154 154 # xml_builder = Builder::XmlMarkup.new 155 155 # xml_builder.div { |xml| 156 # xml.st ong("text")156 # xml.strong("text") 157 157 # } 158 158 # trunk/activesupport/lib/active_support/vendor/xml_simple.rb
r6044 r7666 122 122 @@cache = Cache.new 123 123 124 # Creates and in tializes a new XmlSimple object.124 # Creates and initializes a new XmlSimple object. 125 125 # 126 126 # defaults:: trunk/activesupport/test/core_ext/date_ext_test.rb
r7262 r7666 37 37 end 38 38 39 def test_begin ing_of_week39 def test_beginning_of_week 40 40 assert_equal Date.new(2005,1,31), Date.new(2005,2,4).beginning_of_week 41 41 assert_equal Date.new(2005,11,28), Date.new(2005,11,28).beginning_of_week #monday trunk/activesupport/test/core_ext/date_time_ext_test.rb
r7647 r7666 47 47 end 48 48 49 def test_begin ing_of_week49 def test_beginning_of_week 50 50 assert_equal DateTime.civil(2005,1,31), DateTime.civil(2005,2,4,10,10,10).beginning_of_week 51 51 assert_equal DateTime.civil(2005,11,28), DateTime.civil(2005,11,28,0,0,0).beginning_of_week #monday trunk/activesupport/test/core_ext/time_ext_test.rb
r7647 r7666 50 50 end 51 51 52 def test_begin ing_of_week52 def test_beginning_of_week 53 53 assert_equal Time.local(2005,1,31), Time.local(2005,2,4,10,10,10).beginning_of_week 54 54 assert_equal Time.local(2005,11,28), Time.local(2005,11,28,0,0,0).beginning_of_week #monday trunk/activesupport/test/multibyte_handler_test.rb
r7272 r7666 16 16 # slicing it at some specific bytes will kill your characters if you use standard Ruby routines. 17 17 # It has both capital and standard letters, so that we can test case conversions easily. 18 # It has 26 characte s and 28 when the ligature gets split during normalization.18 # It has 26 characters and 28 when the ligature gets split during normalization. 19 19 @string = "Abcd Ðлå ï¬ Ð±Ð»Ð° бла бла бла" 20 20 @string_kd = "Abcd ÐлaÌ ffi бла бла бла бла" trunk/railties/lib/commands/plugin.rb
r7585 r7666 516 516 "List locally installed plugins.") {|@local| @remote = false} 517 517 o.on( "--remote", 518 "List remotely available dplugins. This is the default behavior",518 "List remotely available plugins. This is the default behavior", 519 519 "unless --local is provided.") {|@remote|} 520 520 end trunk/railties/lib/rails_generator/base.rb
r7183 r7666 41 41 # 42 42 # The filenames of the templates don't matter, but choose something that 43 # will be self-expla tatory since you will be referencing these in the43 # will be self-explanatory since you will be referencing these in the 44 44 # +manifest+ method inside your generator subclass. 45 45 # trunk/railties/lib/rails_generator/commands.rb
r6180 r7666 261 261 262 262 # Generate a file for a Rails application using an ERuby template. 263 # Looks up and evalu tes a template by name and writes the result.263 # Looks up and evaluates a template by name and writes the result. 264 264 # 265 265 # The ERB template uses explicit trim mode to best control the