aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/base_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add attr_readonly to specify columns that are skipped during a normal ↵Rick Olson2007-09-301-13/+29
| | | | | | ActiveRecord #save operation. Closes #6896 [dcmanges] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7693 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed spelling errors (closes #9706) [tarmo/rmm5t]David Heinemeier Hansson2007-09-281-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7666 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Ensure that custom mutators aren't redefined by define_attribute_methods. [Koz]Michael Koziarski2007-09-171-0/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7500 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove commented out test which refers to old code, old bugs and uses ↵Michael Koziarski2007-08-291-22/+0
| | | | | | ObjectSpace in a nasty way. [nzkoz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7371 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change the implementation of ActiveRecord's attribute reader and writer methods:Michael Koziarski2007-08-141-25/+3
| | | | | | | | | | | * Generate Reader and Writer methods which cache attribute values in hashes. This is to avoid repeatedly parsing the same date or integer columns. * Move the attribute related methods out to attribute_methods.rb to de-clutter base.rb * Change exception raised when users use find with :select then try to access a skipped column. Plugins could override missing_attribute() to lazily load the columns. * Move method definition to the class, instead of the instance * Always generate the readers, writers and predicate methods. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7315 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Let inspect on AR classes work when the table doesn't exist. Closes #9194 ↵Michael Koziarski2007-08-061-0/+4
| | | | | | [tarmo, nzkoz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated count(conditions=nil, joins=nil) usage. Closes #8993 ↵Rick Olson2007-07-161-5/+2
| | | | | | [lifofifo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7189 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add the type="array" moniker to has_many / has_and_belongs_to_many ↵Tobias Lütke2007-06-271-4/+4
| | | | | | associations upon serialization. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7144 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Base#inspect when not every attribute is present. Closes #8623.Jeremy Kemper2007-06-111-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6995 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Base.inspect handles Base itself and abstract_class? Don't use #<Foo ...> ↵Jeremy Kemper2007-05-311-3/+9
| | | | | | since that notation's typically used for instances of a class, not the class itself. Closes #8490 [deepblue] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6913 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise an exception if both attr_protected and attr_accessible are declared. ↵Jeremy Kemper2007-05-291-0/+12
| | | | | | Closes #8507, #6004. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6896 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow nil serialized attributes with a set class constraint. #7293 [sandofsky]Rick Olson2007-05-281-4/+17
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Test that #to_xml takes a block. Closes #8471. [seth]Jeremy Kemper2007-05-251-0/+9
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6847 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix #inspect for new records. Closes #8405.Jeremy Kemper2007-05-191-0/+4
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pay tribute to timezones. Tune #inspect style.Jeremy Kemper2007-05-181-7/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6766 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Sanitize Base#inspect. Closes #8392.Jeremy Kemper2007-05-181-1/+14
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Hash#to_xml supports YAML attributes; ActiveRecord::Base#to_xml support ↵Jeremy Kemper2007-03-181-1/+1
| | | | | | serialized attributes. Closes #7502. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6444 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Base.update_all :order and :limit options. Useful for MySQL updates that ↵Jeremy Kemper2007-03-171-0/+6
| | | | | | must be ordered to avoid violating unique constraints. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Oracle: overflow Time to DateTime. Closes #7718.Jeremy Kemper2007-03-061-1/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6348 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLServer: don't choke on strings containing 'null'. Closes #7083.Jeremy Kemper2007-01-281-2/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6084 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* update_all can take a Hash argument. sanitize_sql splits into two methods ↵Jeremy Kemper2007-01-281-10/+23
| | | | | | for conditions and assignment since NULL values and delimiters are handled differently. References #6583, closes #7365. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6073 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Don't create instance writer methods for class attributes. Closes #7401 [Rick]Rick Olson2007-01-281-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6051 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Allow the Oracle adapter to insert a string "null". Closes #6997 [laurelfan]Michael Koziarski2007-01-161-1/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5958 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Sybase adapter fixes. Closes #6926 [jsheets]Michael Koziarski2007-01-051-5/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5839 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* try to appease the angry OracleJamis Buck2006-12-291-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5808 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* make sure query attributes on custom fields works as it used toJamis Buck2006-12-291-1/+22
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5807 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pushing a record on an association collection doesn't unnecessarily load all ↵Jeremy Kemper2006-12-211-3/+3
| | | | | | the associated records. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Partially revert [5660] - makes more trouble than it resolves. References ↵Jeremy Kemper2006-12-191-2/+2
| | | | | | #5704, closes #6766. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Subclasses of an abstract class work with single-table inheritance. Closes ↵Jeremy Kemper2006-12-011-2/+55
| | | | | | #5704. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5660 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Quote ActiveSupport::Multibyte::Chars. Closes #6653.Jeremy Kemper2006-11-201-0/+12
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5597 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Simplify query_attribute by typecasting the attribute value and checking ↵Jeremy Kemper2006-11-201-1/+28
| | | | | | whether it's nil, false, zero or blank. Closes #6659. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5593 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Find with :include respects scoped :order. Closes #5850.Jeremy Kemper2006-11-071-0/+10
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5445 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* SQLite: count(distinct) queries supported in >= 3.2.6, fix calculations ↵Jeremy Kemper2006-11-051-8/+10
| | | | | | workaround, remove count(distinct) query rewrite, cleanup test connection scripts. Closes #6544. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5426 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Dynamically generate reader methods for serialized attributes. Closes #6362.Jeremy Kemper2006-11-021-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5416 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added update_attributes! which uses save! to raise an exception if a ↵David Heinemeier Hansson2006-10-091-1/+38
| | | | | | validation error prevents saving (closes #6192) [jonathan] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5256 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Use class name as XML_TYPE_NAMES key.Jeremy Kemper2006-09-291-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5210 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: count class method should be called with an options hash rather ↵Jeremy Kemper2006-09-261-1/+1
| | | | | | than two args for conditions and joins. Closes #6287. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5192 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation tests. Remove warnings for dynamic finders and for the foo_count ↵Jeremy Kemper2006-09-151-29/+26
| | | | | | ethod if it's also an attribute. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5116 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Backed out of new_record? to new? transformation as it would screw up ↵David Heinemeier Hansson2006-09-051-4/+10
| | | | | | existing models that did boolean calls on "new" attributes [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5018 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecated ActiveRecord::Base.new_record? in favor of ↵David Heinemeier Hansson2006-09-051-10/+4
| | | | | | ActiveRecord::Base.new? (old version still works until Rails 2.0) [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5017 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml: the :methods option works on arrays of records. Closes #5845.Jeremy Kemper2006-09-021-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nested subclasses are not prefixed with the parent class' table_name since ↵Jeremy Kemper2006-08-251-5/+21
| | | | | | they should always use the base class' table_name. Closes #5911. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4819 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* to_xml: correct naming of included associations. Closes #5831.Jeremy Kemper2006-08-201-0/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4794 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Nested classes are given table names prefixed by the singular form of the ↵Jeremy Kemper2006-08-161-4/+8
| | | | | | parent's table name. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4770 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that default timezones for new / initialize should uphold utc setting ↵David Heinemeier Hansson2006-08-051-0/+16
| | | | | | (closes #5709) [daniluk@yahoo.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4670 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed to_xml with :include misbehaviors when invoked on array of model ↵David Heinemeier Hansson2006-08-031-0/+13
| | | | | | instances (closes #5690) [alexkwolfe@gmail.com] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4652 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* more concise destroy testJeremy Kemper2006-08-011-13/+5
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4646 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Patch sql injection vulnerability when using integer or float columns.Jamis Buck2006-07-271-0/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4626 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* r4704@asus: jeremy | 2006-06-27 12:00:19 -0700Jeremy Kemper2006-07-081-1/+33
| | | | | | | | | | | | | | | decimal r4705@asus: jeremy | 2006-06-27 12:20:47 -0700 current_adapter? checks whether any of its arguments is the name of the current adapter class r4834@asus: jeremy | 2006-07-08 13:08:24 -0700 Room to float. r4835@asus: jeremy | 2006-07-08 13:09:18 -0700 Give lock test a few chances. r4836@asus: jeremy | 2006-07-08 13:12:05 -0700 Numeric and decimal columns map to BigDecimal instead of Float. Those with scale 0 map to Integer. Closes #5454. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4596 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* PostgreSQL: correctly quote microseconds in timestamps. Closes #5641.Jeremy Kemper2006-07-071-0/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4579 5ecf4fe2-1ee6-0310-87b1-e25e094e27de