aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Document lazy lookup behavior for controllersCarlos Ramirez III2015-02-031-0/+19
| | | | | | | | Pull request #7082 added lazy lookup to controllers using the translate method, but the documentation still stated that it was available for views only. [ci skip]
* Don't remove all line endings from routes.rbAndrew White2015-02-033-2/+26
| | | | | | | | | | | | When there is a single scaffold in the routes.rb with no other lines then revoking/destroying it will create a routes.rb file with a syntax error. This is because the sentinel for the Thor `route` action didn't include the newline but the logged route code did. The fix is to add the newline to the sentinel and remove it from the the logged route code. Fixes #15913.
* rm `Column#cast_type`Sean Griffin2015-02-0314-138/+185
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The type from the column is never used, except when being passed to the attributes API. While leaving the type on the column wasn't necessarily a bad thing, I worry that it's existence there implies that it is something which should be used. During the design and implementation process of the attributes API, there have been plenty of cases where getting the "right" type object was hard, but I had easy access to the column objects. For any contributor who isn't intimately familiar with the intents behind the type casting system, grabbing the type from the column might easily seem like the "correct" thing to do. As such, the goal of this change is to express that the column is not something that should be used for type casting. The only places that are "valid" (at the time of this commit) uses of acquiring a type object from the column are fixtures (as the YAML file is going to mirror the database more closely than the AR object), and looking up the type during schema detection to pass to the attributes API Many of the failing tests were removed, as they've been made obsolete over the last year. All of the PG column tests were testing nothing beyond polymorphism. The Mysql2 tests were duplicating the mysql tests, since they now share a column class. The implementation is a little hairy, and slightly verbose, but it felt preferable to going back to 20 constructor options for the columns. If you are git blaming to figure out wtf I was thinking with them, and have a better idea, go for it. Just don't use a type object for this.
* Correct errors in counter cache updatingSean Griffin2015-02-033-3/+14
| | | | | | | | | | | The cache name should be converted to a string when given, not compared as a symbol. This edge case is already adequately covered by our tests, but was masked by another issue where we were incorrectly updating the counter cache twice. When paired with a bug where we didn't update the counter cache because we couldn't find a match with the name, this made it look like everything was working fine. Fixes #10865.
* `RouteSet` should not be listed in the public API [ci skip]Sean Griffin2015-02-031-10/+10
| | | | | The use of `# :startdoc:` inside of the class was overriding the outer-most `# :nodoc:`, causing it to be listed in the documented API.
* Merge pull request #18801 from andreynering/fix-js-linkEileen M. Uchitelle2015-02-031-1/+1
|\ | | | | Fix link [ci skip]
| * Fix link [ci skip]Andrey Nering2015-02-031-1/+1
| |
* | Merge pull request #18800 from jtperreault/masterAbdelkader Boudih2015-02-031-1/+1
|\ \ | | | | | | Improve sentence flow in Debugging guide.
| * | [ci skip]James T. Perreault2015-02-031-1/+1
| |/ | | | | | | improve sentence flow with grammar change
* | Merge pull request #18758 from yuki24/change-travel-to-stub-datetime-tooRafael Mendonça França2015-02-033-0/+17
|\ \ | |/ |/| Change AS::Testing::TimeHelpers#travel_to to also stub DateTime.now
| * Change AS::Testing::TimeHelpers#travel_to to also stub DateTime.nowYuki Nishijima2015-02-033-0/+17
| |
* | Merge pull request #18795 from vipulnsward/remove-magic-commentsJeremy Kemper2015-02-0377-78/+0
|\ \ | |/ |/| Removed magic comments (`# encoding: utf-8`) from tests since it's default from ruby 2 onwards
| * Removed magic comments # encoding: utf-8 , since its default from ruby 2.0 ↵Vipul A M2015-02-0377-78/+0
| | | | | | | | onwards.
* | Merge pull request #18796 from 5minpause/masterCarlos Antonio da Silva2015-02-031-2/+2
|\ \ | | | | | | Small enhancement for generators
| * | Small enhancement for generatorsHolger Frohloff2015-02-031-2/+2
| | | | | | | | | | | | | | | Changes a call to #map and a subsequent call to #flatten to the more idiomatic version of #flat_map. This commit also removes an unnessecary return statement.
* | | Wrap method arguments with parentheses in docsCarlos Antonio da Silva2015-02-031-1/+1
|/ / | | | | | | As per Rails general coding conventions. Related to #18794 [ci skip]
* | Merge pull request #18794 from vipulnsward/fix-dirtyAbdelkader Boudih2015-02-031-1/+5
|\ \ | |/ |/| Fix AM#Dirty introduction example
| * Person class doesn't contain finder methods, hence usage of Person.find_by ↵Vipul A M2015-02-031-1/+5
|/ | | | | | | is wrong. Added simple initialize and made use of Person.new instead of Person.find_by to clarify the docs. [ci skip]
* Merge pull request #18791 from Sinjo/consistent-foreign-key-name-generationSean Griffin2015-02-023-3/+16
|\ | | | | Consistent foreign key name generation
| * Generate consistent names for foreign keysChris Sinjakli2015-02-033-3/+16
| |
* | Merge pull request #18789 from jafrog/masterSean Griffin2015-02-021-1/+2
|\ \ | | | | | | A typo fix and a small clarification on `autoload_paths`
| * | Fix a typo in autoloading doc and note on autoload_paths [ci skip]jafrog2015-02-021-1/+2
| | |
* | | Properly lookup the limit for bigintSean Griffin2015-02-022-1/+11
| |/ |/| | | | | Fixes #18787.
* | Rename `user_provided_types` to something more meaningfulSean Griffin2015-02-021-4/+4
| | | | | | | | | | | | | | `attributes_to_define_after_schema_loads` better describes the difference between `attribute` and `define_attribute`, and doesn't conflate terms since we no longer differentiate between "user provided" and "schema provided" types.
* | Remove unused `Column#with_type`Sean Griffin2015-02-021-6/+0
|/ | | | | Now that type casting has nothing to do with columns, our only usage of this method is gone.
* Merge pull request #18779 from jduff/fix_documentation_typoAbdelkader Boudih2015-02-021-1/+1
|\ | | | | Fix typo in Time#change docs
| * Fix typo in Time#change docsJohn Duff2015-02-021-1/+1
|/
* Merge pull request #18612 from ↵Aaron Patterson2015-02-019-5/+80
|\ | | | | | | | | eileencodes/fix-validates-on-associated-record-if-parent-is-validate-false Fix validations on child record when record parent has validate: false
| * Fix validations on child record when record parent has validate: falseeileencodes2015-02-019-5/+80
|/ | | | | | | | | | | | | | Fixes #17621. This 5 year old (or older) issue causes validations to fire when a parent record has `validate: false` option and a child record is saved. It's not the responsibility of the model to validate an associated object unless the object was created or modified by the parent. Clean up tests related to validations `assert_nothing_raised` is not benefiting us in these tests Corrected spelling of "respects" It's better to use `assert_not_operator` over `assert !r.valid`
* Cache `url_helpers` separately for mailersAndrew White2015-02-011-44/+50
| | | | | The commit 3b63780 re-introduced url helper caching but we need to cache a separate module for Action Mailer without paths.
* Merge pull request #18776 from eileencodes/cache-url-helpersAndrew White2015-02-011-42/+44
|\ | | | | Cache `url_helpers`
| * Cache `url_helpers`eileencodes2015-02-011-42/+44
| | | | | | | | | | | | `url_helpers` used to be memoized. This was lost in a refactoring and this PR adds it back. We noticed this while investigating why integration tests are slower than controller tests.
* | add destroyed records to the currend transactionAaron Patterson2015-02-012-1/+5
| |
* | Fix Issue #15549, unbounded memory growth when saving records that have any ↵Will Bryant2015-02-011-2/+3
| | | | | | | | after_create callbacks (or any associations, which makes after_create callbacks for you)
* | make the private methods privateAaron Patterson2015-02-011-2/+2
| |
* | push add to transaction logic down to the instanceAaron Patterson2015-02-013-6/+10
| | | | | | | | | | the transaction object shouldn't know so much about active record objects, so let's push the conditionals in to the instance.
* | remove conditional that is always trueAaron Patterson2015-02-011-3/+2
| |
* | stop making calls to add_recordAaron Patterson2015-02-011-1/+1
| |
* | Merge pull request #18770 from palkan/docs-hasone-dependentAbdelkader Boudih2015-02-011-0/+4
|\ \ | | | | | | Add note about has_one :through and :dependent
| * | [ci skip] add note about has_one :through and :dependentpalkan2015-02-011-0/+4
| | |
* | | Merge pull request #18756 from ajgrover/activejob_testsMatthew Draper2015-02-011-1/+1
|\ \ \ | |_|/ |/| | Update queue_classic gem to use latest
| * | Update queue_classic gem to use latestAlex Grover2015-01-311-1/+1
| | | | | | | | | | | | | | | | | | Remove '<3.0.0' requirement for queue_classic gem. This fixes the issue that the gem was attempting to parse the queue name as a URI, causing all of the tests to fail.
* | | Merge pull request #18721 from sj26/pre-discard-flashAaron Patterson2015-02-014-28/+51
|\ \ \ | | | | | | | | Pre-discard flash messages
| * | | Migrate old flash behaviourSamuel Cochran2015-01-302-6/+13
| | | |
| * | | Discard from flash before persisting in sessionSamuel Cochran2015-01-292-24/+26
| | | |
| * | | Fix flash remaining after last flash deletedSamuel Cochran2015-01-292-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Inside a controller functional test after the last flash is deleted it still persists the flash because to_session_value is nil. We should delete it from the session when the serialized version is nil, same as the flash middleware.
* | | | Merge pull request #18769 from gsamokovarov/exception-wrapper-windows-pathsAndrew White2015-02-012-2/+25
|\ \ \ \ | | | | | | | | | | Show proper traces on Windows for the error pages
| * | | | Show proper traces on Windows for the error pagesGenadi Samokovarov2015-02-012-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is an issue brought up by @daniel-rikowski in rails/web-console#91. Citing his PR proposal here: > Prior to this, backtrace lines were simply split by a single colon. > > Unfortunately that is also the drive letter delimiter in Windows paths > which resulted in a lot of empty source fragments of "C:0". ("C" from > the drive letter and 0 from "/path/to/rails/file.rb:16".to_i) > > Now the trace line is split by the first colon followed by some digits, > which works for both Windows and Unix path styles. Now, the PR was sent against web-console, because of the templates copy issue we used to had. Instead of bothering the contributor to reopen the issue against upstream Rails itself, I will make sure he gets the credit by putting his name in [rails-contributors/hard_coded_authors.rb][]. [rails-contributors/hard_coded_authors.rb]: (https://github.com/fxn/rails-contributors/blob/master/app/models/names_manager/hard_coded_authors.rb).
* | | | | Merge branch 'master' into mdluo-masterAaron Patterson2015-02-0129-45/+45
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master: Move required error message and changelog to Active Record Use public Module#include, in favor of https://bugs.ruby-lang.org/issues/8846 Use Module#include instead of send :include, since now is a public method [ci skip] :scissors: warning from controller renderer test Conflicts: activerecord/CHANGELOG.md
| * | | | | Move required error message and changelog to Active RecordCarlos Antonio da Silva2015-02-014-7/+7
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | The new association error belongs to Active Record, not Active Model. See #18700 for reference.