aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #14248 from vipulnsward/fix-pg-ar-warningsYves Senn2014-03-022-2/+2
|\ | | | | Fix PG warnings.
| * Fix warnings due to:Vipul A M2014-03-032-2/+2
|/ | | | | - unused variable in PG Adapter. - Ambiguous argument warning from range_test for use - to + Infinity range without brackets.
* Merge pull request #14234 from arthurnn/fix_trans_on_replaceSantiago Pastorino2014-03-012-1/+13
|\ | | | | Remove unnecessary db call when replacing.
| * Remove unnecessary db call when replacing.Arthur Neves2014-02-282-1/+13
| | | | | | | | | | | | | | When replacing a has_many association with the same one, there is no need to do a round-trip to the db to create/and drop a new transaction. [fixes #14220]
* | Merge pull request #14240 from sferik/flat_mapJosé Valim2014-03-012-5/+5
|\ \ | | | | | | Replace map.flatten(1) with flat_map
| * | Replace map.flatten(1) with flat_mapErik Michaels-Ober2014-02-282-5/+5
|/ /
* | make sure we wait for the threads to shut down before asserting closureAaron Patterson2014-02-281-0/+1
| |
* | Merge pull request #14195 from robin850/issue-14079Guillermo Iguaran2014-02-283-2/+23
|\ \ | | | | | | Avoid namespacing routes inside engines
| * | Avoid namespacing routes inside enginesRobin Dupret2014-02-263-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since #11544, invoking the controller generator, any generated route is namespaced according to the class_path method. Since a mountable plugin is namespaced, creating a controller inside would generate a namespaced route based on the engine's name. The controller generator now relies on regular_class_path which does not contain the class hierarchy but the given path. Fixes #14079.
* | | use built-in exception handling in live controllersAaron Patterson2014-02-282-17/+22
| | | | | | | | | | | | | | | | | | when an exception happens in an action before the response has been committed, then we should re-raise the exception in the main thread. This lets us reuse the existing exception handling.
* | | live controllers should have live responsesAaron Patterson2014-02-283-21/+38
| |/ |/| | | | | | | | | detect the type of controller we're testing and return the right type of response based on that controller. This allows us to stop doing the weird sleep thing.
* | Merge pull request #14233 from kuldeepaggarwal/fix-secrets-docGuillermo Iguaran2014-02-282-4/+11
|\ \ | | | | | | use `secrets.secret_key_base` instead of `config.secret_key_base`
| * | [ci skip] use secrets.secret_key_base instead of config.secret_key_baseKuldeep Aggarwal2014-03-012-4/+11
| | | | | | | | | | | | use secrets.yml instead of secret_token.rb
* | | set the error callback to a nice default in case nobody set an error ↵Aaron Patterson2014-02-282-1/+8
| | | | | | | | | | | | callback and an error happens
* | | Merge pull request #14230 from kuldeepaggarwal/doc-selectRobin Dupret2014-02-281-4/+4
|\ \ \ | |/ / |/| | Correct `select` examples and doc, ref [522c0fd] [ci skip]
| * | [ci skip] correct select examples and doc, ref [522c0fd]Kuldeep Aggarwal2014-03-011-4/+4
| | |
* | | Improve a bit the 4.1 release notes [ci skip]Robin Dupret2014-02-281-4/+6
| | | | | | | | | | | | | | | Fix a few typos. #present_in has been changed to #presence_in through commit d61baee5.
* | | Merge pull request #14226 from senny/14109_partial_revertAaron Patterson2014-02-283-1/+26
|\ \ \ | | | | | | | | `includes` uses SQL parsing when String joins are involved.
| * | | `includes` uses SQL parsing when String joins are involved.Yves Senn2014-02-283-1/+26
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a partial revert of 22b3481ba2aa55fad1f9a5db94072312b345fb55. The current implementation of `references_eager_loaded_tables?` needs to know every table involved in the query. With the current API this is not possible without SQL parsing. While a2dab46cae35a06fd5c5500037177492a047c252 deprecated SQL parsing for `includes`. It did not issue deprecation warnings when String joins are involved. This resulted in a breaking change after the deprecated behavior was removed (22b3481ba2aa55fad1f9a5db94072312b345fb55). We will need to rethink the usage of `includes`, `preload` and `eager_load` but for now, this brings back the old *working* behavior.
* | | Merge pull request #14231 from brianstorti/bs-docs-secret-tokenGuillermo Iguaran2014-02-281-3/+18
|\ \ \ | |/ / |/| | Use secrets.yml instead of secret_token.rb in the docs
| * | [ci skip] use secrets.yml instead of secret_token.rb in the action ↵Brian Thomas Storti2014-02-271-3/+18
|/ / | | | | | | controller guide
* | Merge pull request #14203 from Alwahsh/aabouelhamayedGodfrey Chan2014-02-273-0/+42
|\ \ | | | | | | Fix a bug affecting validations of enum attributes
| * | Fix a bug affecting validations of enum attributesTheMonster2014-02-273-0/+42
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where any enum attribute of a model would be evaluated always as 0 when calling the database on validations. This fix converts the value of the enum attribute to its integer value rather than the string before building the relation as the bug occured when the string finally gets converted to integer using string.to_i which converts it to 0. [Vilius Luneckas, Ahmed AbouElhamayed]
* | Merge pull request #14174 from kuldeepaggarwal/fix-resource_generator_testYves Senn2014-02-273-5/+5
|\ \ | | | | | | fix test cases
| * | modify model generator warning message. refs [#174c9f0]Kuldeep Aggarwal2014-02-273-5/+5
| | |
* | | Replace "data store" with database [ci skip]Robin Dupret2014-02-271-1/+1
| | | | | | | | | | | | Active Record is specifically for databases. Refs #12101.
* | | Merge pull request #11481 from sorentwo/fetch-multi-hashGuillermo Iguaran2014-02-273-14/+19
|\ \ \ | | | | | | | | Cache#fetch_multi returns a Hash instead of an Array
| * | | Return a hash rather than array from fetch_multiParker Selbert2014-02-263-14/+19
|/ / / | | | | | | | | | | | | | | | | | | The current implementation of `fetch_multi` returns an array and has no means to easily backtrack which names yielded which results. By changing the return value to a Hash we retain the name information. Hash#values can be used on the response if only the values are needed.
* | | Merge pull request #14216 from garethson/routes-docs-typoArthur Nogueira Neves2014-02-261-18/+18
|\ \ \ | | | | | | | | [skip ci] Fixes docs typo in nested resource path helpers
| * | | Fixes docs typo in nested resource path helpers [skip ci]Gareth du Plooy2014-02-261-18/+18
| | | |
* | | | Fix concerning module reference [ci skip]Carlos Antonio da Silva2014-02-261-1/+1
| | | |
* | | | Fix some validators when used on model instanceEric Hutzelman2014-02-263-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that Validator #setup is called from the initializer, we need a reference to the model's class to be passed in to allow the validators to continue functioning when used at the instance level. Closes #14134.
* | | | Pass strings to demodulize methodCarlos Antonio da Silva2014-02-261-1/+1
|/ / / | | | | | | | | | | | | Goes along with fea1cdcff4d50d302d8e8532432c3ab107ff816d and 59ec4562a2e70df455b2e44a67c340fa5254e26e.
* | | Merge pull request #14105 from twooster/fix-controller-testsAaron Patterson2014-02-264-1/+29
|\ \ \ | | | | | | | | Fix controller test not resetting @_url_options
| * | | Fix controller test not resetting @_url_optionsTony Wooster2014-02-264-1/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 4f2cd3e9 introduced a bug by reordering the call to `@controller.recycle!` above the call to `build_request_uri`. The impact of this was that the `@_url_options` cache ends up not being reset between building a request URI (occurring within the test controller) and the firing of the actual request. We encountered this bug because we had the following setup: class MinimumReproducibleController < ActionController::Base before_filter { @param = 'param' } def index render text: url_for(params) end def default_url_options { custom_opt: @param } end end def test_index get :index # builds url, then fires actual request end The first step in `get :index` in the test suite would populate the @_url_options cache. The subsequent call to `url_for` inside of the controller action would then utilize the uncleared cache, thus never calling the now-updated default_url_options. This commit fixes this bug calling recycle! twice, and removes a call to set response_body, which should no longer be needed since we're recycling the request object explicitly.
* | | | pass strings to the underscore methodAaron Patterson2014-02-262-3/+3
| | | |
* | | | speed up `underscore` in cases that don't need to do anythingAaron Patterson2014-02-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Benchmark: Benchmark.ips do |x| x.report("home") { "home".underscore } x.report("Home") { "Home".underscore } x.report("homeBase") { "homeBase".underscore } x.report("home::base") { "home::base".underscore } end Before: Calculating ------------------------------------- home 2598 i/100ms Home 2463 i/100ms homeBase 2300 i/100ms home::base 2086 i/100ms ------------------------------------------------- home 28522.3 (±14.7%) i/s - 140292 in 5.065102s Home 29165.8 (±14.9%) i/s - 140391 in 5.000475s homeBase 26218.5 (±7.1%) i/s - 131100 in 5.030485s home::base 27712.3 (±5.9%) i/s - 139762 in 5.064077s After: Calculating ------------------------------------- home 23163 i/100ms Home 2432 i/100ms homeBase 2160 i/100ms home::base 2265 i/100ms ------------------------------------------------- home 1501614.8 (±10.2%) i/s - 7412160 in 5.009540s Home 28754.0 (±8.5%) i/s - 143488 in 5.033886s homeBase 25331.1 (±5.6%) i/s - 127440 in 5.047940s home::base 27089.9 (±5.5%) i/s - 135900 in 5.033516s
* | | | pass the class name to `tableize`Aaron Patterson2014-02-261-1/+1
| | | | | | | | | | | | | | | | We should not rely on to_s to return the name of the class
* | | | Merge pull request #14215 from robertomiranda/docs-rake-notesGuillermo Iguaran2014-02-261-1/+1
|\ \ \ \ | |/ / / |/| | | [ci skip] Update list of files extensions in rake notes guide
| * | | [ci skip] Update list of files extensions in rake notes guiderobertomiranda2014-02-261-1/+1
|/ / /
* | | Merge pull request #14211 from loganhasson/masterXavier Noria2014-02-261-12/+12
|\ \ \ | | | | | | | | [ci skip] Move association class method notes
| * | | [ci skip] Move association class method notesLogan Hasson2014-02-261-12/+12
| | | | | | | | | | | | | | | | Make explanation of association class methods clearer by moving notes to beginning of each example section.
* | | | extract common code in `uuid_test.rb`.Yves Senn2014-02-261-60/+57
| | | |
* | | | move PostgreSQL UUID tests from `datatype_test.rb` to `uuid_test.rb`.Yves Senn2014-02-262-16/+36
| | | |
* | | | Merge pull request #14208 from lukesteensen/remove-migration-exampleXavier Noria2014-02-261-153/+0
|\ \ \ \ | | | | | | | | | | [ci skip] remove guide section on models in migrations [ci skip]
| * | | | [ci skip] remove guide section on models in migrationsLuke Steensen2014-02-261-153/+0
|/ / / / | | | | | | | | | | | | | | | | | | | | Both examples given are incorrect, and no one can seem to come up with a realistic situation where this is an actual problem. For now, it seems like the best thing to do is just scrap the section altogether.
* | | | test case for custom PostgreSQL enum type.Yves Senn2014-02-261-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This test currently outputs the following warning: ``` unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" ORDER BY "postgresql_enums"."id" ASC LIMIT 1) unknown OID: current_mood(3567879) (SELECT "postgresql_enums".* FROM "postgresql_enums" WHERE "postgresql_enums"."id" = $1 LIMIT 1) ``` We have an open PR to deal with this issue. It will dynamically register the OID for enum columns. This test case is merely to exhibit the current behavior of PostgreSQL enum columns.
* | | | Merge pull request #14149 from tjschuck/bcrypt_gem_renameCarlos Antonio da Silva2014-02-264-7/+11
|\ \ \ \ | | | | | | | | | | Bump version of bcrypt gem
| * | | | Bump version of bcrypt gemT.J. Schuck2014-02-254-7/+11
| | |_|/ | |/| |
* | | | Remove inclusion of rubysl gem for rbx on generated GemfileCarlos Antonio da Silva2014-02-252-16/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From #14026: Specific rbx-2 to limit testing on Rubinius 2.x (since there will be other versions of Rubinius > 2.x soon). Also, as of Rubinius 2.2.5, it is no longer necessary to bundle the rubysl gem. This is what Rails master/4.1 supports, so we don't need to add rubysl to gemfiles anymore.