aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Don't reset inheritance_column when setting explicitly.Fred Wu2013-03-271-0/+10
| | | This is backported from master (cdfcbc4).
* Duplicate column_defaults properlyPiotr Sarnacki2013-02-031-1/+7
| | | | | | | | | | Backport c517602 to fix #6115 Deleted: activerecord/lib/active_record/core.rb Conflicts: activerecord/test/cases/base_test.rb
* Serialized attribute can be serialized in an integer columnRafael Mendonça França2012-12-211-0/+8
| | | | | | | | | | Fix #8575 Conflicts: activerecord/CHANGELOG.md activerecord/lib/active_record/attribute_methods/serialization.rb activerecord/test/cases/serialized_attribute_test.rb activerecord/test/models/person.rb
* Improve test name related to cache timestamp format [ci skip]Carlos Antonio da Silva2012-12-111-1/+1
|
* Add :nsec format only for Ruby 1.9Carlos Antonio da Silva2012-12-111-0/+4
| | | | | | Ruby 1.8 does not support this format in Time, so the format will only be added to the available date formats on Ruby 1.9. Changelog entry was changed to explain that as well.
* Run backported serialized test without Identity MapCarlos Antonio da Silva2012-12-111-2/+4
| | | | | | It fails with Identity Map because the find call returns the same object, so the "content" attribute that we expect to raise "missing attribute" is actually present.
* Use 1.8 hash style :bomb:Carlos Antonio da Silva2012-12-111-2/+2
|
* Merge pull request #8441 from itzki/fix_decorate_columnsCarlos Antonio da Silva2012-12-111-0/+13
| | | | | Backport test to ensure there won't be regressions. The issue only happens on master at the moment.
* Allow users to choose the timestamp format in the cache keyRafael Mendonça França2012-12-101-1/+10
| | | | | | This can be done using the class attribute cache_timestamp_format Closes #8195
* Make sure the tests pass in the case closer to described in #8195Rafael Mendonça França2012-12-101-0/+12
|
* Merge pull request #6376 from jgaskins/timestamp-microsecondsJeremy Kemper2012-12-101-1/+1
| | | | | | Increase numeric-timestamp precision to nanoseconds Conflicts: activesupport/lib/active_support/core_ext/time/conversions.rb
* Backport #8078: Fix `attributes_before_type_cast` for serialised attributes.Nikita Afanasenko2012-11-091-0/+10
| | | | Public method attributes_before_type_cast used to return internal AR structure (ActiveRecord::AttributeMethods::Serialization::Attribute), patch fixes this. Now behaves like read_attribute_before_type_cast and returns unserialised values.
* Merge pull request #7337 from adzap/string_to_dummy_timeRafael Mendonça França2012-09-051-0/+12
| | | | | | Fix for time type columns with invalid time value Conflicts: activerecord/CHANGELOG.md
* Merge pull request #7352 from aripollak/microsecond-timestampRafael Mendonça França2012-08-171-0/+1
| | | | | | Fix occasional microsecond conversion inaccuracy Conflicts: activerecord/CHANGELOG.md
* Do not use update_column where update_attribute is not interchangeableRafael Mendonça França2012-08-151-1/+1
| | | | | | | | | | | | Revert "Deprecate update_attribute." This reverts commit b081f6b59fb3f15d12043072ad9b331ffd2bc56e. Reason: Since the new deprecation policy we removed the deprecation of update_attribute but we didn't reverted the changes to use update_column. Fixes #7306
* 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.
* Deprecate update_attribute.Steve Klabnik2012-06-141-1/+1
| | | | | | | | | | | Historically, update_attribute and update_attributes are similar, but with one big difference: update_attribute does not run validations. These two methods are really easy to confuse given their similar names. Therefore, update_attribute is being deprecated in favor of update_column, and will be removed in Rails 4. See the discussion on rails-core here: https://groups.google.com/d/topic/rubyonrails-core/BWPUTK7WvYA/discussion
* Merge pull request #5810 from kennyj/fix_5797Aaron Patterson2012-05-301-0/+9
| | | | | | Fix #5797. Error calling dup method on AR model with serialized field Conflicts: activerecord/lib/active_record/core.rb
* Fix tests of benchmark with silence equals to trueRafael Mendonça França2012-04-041-3/+1
|
* Test for #5549.Aaron Patterson2012-03-281-1/+15
| | | | | | | | Cherry-picked from e96d04a2e4e244ea5053cb4e8ab97db604d0c796. Conflicts: activerecord/lib/active_record/attribute_methods/read.rb
* Fix attribute_before_type_cast for serialized attributes. Fixes #4837.Jon Leighton2012-02-071-0/+15
| | | | | | Conflicts: activerecord/lib/active_record/core.rb
* call to_s on value passed to table_name=Sergey Nartimov2012-01-261-0/+5
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Fix table_name in ActiveRecord with more than one abstract ancestorsPiotr Sarnacki2012-01-121-0/+11
| | | | | | | | | | | | | | | | | When subclassing abstract_class table_name should be always computed based on class name, no matter if superclass is subclassing base or another abstract_class. So: class FirstAbstract < ActiveRecord::Base self.abstract_class = true end class SecondAbstract < FirstAbstract self.abstract_class = true end class Post < SecondAbstract self.table_name #=> 'posts' (not 'second_abstracts') end
* avoid deprecation warnings when running AR testsAaron Patterson2011-12-241-1/+3
|
* Fix #4046.Jon Leighton2011-12-231-0/+1
|
* serialize fails on subclassAlvaro Bautista2011-12-231-1/+21
|
* Don't store defaults in the schema cacheJon Leighton2011-12-161-0/+1
|
* Cache columns at the model level.Jon Leighton2011-12-161-2/+2
| | | | Allows two models to use the same table but have different primary keys.
* Split out most of the AR::Base code into separate modules :cake:Jon Leighton2011-12-151-13/+0
|
* Fix sequence name with abstract classes.Edgars Beigarts2011-12-041-0/+10
|
* Create method with known identifier then alias into place.Jon Leighton2011-12-011-0/+2
| | | | | | | | This means we never have to rely on define_method (which is slower and uses more memory), even when we have attributes containing characters that are not allowed in standard method names. (I am mainly changing this because the duplication annoys me, though.)
* Deprecated `define_attr_method` in `ActiveModel::AttributeMethods`Jon Leighton2011-11-291-21/+12
| | | | | This only existed to support methods like `set_table_name` in Active Record, which are themselves being deprecated.
* Deprecate set_primary_key in favour of self.primary_key=Jon Leighton2011-11-291-2/+26
|
* Make sure the original_foo accessor still works (but deprecated) if we are ↵Jon Leighton2011-11-291-7/+55
| | | | using self.foo=
* Deprecate set_sequence_name in favour of self.sequence_name=Jon Leighton2011-11-291-2/+6
|
* Add tests for set_sequence_name etcJon Leighton2011-11-291-0/+22
|
* Deprecate set_inheritance_column in favour of self.inheritance_column=Jon Leighton2011-11-291-2/+7
|
* Deprecate set_table_name in favour of self.table_name= or defining your own ↵Jon Leighton2011-11-291-7/+20
| | | | method.
* Merge pull request #3636 from joshsusser/masterJon Leighton2011-11-291-0/+9
|\ | | | | association methods are now generated in modules
| * use GeneratedFeatureMethods module for associationsJosh Susser2011-11-271-0/+9
| |
* | `ActiveRecord::Base#becomes` should retain the errors of the original object.James Adam2011-11-161-0/+8
|/ | | | This commit contains a simple failing test that demonstrates the behaviour we expect, and a fix. When using `becomes` to transform the type of an object, it should retain any error information that was present on the original instance.
* Add ActiveRecord::Relation#uniq for toggling DISTINCT in the SQL queryJon Leighton2011-11-051-0/+6
|
* Revert "Raise error on unknown primary key."Jon Leighton2011-10-051-0/+4
| | | | This reverts commit ee2be435b1e5c0e94a4ee93a1a310e0471a77d07.
* Raise error on unknown primary key.Jon Leighton2011-10-051-4/+0
| | | | | If we don't have a primary key when we ask for it, it's better to fail fast. Fixes GH #2307.
* Rename first_or_new to first_or_initialize.Jon Leighton2011-09-131-10/+2
| | | | | For consistency with find_or_initialize_by. Also remove first_or_build alias.
* Add missing require in base_test.rb, fixes isolated testGuillermo Iguaran2011-09-091-0/+1
|
* Merge pull request #2757 from andmej/first_or_create_pull_requestJon Leighton2011-09-081-0/+31
|\ | | | | Add first_or_create family of methods to Active Record
| * Adding first_or_create, first_or_create!, first_or_new and first_or_build to ↵Andrés Mejía2011-08-301-0/+31
| | | | | | | | | | | | | | | | | | | | Active Record. This let's you write things like: User.where(:first_name => "Scarlett").first_or_create!(:last_name => "Johansson", :hot => true) Related to #2420.
* | Disable active record marshalling tests on Ruby 1.8.7 on Travis CI, as they ↵Jon Leighton2011-09-061-0/+15
| | | | | | | | have been failing intermittently for a long while due to what appears to be a Ruby bug. If anyone has the skills/expertise/time to debug this, please speak to the Travis guys.
* | Need to add here to pass the testArun Agrawal2011-09-031-0/+1
|/ | | As in previous commit it's removed.