aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* skip _select! call unless :select values are specifiedDave Gynn2015-07-261-1/+3
| | | | | the default scope will select all fields. removing this improves performance and reduces String creation.
* Merge pull request #21030 from yahonda/mysql2_20969Kasper Timm Hansen2015-07-261-2/+2
|\ | | | | Remove @connection instance variable only when defined
| * Remove @connection instance variable only when definedYasuo Honda2015-07-261-2/+2
|/
* Properly allow uniqueness validations on primary keys.Sean Griffin2015-07-253-1/+28
| | | | | | This is an alternate implementation of #20966. [Sean Griffin & presskey]
* Merge pull request #21007 from clayton-shopify/fix-mailto-encodingRafael Mendonça França2015-07-242-1/+9
|\ | | | | Encode the email address as prescribed in RFC 6068 section 2.
| * Encode the email address as prescribed in RFC 6068 section 2.Clayton Smith2015-07-232-1/+9
| |
* | `destroy` shouldn't raise when child associations fail to saveSean Griffin2015-07-244-1/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deep down in the association internals, we're calling `destroy!` rather than `destroy` when handling things like `dependent` or autosave association callbacks. Unfortunately, due to the structure of the code (e.g. it uses callbacks for everything), it's nearly impossible to pass whether to call `destroy` or `destroy!` down to where we actually need it. As such, we have to do some legwork to handle this. Since the callbacks are what actually raise the exception, we need to rescue it in `ActiveRecord::Callbacks`, rather than `ActiveRecord::Persistence` where it matters. (As an aside, if this code wasn't so callback heavy, it would handling this would likely be as simple as changing `destroy` to call `destroy!` instead of the other way around). Since we don't want to lose the exception when `destroy!` is called (in particular, we don't want the value of the `record` field to change to the parent class), we have to do some additional legwork to hold onto it where we can use it. Again, all of this is ugly and there is definitely a better way to do this. However, barring a much more significant re-architecting for what I consider to be a reletively minor improvement, I'm willing to take this small hit to the flow of this code (begrudgingly).
* | Merge pull request #20256 from ↵Sean Griffin2015-07-241-9/+0
|\ \ | | | | | | | | | | | | arunagw/aa-remove-unused-rule-and-task-activerecord Remove unused rule and task from activerecord
| * | Remove unused rule and task from activerecordArun Agrawal2015-05-221-9/+0
| | |
* | | Merge pull request #20928 from matthewd/unload-interlockMatthew Draper2015-07-245-35/+385
|\ \ \ | | | | | | | | We need stricter locking before we can unload
| * | | Small tweaks to mainly lock-ordering tests.thedarkone2015-07-221-21/+58
| | | | | | | | | | | | | | | | | | | | | | | | * only test the upgrade path, * add test to verify non upgrades can’t preempt, * add reentrancy assertion.
| * | | Handle thread death during lock acquisitionMatthew Draper2015-07-212-4/+27
| | | | | | | | | | | | | | | | | | | | | | | | Specifically, clean up if the thread is killed while it's blocked awaiting the lock... if we get killed on some other arbitrary line, the result remains quite undefined.
| * | | Adjust expectations around purpose/compatibility optionsMatthew Draper2015-07-212-9/+36
| | | |
| * | | Add some meta-assertions for the custom assertionsMatthew Draper2015-07-211-11/+63
| | | | | | | | | | | | | | | | | | | | | | | | I accidentally discovered `assert_threads_not_stuck` couldn't fail, so the simplest solution was to prove they're all now working in both directions.
| * | | Order of execution is only guaranteed if upgradingMatthew Draper2015-07-212-2/+4
| | | | | | | | | | | | | | | | | | | | If the thread isn't yet holding any form of lock, it has no claim over what may / may not run while it's blocked.
| * | | Fix ShareLock issues.thedarkone2015-07-201-2/+2
| | | |
| * | | Tests for AS::Concurrency::ShareLock.thedarkone2015-07-201-0/+194
| | | |
| * | | We need stricter locking before we can unloadMatthew Draper2015-07-204-34/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specifically, the "loose upgrades" behaviour that allows us to obtain an exclusive right to load things while other requests are in progress (but waiting on the exclusive lock for themselves) prevents us from treating load & unload interchangeably: new things appearing is fine, but they do *not* expect previously-present constants to vanish. We can still use loose upgrades for unloading -- once someone has decided to unload, they don't really care if someone else gets there first -- it just needs to be tracked separately.
* | | | Remove ivar only when definedAkira Matsuda2015-07-241-2/+2
| |_|/ |/| | | | | | | | this fixes a failing test case
* | | Improvements on the enum documentation [ci skip]Robin Dupret2015-07-231-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The note regarding the `_prefix` and `_suffix` options is no longer useful since they were renamed specifically for this purpose. Also the given example doesn't show what these options enable and in which case they are really useful (when there are conflicting values for instance). Refs #20999. [Godfrey Chan & Robin Dupret]
* | | Merge pull request #20999 from robin850/enum-prefix-suffixKasper Timm Hansen2015-07-233-15/+15
|\ \ \ | | | | | | | | Rename the enum_prefix and enum_suffix options to _prefix and _suffix
| * | | Rename the enum_{prefix,suffix} options to _{prefix,suffix}Robin Dupret2015-07-233-15/+15
|/ / / | | | | | | | | | | | | | | | This makes it more clear that they are reserved keywords and also it seems less redundant as the line already starts with the call to the `enum` method.
* | | Merge pull request #20993 from budnik/patch-1Robin Dupret2015-07-231-2/+2
|\ \ \ | | | | | | | | Fixes documentation typo.[ci skip]
| * | | Fixes documentation typo.Дмитро Будник2015-07-231-2/+2
|/ / / | | | | | | Documentation had extra colon after keyword.
* | | Merge pull request #20989 from matthewd/no-lock-basic-requireMatthew Draper2015-07-231-6/+4
|\ \ \ | | | | | | | | Don't apply locking around basic #load / #require
| * | | Don't apply locking around basic #load / #requireMatthew Draper2015-07-231-6/+4
| |/ / | | | | | | | | | | | | | | | That's outside our remit, and dangerous... if a caller has their own locking to protect against the natural race danger, we'll deadlock against it.
* | | rm `deep_munge`. You will live on in our hearts (and git history)Aaron Patterson2015-07-213-26/+15
| | | | | | | | | | | | | | | Now that we have encoding strategies, we can just walk the params hash once to encode as HWIA, and remove nils.
* | | push param encoding in to the utils moduleAaron Patterson2015-07-212-14/+30
| | | | | | | | | | | | we'll refactor deep munge mostly out of existence shortly
* | | stop keeping track of keys when "deep munging"Aaron Patterson2015-07-211-5/+3
| | | | | | | | | | | | This should have been done along with 8f8ccb9901cab457c6e1d52bdb25acf658fd5777
* | | recurse for arrays in `normalize_encode_params`Aaron Patterson2015-07-211-5/+3
| | | | | | | | | | | | | | | this just pushes the conditional in to the case / when so we can switch to method dispatch later
* | | drop conditionals in conversion logicAaron Patterson2015-07-211-7/+5
| | | | | | | | | | | | | | | | | | | | | there is no reason to `convert_hashes_to_parameters` with an assignemt flag. The caller knows whether or not it wants the value assigned. We should just change the uncommon case (not writing to the underlying hash) to just call the conversion method and return that value.
* | | rearrange logic to use positive branchesAaron Patterson2015-07-211-4/+6
| | | | | | | | | | | | | | | | | | only hashes are converted to parameter objects, so lets add a branch for them. This also removes a is_a? test for Parameters so we can be abstracted from the class.
* | | Merge pull request #20973 from vngrs/fix_rails_testsRafael Mendonça França2015-07-211-1/+1
|\ \ \ | | | | | | | | fix rails tests
| * | | fix rails testsMehmet Emin İNAÇ2015-07-211-1/+1
|/ / /
* | | Merge pull request #20967 from lxsameer/record_not_foundRafael Mendonça França2015-07-215-5/+35
|\ \ \ | | | | | | | | Extra caller details added to ActiveRecord::RecordNotFound
| * | | Extra caller details added to ActiveRecord::RecordNotFoundSameer Rahmani2015-07-215-5/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ActiveRecord::RecordNotFound modified to store model name, primary_key and id of the caller model. It allows the catcher of this exception to make a better decision to what to do with it. For example consider this simple example: class SomeAbstractController < ActionController::Base rescue_from ActiveRecord::RecordNotFound, with: :redirect_to_404 private def redirect_to_404(e) return redirect_to(posts_url) if e.model == 'Post' raise end end
* | | | Merge pull request #20926 from rsanheim/fail-fast-bin-setupRafael Mendonça França2015-07-211-5/+9
|\ \ \ \ | | | | | | | | | | add system! to fail fast in bin/setup
| * | | | add system! to fail fast in bin/setupRob Sanheim2015-07-181-5/+9
| | | | |
* | | | | Merge pull request #20819 from y-yagi/rails_api_gemfileRafael Mendonça França2015-07-212-1/+4
|\ \ \ \ \ | |_|/ / / |/| | | | remove `web-console` from API app generated Gemfile
| * | | | remove `web-console` from API app generated Gemfileyuuji.yaginuma2015-07-092-1/+4
| | | | |
* | | | | Merge pull request #20668 from ↵Rafael Mendonça França2015-07-216-4/+73
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | repinel/rename-restrict-dependent-destroy-i18n-key Deprecate the keys for association `restrict_dependent_destroy` errors in favor of new key names
| * | | | | Deprecate and rename the keys for association restrict_dependent_destroyRoque Pinel2015-07-206-4/+73
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `has_one` and `has_many` associations were using the `one` and `many` keys respectively. Both of these keys have special meaning in I18n (they are considered to be pluralizations) so by renaming them to `has_one` and `has_many` we make the messages more explicit and most importantly they don't clash with linguistical systems that need to validate translation keys (and their pluralizations). The `:'restrict_dependent_destroy.one'` key should be replaced with `:'restrict_dependent_destroy.has_one'`, and `:'restrict_dependent_destroy.many'` with `:'restrict_dependent_destroy.has_many'`. [Roque Pinel & Christopher Dell]
* | | | | Merge pull request #20732 from jorihardman/timestamp_precison2Sean Griffin2015-07-206-18/+62
|\ \ \ \ \ | | | | | | | | | | | | Ensure that microsecond precision is only used for versions of mysql that support it.
| * | | | | Ensure that microsecond precision is only used for version of mysql that ↵Jori Hardman2015-07-206-18/+62
| | | | | | | | | | | | | | | | | | | | | | | | support it. Fixes #19711
* | | | | | Merge pull request #20751 from repinel/remove-unnecessary-dupRafael Mendonça França2015-07-201-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Remove unnecessary `dup` from Mapper `add_route`
| * | | | | | Remove unnecessary `dup` from Mapper `add_route`Roque Pinel2015-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `dup` was introduced by c4106d0c08954b0761726e0015ec601b7bc7ea4b to work around a frozen key. Nowadays, the string is already being duplicated by the `tr` in `options[:action] ||= action.tr('-', '_')` and later joined into a new string in `name_for_action`.
* | | | | | | Merge pull request #17109 from thejamespinto/patch-1Rafael Mendonça França2015-07-201-1/+1
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | titleizing the New Link
| * | | | | | titleizing the New LinkThiago Pinto2015-07-201-1/+1
|/ / / / / /
* | | | | | Merge pull request #20956 from djpowers/patch-1Sean Griffin2015-07-201-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fix minor typo in testing guide [ci skip]
| * | | | | | Fix minor typo in testing guideDave Powers2015-07-201-1/+1
|/ / / / / / | | | | | | | | | | | | [ci skip]