aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | Refactor Duration#inspectDavid Chelimsky2013-08-121-7/+7
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In preparing https://github.com/rails/rails/pull/11855, it took me a minute to understand what was going on due to naming (parts refers first to an attr_accessor, then to a local, and is then reassigned), but also because the iterator conditionally builds nulls and then removes them. I refactored to something much more functional-looking that I find easier to read, but you may or may not. If you do, great! Enjoy! If not, oh well, I tried. Can't win 'em all :) Rationale: * no name conflict between local var and attr_accessor * no reassignment of local var * algorithm spelled out in steps * unused items in initial list filtered out early * empty-list case handled early instead of reassigning local var * no duplication of formatting strings ("0 seconds") Benchmarks (after PR #11855 merged): 10000.times do 1.second.inspect end original #inspect 0.350000 0.000000 0.350000 ( 0.354709) 0.330000 0.000000 0.330000 ( 0.331885) 0.330000 0.000000 0.330000 ( 0.334441) refactored #inspect 0.340000 0.000000 0.340000 ( 0.340080) 0.340000 0.010000 0.350000 ( 0.345069) 0.330000 0.000000 0.330000 ( 0.335873) 10000.times do (1.day + 1.month + 2.minutes + 1.day).inspect end original #inspect 0.400000 0.000000 0.400000 ( 0.403027) 0.400000 0.000000 0.400000 ( 0.403781) 0.390000 0.000000 0.390000 ( 0.387596) refactored #inspect 0.400000 0.010000 0.410000 ( 0.399792) 0.400000 0.000000 0.400000 ( 0.404145) 0.400000 0.000000 0.400000 ( 0.403820)
* | | | | | | | | Merge pull request #11855 from dchelimsky/chop-is-fasterRafael Mendonça França2013-08-121-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Use chop instead of singularize in Duration#inspect
| * | | | | | | | | Use chop instead of singularize in Duration#inspectDavid Chelimsky2013-08-121-1/+1
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though singularize tells a better story, chop is more than 50% faster and is all that is necessary in the case of Duration#inspect, in which all of the candidates for chopping appear in the same method and are all singularized by removing the final 's'. Benchmarks: 10000.times do 1.second.inspect end original #inspect 0.740000 0.000000 0.740000 ( 0.739065) 0.740000 0.000000 0.740000 ( 0.741458) 0.740000 0.010000 0.750000 ( 0.744011) refactored #inspect 0.330000 0.000000 0.330000 ( 0.333390) 0.330000 0.000000 0.330000 ( 0.331013) 0.320000 0.000000 0.320000 ( 0.330103) 10000.times do (1.day + 1.month + 2.minutes + 1.day).inspect end original #inspect 0.790000 0.000000 0.790000 ( 0.794624) 0.770000 0.000000 0.770000 ( 0.774577) 0.770000 0.010000 0.780000 ( 0.771295) refactored #inspect 0.390000 0.000000 0.390000 ( 0.392921) 0.400000 0.000000 0.400000 ( 0.397412) 0.370000 0.000000 0.370000 ( 0.379660)
* | | | | | | | | Merge pull request #11823 from fomede/add-jquery-ujs-reference-linkSteve Klabnik2013-08-121-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Add events reference link to the text about jquery-ujs [ci skip]
| * | | | | | | | | Add events reference link to the text about jquery-ujs [ci skip]Sadjow Leão2013-08-121-1/+1
| | | | | | | | | |
* | | | | | | | | | Merge pull request #11852 from prijutme4ty/guide_additionSteve Klabnik2013-08-121-0/+6
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Added comment to a guide about necessity of `:dependent` option for asso... [ci skip]
| * | | | | | | | | | Added comment to a guide about necessity of `:dependent` option for ↵Ilya Vorontsov2013-08-121-0/+6
| | |/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | associations with NOT NULL constraint
* | | | | | | | | | Merge pull request #11838 from vipulnsward/drop_extra_varSteve Klabnik2013-08-121-2/+2
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | drop extra variable
| * | | | | | | | | | drop extra variableVipul A M2013-08-121-2/+2
| | |/ / / / / / / / | |/| | | | | | | |
* | | | | | | | | | Use assert_not rather than refutePiotr Sarnacki2013-08-121-5/+5
| | | | | | | | | |
* | | | | | | | | | Merge pull request #11525 from Empact/nested_attributes_with_callbacks_bugPiotr Sarnacki2013-08-124-11/+172
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | Improve #5476 - "Nested attributes with callbacks bugfix" to use add_to_target and clearer tests
| * | | | | | | | | Refactor NestedAttributesWithCallbacksTest for clarityBen Woosley2013-08-121-67/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Use `assert` and `refute` where possible. 2) Separately include the setup, subject, and assertions in each test - don't hide the tested call in an assertion method. 3) Name things based on their role rather than incidental facts about them - e.g. `@bird[1]` -> `bird_to_destroy`. `bird2_deletion_attributes` -> `destroy_bird_attributes`. 4) Use more succinct naming where possible - e.g. `birds_with_callback` -> `birds_with_add`, `@pirate_with_two_birds` -> `@pirate`
| * | | | | | | | | Restore the use of `#add_to_target` for nested attribute updates on existing ↵Ben Woosley2013-08-123-15/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | records, and don't bother updating the association if the update is going to be rejected anyway. This requires adding a `skip_callbacks` argument to `#add_to_target` so that we don't call the callbacks multiple times in this case, which is functionally an application of existing association data, rather than an addition of a new record to the association.
| * | | | | | | | | Fix interactions between :before_add callbacks and nested attributes assignmentDr.(USA) Joerg Schray2013-08-123-11/+168
|/ / / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #1: :before_add callback is called when nested attributes assignment assigns to existing record if the association is not yet loaded Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association
* | | | | | | | | Merge pull request #11846 from gaurish/jdbc-upgradeGuillermo Iguaran2013-08-111-6/+7
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Upgrade ActiveRecord-JDBC-Adapter to v1.3 for better compatibility with ActiveRecord 4
| * | | | | | | | | Upgrade ActiveRecord-JDBC-Adapter to master branchGaurish Sharma2013-08-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to master branch which provides Version 1.3.x of AR-JDBC adapter. It strives to provide ActiveRecord 4.x compatibility (as well as still supporting 2.3 and 3.x) from a single code base. It's a recommended update for all AR-JDBC 1.2.x users.
* | | | | | | | | | chmod -xAkira Matsuda2013-08-124-0/+0
|/ / / / / / / / /
* | | | | | | | | only reconnect if there was already an active connectionAaron Patterson2013-08-111-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If you're using an in-memory database for the test database, reconnecting will lose all information that schema:load did for us.
* | | | | | | | | Merge pull request #11826 from etipton/enable_extensions_revertibleRafael Mendonça França2013-08-103-1/+16
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Make 'enable_extension' revertible
| * | | | | | | | | Make 'enable_extension' revertibleEric Tipton2013-08-103-1/+16
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If 'enable_extension' is used in a migration's 'change' method, use 'disable_extension' on down migration (and vice-versa).
* | | | | | | | | Merge pull request #11799 from njakobsen/fix-controller-filter-callbacksRafael Mendonça França2013-08-103-1/+17
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Execute conditional procs on controller filters only for current action
| * | | | | | | | | Execute conditional procs on controller filters only for current action.Nicholas Jakobsen2013-08-103-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | :only and :except options for controller filters are now added before :if and :unless. This prevents running :if and :unless procs when not on the specified. Closes #11786.
* | | | | | | | | | Merge pull request #11830 from cr0t/masterJosé Valim2013-08-101-0/+8
|\ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / |/| | | | | | | | | Fixed small mistake in the engines docs
| * | | | | | | | | Add author_name field to post_params to the engines docsSergey Kuznetsov2013-08-101-0/+8
|/ / / / / / / / /
* | | | | | | | | Merge pull request #11820 from vipulnsward/remove_s2bRafael Mendonça França2013-08-096-37/+4
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Remove redundant `string_to_binary` from type-casting
| * | | | | | | | | Remove redundant `string_to_binary` from type-castingVipul A M2013-08-096-37/+4
|/ / / / / / / / /
* | | | | | | | | Merge pull request #11815 from yaotti/patch-1Yves Senn2013-08-081-1/+1
|\ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ / |/| | | | | | | | Fix a broken link [ci skip]
| * | | | | | | | Fix a broken linkHiroshige Umino2013-08-091-1/+1
|/ / / / / / / /
* | | | | | | | Merge pull request #11806 from jetthoughts/change_model_term_by_simple_wordCarlos Antonio da Silva2013-08-081-1/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove using of suffix with term. [ci skip]
| * | | | | | | | Remove using of suffix with term. [ci skip]Paul Nikitochkin2013-08-081-1/+1
|/ / / / / / / /
* | | | | | | | Merge pull request #11802 from ko1/fix_field_encoding_for_mysqlAaron Patterson2013-08-074-3/+14
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Set field encoding to client_encoding for mysql adapter.
| * | | | | | | | Set field encoding to client_encoding for mysql adapter.Koichi Sasada2013-08-084-3/+14
| | | | | | | | |
* | | | | | | | | cast hstore values on write to be consistent with reading from the db.Yves Senn2013-08-084-4/+34
|/ / / / / / / /
* | | | | | | | Merge pull request #11331 from vipulnsward/remove_conditionalAaron Patterson2013-08-071-8/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove conditional, results are always an instance of `ActiveRecord::Result`
| * | | | | | | | Remove conditional, since results are always an instance of ↵Vipul A M2013-07-061-8/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ActiveRecord::Result`
* | | | | | | | | use `skip` so we can see what tests are not runAaron Patterson2013-08-081-6/+5
| |/ / / / / / / |/| | | | | | |
* | | | | | | | Fix multidimensional PG arrays containing non-string itemsYves Senn2013-08-073-15/+32
| | | | | | | |
* | | | | | | | Merge pull request #11789 from gaurish/multibyte_methodsSteve Klabnik2013-08-071-3/+4
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Avoid defining multibyte method names in JSON decoding test for JRuby Compatitibility
| * | | | | | | | Avoid defining multibyte method names in JSON decoding test for JRuby CompatGaurish Sharma2013-08-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change is similar to #11736 & in same way switched with fixed string & the index of the hash for method name. the index was added because otherwise, ruby will raise Error.
* | | | | | | | | Merge pull request #10045 from senny/document_relative_url_rootYves Senn2013-08-071-2/+39
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | document how to deploy to a subdirectory [ci skip]
| * | | | | | | | document how to deploy to a subdirectory. #2992 [ci skip]Yves Senn2013-08-071-2/+39
| | | | | | | | |
* | | | | | | | | skip `test_unicode_column_name` for `MysqlAdapter`.Yves Senn2013-08-071-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit fixes the build but we need to further investigate the root cause, to see if it can be fixed. The test fails under `MysqlAdapter` with: ``` ActiveRecord::UnknownAttributeError: unknown attribute: なまえ ``` The root cause is that the returned column names from the adapter have the wrong encoding: ```ruby columns = Weird.columns_hash.keys columns # => ["id", "a$b", "\xE3\x81\xAA\xE3\x81\xBE\xE3\x81\x88", "from"] columns.map(&:encoding) # => [#<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>, #<Encoding:ASCII-8BIT>] columns.map {|c| c.dup.force_encoding "utf-8"} # => ["id", "a$b", "なまえ", "from"] ``` From what I can tell the MySQL variables are fine: ``` ActiveRecord::Base.connection.execute("show variables") ... character_set_client utf8 character_set_connection utf8 character_set_database utf8 character_set_filesystem binary character_set_results utf8 character_set_server utf8 character_set_system utf8 character_sets_dir /usr/local/Cellar/mysql/5.5.29/share/mysql/charsets/ collation_connection utf8_general_ci collation_database utf8_unicode_ci collation_server utf8_general_ci ... ```
* | | | | | | | | RDoc tweaksXavier Noria2013-08-071-5/+10
| | | | | | | | |
* | | | | | | | | Merge pull request #11784 from davetoxa/patch-2Carlos Antonio da Silva2013-08-061-1/+1
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Bump ruby version [ci skip]
| * | | | | | | | | Bump ruby version [ci skip]Anton Cherepanov2013-08-071-1/+1
| | | | | | | | | |
* | | | | | | | | | Merge pull request #11783 from davetoxa/patch-1Carlos Antonio da Silva2013-08-061-3/+3
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | Bump ruby version [ci skip]
| * | | | | | | | | Bump ruby version [ci skip]Anton Cherepanov2013-08-071-3/+3
|/ / / / / / / / /
* | | | | | | | | test to express that we can't turn non-array columns to array columns.Yves Senn2013-08-061-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes #11062
* | | | | | | | | Merge pull request #11780 from thedarkone/logger-naked-rescue-fixGuillermo Iguaran2013-08-062-3/+7
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Rack::Logger naked rescue fix
| * | | | | | | | | "Naked" rescue clauses only catch StandardError subclasses.thedarkone2013-08-062-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to #11497.