aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Extract tests code out from AR's base_test.rb to integration_test.rbTakehiro Adachi2013-05-021-73/+0
| | | | | | `AR::Base#to_param` and `AR::Base#cache_key` is defined at active_record/integration.rb, so tests for those methods should be at integration_test.rb
* hides the per thread registry instance, and caches singleton methodsXavier Noria2013-04-131-2/+2
| | | | | | | | | | | | Existing code was delegating to the instance with delegate macro calls, or invoking the instance method to reach the object and call its instance methods. But the point is to have a clean class-level interface where the thread local instance is hidden in the implementation. References #11c6973. References #10198.
* Changed the ScopeRegistry and the InstrumentationRegistry to use thewangjohn2013-04-091-2/+2
| | | | PerThreadRegistry module.
* Grouping thread locals in the ActiveRecord scopes so that thewangjohn2013-04-081-2/+2
| | | | | current_scope and ignore_default_scope locals are brought together under a registry object.
* Remove duplicated require from AR base testCarlos Antonio da Silva2013-04-031-1/+0
|
* Fix typo: overriden => overriDDenAlexander Balashov2013-03-281-1/+1
|
* Make connection_handler overridable per threadSam Saffron2013-03-271-0/+57
|
* Make Postgres point type correspond to ruby array with two floats insideMartin Schürrer2013-03-251-2/+25
|
* Add Error#full_message test; Fix typosVipul A M2013-03-221-1/+1
| | | | | Introduce test on Error#full_message for attribute with underscores; Fix some typos
* Commas aren't comas.Josh Adams2013-03-191-2/+2
| | | | Type a fixo.
* move tests out from base_test.rbTakehiro Adachi2013-03-181-14/+0
| | | | | These tests should be in inheritance_test.rb since its testing a feature which is implemented in inheritance.rb
* Deprecate the `:distinct` option for `Relation#count`.Yves Senn2013-03-151-1/+1
| | | | | | | We moved more and more away from passing options to finder / calculation methods. The `:distinct` option in `#count` was one of the remaining places. Since we can now combine `Relation#distinct` with `Relation#count` the option is no longer necessary and can be deprecated.
* rename `Relation#uniq` to `Relation#distinct`. `#uniq` still works.Yves Senn2013-03-151-0/+6
| | | | | | | | The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our Relation API is close to SQL terms I renamed `#uniq` to `#distinct`. There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue to work. I also updated the documentation to promote the use of `#distinct`.
* hide more data in the schema cacheAaron Patterson2013-03-141-2/+2
|
* Address ActiveRecord::StatementInvalid: OCIError: ORA-00979Yasuo Honda2013-03-111-2/+2
|
* Merge pull request #9105 from bemurphy/cache_key_updated_onRafael Mendonça França2013-03-071-2/+20
|\ | | | | | | | | | | | | cache_key consults updated_on timestamp if present Conflicts: activerecord/CHANGELOG.md
| * cache_key consults updated_on timestamp if presentBrendon Murphy2013-02-261-2/+20
| | | | | | | | | | - Extract max timestamp retrieval for cache_key - Update changelog for cache_key changes
* | More helpful error message when instantiating an abstract classAaron Weiner2013-03-031-0/+14
|/ | | | | | | | | | Calling a literal ActiveRecord::Base.new raises NoMethodError, since it ends up calling Class.abstract_class? which does not exist. Similarly, instantiating an actual abstract class hits the database, when conventionally it should immediately throw NotImplementedError. ActiveRecord::Base can't be made abstract without breaking many, many things, so check for it separately.
* Raising an ActiveRecordError when one tries to use .touch(name) on a newwangjohn2013-02-251-0/+7
| | | | | object that has not yet been persisted. This behavior follows the precedent set by update_columns.
* delete duplicated tests in AR base_test.rbTakehiro Adachi2013-02-191-23/+0
| | | | These are duplicated with the tests which are in relations_test.rb
* add tests for ActiveRecord::Base#createTakehiro Adachi2013-02-181-0/+8
|
* Remove unnecessary begin..rescue..end, use only rescueAkira Matsuda2013-01-061-7/+5
|
* Rename update_attributes method to update, keep update_attributes as an aliasAmparo Luna + Guillermo Iguaran2013-01-031-2/+2
|
* Merge pull request #8682 from amatsuda/rm_as_frozen_object_errorGuillermo Iguaran2013-01-011-1/+0
|\ | | | | remove meaningless AS::FrozenObjectError
| * remove meaningless AS::FrozenObjectErrorAkira Matsuda2013-01-021-1/+0
| |
* | Standardize the use of current_adapter?Rafael Mendonça França2013-01-011-4/+4
|/
* Alias refute methods to assert_not and perfer assert_not on testsRafael Mendonça França2012-12-311-1/+1
|
* Improve test name related to cache timestamp format [ci skip]Carlos Antonio da Silva2012-12-111-1/+1
| | | | | Conflicts: activerecord/test/cases/base_test.rb
* Allow users to choose the timestamp format in the cache keyRafael Mendonça França2012-12-101-0/+5
| | | | | | | This can be done using the class attribute cache_timestamp_format Conflicts: railties/guides/source/configuring.textile
* Make sure the tests pass in the case closer to described in #8195Rafael Mendonça França2012-12-101-0/+12
| | | | | | Conflicts: activerecord/test/models/bulb.rb activerecord/test/schema/schema.rb
* arel columns can be used for grouping so that "weird" column names are usableAaron Patterson2012-11-151-0/+6
|
* Add a regression test on #8195Nikita Afanasenko2012-11-131-0/+7
|
* Remove ActiveRecord::ModelJon Leighton2012-10-261-14/+0
| | | | | | | | | | In the end I think the pain of implementing this seamlessly was not worth the gain provided. The intention was that it would allow plain ruby objects that might not live in your main application to be subclassed and have persistence mixed in. But I've decided that the benefit of doing that is not worth the amount of complexity that the implementation introduced.
* Move multiparameter attributes related tests to its own fileRafael Mendonça França2012-10-061-337/+0
|
* Remove mass assignment security from ActiveRecordGuillermo Iguaran2012-09-161-4/+0
|
* Deprecate ActiveSupport::Benchmarkable#silence.Steve Klabnik2012-09-151-12/+18
| | | | | | | Due to its lack of thread safety, we're deprecating this, and it will be removed in Rails 4.1. Fixes #4060.
* Fix for time type columns with invalid timeAdam Meehan2012-09-051-0/+12
| | | | | | The string_to_dummy_time method was blindly parsing the dummy time string with Date._parse which returns a hash for the date part regardless of whether the time part is an invalid time string.
* test cleanup, remove ruby_type because it's no longer neededYves Senn2012-09-031-1/+1
| | | | | All tests with a custom inheritance_column use the `Vegtable` model. The field ruby_type on the Company models is no longer needed
* fix order dependent test in AR::BasicsTestFrancesco Rodriguez2012-08-271-5/+5
| | | | | | | | This test https://github.com/rails/rails/blob/master/activerecord/test/cases/base_test.rb#L381 is failing because is not setting `CreditCard.pluralize_table_name` to `false`. In this case, i prefer to change to another model that is not in the `GUESSED_CLASSES` array.
* Move the serialized attribute tests to their own fileRafael Mendonça França2012-08-261-196/+0
|
* Move test to the correct fileRafael Mendonça França2012-08-261-0/+6
|
* Use instance_accessor: false instead of instance_writer.kennyj2012-08-211-0/+6
|
* Fix occasional microsecond conversion inaccuracyAri Pollak2012-08-151-0/+1
| | | | | | | | | ActiveRecord::ConnectionAdapters::Column#microseconds did an unnecessary conversion to from Rational to float when calculating the integer number of microseconds. Some terminating decimal numbers in base10 are repeating decimal numbers in base2 (the format of float), and occasionally this causes a rounding error. Patch & explanation originally from Logan Bowers.
* Remove ActiveRecord::Base.to_aJon Leighton2012-08-031-11/+3
| | | | | On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
* Revert "Removing composed_of from ActiveRecord."Rafael Mendonça França2012-07-271-0/+65
| | | | | | | | | | | This reverts commit 14fc8b34521f8354a17e50cd11fa3f809e423592. Reason: we need to discuss a better path from this removal. Conflicts: activerecord/lib/active_record/reflection.rb activerecord/test/cases/base_test.rb activerecord/test/models/developer.rb
* Deprecate ActiveRecord::Base.scoped.Jon Leighton2012-07-271-24/+24
| | | | | | | It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
* ActiveRecord::Base.all returns a Relation.Jon Leighton2012-07-271-25/+33
| | | | | | | | | | | Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
* Refactor ActiveRecord::Inheritance.base_class logicbeerlington2012-07-261-12/+0
| | | | | | | | | Moved logic from class_of_active_record_descendant(class) to the base_class method. This method was confusing because it required an argument, but that argument was 'self'. Moved base_class tests to inheritance_test.rb and added some test coverage for some untested cases.
* Deprecate update_column in favor of update_columns.Rafael Mendonça França2012-07-241-2/+2
| | | | Closes #1190
* AR::Integration must be included after AM::ConversionJohn Firebaugh2012-07-171-0/+6
| | | | | | | Integration's definition of #to_param must override Conversion's. Otherwise, there is a regression from 3.1 in the behavior of a non-persisted AR::Base instance which nevertheless has an id.