aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #17019 from yuki24/add-class-name-to-unknown-attr-errorYves Senn2014-10-201-2/+2
|\ | | | | | | Message on AR::UnknownAttributeError should include the class name of a record
| * AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* | AR::UnknownAttributeError should include the class name of a recordYuki Nishijima2014-10-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This would be helpful if 2 models have an attribute that has a similar name to the other. e.g: before: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute: name after: User.new(name: "Yuki Nishijima", projects_attributes: [name: "kaminari"]) # => ActiveRecord::UnknownAttributeError: unknown attribute on User: name
* | Fixed test throwing unused variable warningVipul A M2014-10-191-1/+1
| |
* | Merge pull request #17302 from ↵Rafael Mendonça França2014-10-181-3/+3
| | | | | | | | | | | | claudiob/replace-slower-block-call-with-faster-yield Replace (slower) block.call with (faster) yield
* | Revert "Replace (slower) block.call with (faster) yield"Zachary Scott2014-10-181-3/+3
| | | | | | | | This reverts commit 0ab075e75f58bf403f7ebe20546c7005f35db1f6.
* | Replace (slower) block.call with (faster) yieldclaudiob2014-10-181-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Performance optimization: `yield` with an implicit `block` is faster than `block.call`. See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark: ```ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('fast') { fast{} } x.report('slow') { slow{} } end # => fast 154095 i/100ms # => slow 71454 i/100ms # => # => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s # => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s ```
* | Add a deprecation warning for abiguous boolean valuesSean Griffin2014-10-161-4/+6
| | | | | | | | | | | | | | | | | | | | | | In Rails 5.0, we'd like to change the behavior of boolean columns in Rails to be closer to Ruby's semantics. Currently we have a small set of values which are "truthy", and all others are "falsy". In Rails 5.0, we will reverse this to have a small number of values which are "falsy", and all others will become "truthy". In the interim, all values which are ambiguous must emit a deprecation warning.
* | test, better describe `SerializationTypeMismatch` behavior. refs #14716.Yves Senn2014-10-161-2/+1
| |
* | pg, test assigning non-array values to an array column. Closes #14716.Yves Senn2014-10-161-0/+9
| | | | | | | | | | | | The behavior has changed since 4.1 and non-array values are no longer type casted to a blank array. This way the user can define custom validations on that property.
* | add table.bigint supportAaron Patterson2014-10-151-0/+19
|/ | | | | | | | In the DSL you can now do: create_table(:foos) do |t| t.bigint :hi end
* Raise an error for has_one associations which try to go :through a ↵Tu Hoang2014-10-152-0/+9
| | | | polymorphic association [#17263]
* :scissors: duplicated `require`sGodfrey Chan2014-10-141-1/+0
|
* make sure cache is not used for collection assocations tooAaron Patterson2014-10-142-1/+13
| | | | follow up for #17052
* break cache if we're inside a "scoping" call. fixes #17052Aaron Patterson2014-10-141-0/+10
| | | | | For now, we don't want to take "scoping" calls in to account when calculating cache keys for relations, so just opt-out.
* measure record instantiation time in AS::NotificationsAaron Patterson2014-10-131-0/+36
| | | | | emit an event when we instantiate AR objects so we can see how many records were instantiated and how long it took
* add length to ActiveRecord::ResultAaron Patterson2014-10-131-0/+4
|
* Merge pull request #17232 from Agis-/issue-17209Rafael Mendonça França2014-10-132-0/+18
|\ | | | | Autosave callbacks shouldn't be `after_save` callbacks
| * Autosave callbacks shouldn't be `after_save`Agis-2014-10-132-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | 068f092ced8483e557725542dd919ab7c516e567 registered autosave callbacks as `after_save` callbacks. This caused the regression described in #17209. Autosave callbacks should be registered as `after_update` and `after_create` callbacks, just like before. This is a partial revert of 068f092ced8483e557725542dd919ab7c516e567. Fixes #17209.
* | Replace Enumerable#reverse.each with Enumerable#reverse_eachErik Michaels-Ober2014-10-131-1/+1
|/
* Merge pull request #17014 from grosser/grosser/fast-fixturesAaron Patterson2014-10-102-32/+0
|\ | | | | speed up fixtures by not loading all their classes
| * speed up fixtures by not loading all their classesgrosser2014-10-062-32/+0
| |
* | ar/connection_pool: honor overriden rack.test in middlewareSimon Eskildsen2014-09-231-0/+8
| | | | | | | | | | | | | | Honoring an overidden `rack.test` allows testing closed connection between multiple requests. This is useful if you're working on database resiliency, to ensure the connection is in the expected state from one request to another on the same worker.
* | add a truncate method to the connectionAaron Patterson2014-09-222-0/+23
|/ | | | | | it doesn't work on SQLite3 since it doesn't support truncate, but that's OK. If you call truncate on the connection, you're now bound to that database (same as if you use hstore or any other db specific feature).
* Better regression test for Fixtures with fk as a symbolArthur Neves2014-09-222-11/+2
|
* fix fixtures not loading if a belongs_to association is defined with a ↵Will Bryant2014-09-221-0/+9
| | | | :foreign_key option that's a symbol
* Fix assertions in AR::TestCase::AttributeMethodsTestYuki Nishijima2014-09-211-3/+3
| | | | | This test has always been green because it uses "assert" and the first argument is an truthy class/object.
* Fix typo [ci skip]Yuki Nishijima2014-09-201-1/+1
|
* Fix find_by with associations not working with adequate recordGodfrey Chan2014-09-201-0/+5
| | | | | | | | | For now, we will just skip the cache when a non-column key is used in the hash. If the future, we can probably move some of the logic in PredicateBuilder.expand up the chain to make caching possible for association queries. Closes #16903 Fixes #16884
* Merge pull request #15791 from zev/add_model_to_recordnotfound_messageAaron Patterson2014-09-191-10/+18
|\ | | | | Update RecordNotFound exception cases to include a message with the
| * Update RecordNotFound exception cases to include a message with theZev Blut2014-06-181-10/+18
| | | | | | | | Model that the Record was not found in.
* | Merge pull request #16875 from alan/dont_autosave_has_one_through_recordRafael Mendonça França2014-09-171-0/+24
|\ \ | | | | | | | | | | | | | | | | | | Don't autosave unchanged has_one through records Conflicts: activerecord/CHANGELOG.md
| * | Don't autosave unchanged has_one through recordsAlan Kennedy2014-09-151-0/+24
| | |
* | | Allow YAML serialization when using TZ aware attributesSean Griffin2014-09-171-0/+8
| | |
* | | do not dump foreign keys for ignored tables.Yves Senn2014-09-171-0/+5
| | |
* | | pg, correctly dump foreign keys targeting tables in a different schema.Yves Senn2014-09-171-0/+26
|/ / | | | | | | | | | | Closes #16907. [Matthew Draper & Yves Senn]
* | Merge pull request #13656 from chanks/rollback_transactions_in_killed_threadsMatthew Draper2014-09-141-0/+31
|\ \ | | | | | | | | | Data corruption risk: Roll back open transactions when the running thread is killed.
| * | Roll back open transactions when the running thread is killed.Chris Hanks2014-08-221-0/+31
| | |
* | | pg, add test cases for updateable views.Yves Senn2014-09-111-0/+45
| | |
* | | reuse view test-cases for pg materialized view tests.Yves Senn2014-09-112-67/+36
| | |
* | | switch `assert_operator` arguments as discussed in #16860.Yves Senn2014-09-111-1/+1
| | | | | | | | | | | | Working with two different machines is hard :sweat:
* | | A `NullRelation` should represent nothing. Closes #15176.Yves Senn2014-09-112-0/+9
| | | | | | | | | | | | | | | | | | [Matthew Draper & Yves Senn] Closes #16860. (pull request to discuss the implementation)
* | | Merge pull request #16839 from chancancode/default_test_orderRafael Mendonça França2014-09-101-1/+1
|\ \ \ | | | | | | | | | | | | Default to sorting user's test cases for now
| * | | Default to sorting user's test cases for nowGodfrey Chan2014-09-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Goals: 1. Default to :random for newly generated applications 2. Default to :sorted for existing applications with a warning 3. Only show the warning once 4. Only show the warning if the app actually uses AS::TestCase Fixes #16769
* | | | Speed up schema dumper testsJeremy Kemper2014-09-101-11/+9
| | | | | | | | | | | | | | | | Dump the standard schema once instead of redoing it per test
* | | | Include default column limits in schema.rbJeremy Kemper2014-09-101-4/+10
| | | | | | | | | | | | | | | | | | | | | | | | Allows :limit defaults to be changed without pulling the rug out from under old migrations that omitted :limit because it matched the default at the time.
* | | | MySQL: schema.rb now includes TEXT and BLOB column limits.Jeremy Kemper2014-09-101-4/+4
| | | |
* | | | MySQL: correct LONGTEXT and LONGBLOB limits from 2GB to their true 4GBJeremy Kemper2014-09-101-2/+2
| | | |
* | | | Replace drop sql statement to drop_table methodYasuo Honda2014-09-113-5/+5
| | | | | | | | | | | | | | | | to drop sequences at the same time each tables dropped for Oracle
* | | | Oracle does not support `IF EXISTS` for `DROP VIEW`.Yves Senn2014-09-091-2/+2
| | | | | | | | | | | | | | | | /cc @yahonda