aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Make sure AR::Base#clone handles attr changes made in after_initialize ↵Michael Koziarski2007-10-081-3/+3
| | | | | | hooks. Closes #7191 [weyus] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7802 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise ProtectedAttributeAssignmentError in development and test environments ↵Jeremy Kemper2007-10-071-14/+34
| | | | | | when mass-assigning to an attr_protected attribute. Closes #9699. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7777 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Send the correct INSERT statement when dealing with objects with only ↵Michael Koziarski2007-10-061-6/+13
| | | | | | primary keys. Closes #9523 [tarmo] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7753 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix that ActiveRecord would create attribute methods and override custom ↵Rick Olson2007-10-061-3/+6
| | | | | | attribute getters if the method is also defined in Kernel.methods. [Rick] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7749 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Cache the descends_from_activerecord? call to speed up query generation. ↵Michael Koziarski2007-10-031-3/+8
| | | | | | [skaes] Closes #9765 git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7723 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add attr_readonly to specify columns that are skipped during a normal ↵Rick Olson2007-09-301-3/+22
| | | | | | 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
* Docfix (closes #8767) [kampers]David Heinemeier Hansson2007-09-221-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7561 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Define dynamic finders as real methods after first usage. Close #9317Tobias Lütke2007-09-181-28/+31
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7510 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: remove deprecated threaded_connections methods. Use ↵Jeremy Kemper2007-09-181-10/+0
| | | | | | allow_concurrency instead. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7509 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Deprecation: removed Reloadable.Jeremy Kemper2007-09-141-4/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7473 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* minor speedups + forward-compat syntaxJeremy Kemper2007-09-131-11/+16
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7471 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* minor speedupJeremy Kemper2007-09-131-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7469 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Performance: absorb instantiate and initialize_with_callbacks into the Base ↵Jeremy Kemper2007-08-311-1/+12
| | | | | | methods. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7380 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fixed that eager loading queries and with_scope should respect the :group ↵David Heinemeier Hansson2007-08-211-3/+13
| | | | | | option [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7355 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Change the implementation of ActiveRecord's attribute reader and writer methods:Michael Koziarski2007-08-141-213/+16
| | | | | | | | | | | * 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-1/+3
| | | | | | [tarmo, nzkoz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7278 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Performance enhancement for Base.exists?. CLoses #8769. [hasmanyjosh]Michael Koziarski2007-08-051-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7274 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Refactored in use of extract_options! (closes #9079) [josh]David Heinemeier Hansson2007-07-241-5/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7220 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Move from select * to select tablename.* to avoid clobbering IDs. Closes ↵Michael Koziarski2007-07-071-1/+1
| | | | | | #8889 [dasil003] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7167 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Array attribute conditions work with proxied association collections. Closes ↵Jeremy Kemper2007-06-271-1/+1
| | | | | | #8318. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7133 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docfix (closes #8096)David Heinemeier Hansson2007-06-231-3/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7107 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Docfix (closes #8674)David Heinemeier Hansson2007-06-231-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7101 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated quote methods, replaced by quote_value so quote can be ↵Jeremy Kemper2007-06-111-12/+0
| | | | | | used as an attribute name. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@7000 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Remove deprecated find_first and find_all.Jeremy Kemper2007-06-111-9/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6998 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix Base#inspect when not every attribute is present. Closes #8623.Jeremy Kemper2007-06-111-3/+4
| | | | 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-2/+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
* Fix an edge case with find with a list of ids, limit, and offset. Closes #8437.Jeremy Kemper2007-05-311-4/+6
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6912 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* with_scope is protected. Closes #8524.Jeremy Kemper2007-05-301-85/+97
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6909 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Raise an exception if both attr_protected and attr_accessible are declared. ↵Jeremy Kemper2007-05-291-0/+2
| | | | | | 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-2/+2
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6879 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* find gracefully copes with blank :conditions. Closes #7599.Jeremy Kemper2007-05-261-3/+3
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6852 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Find with a list of ids supports limit/offset. Closes #8437.Jeremy Kemper2007-05-251-2/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6845 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Call the newly generated read method after generating it. Closes #8470.Jeremy Kemper2007-05-251-4/+15
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6837 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Fix #inspect for new records. Closes #8405.Jeremy Kemper2007-05-191-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6782 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Clarify :offset docs. Closes #3733.Jeremy Kemper2007-05-181-1/+1
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6769 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Pay tribute to timezones. Tune #inspect style.Jeremy Kemper2007-05-181-7/+9
| | | | 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/+20
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6761 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Replace the transaction {|transaction|..} semantics with a new Exception ↵Michael Koziarski2007-05-181-0/+2
| | | | | | ActiveRecord::Rollback. Closes #8030 [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6754 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Add documentation caveat about when to use count_by_sql. Closes #8090. ↵Marcel Molina2007-05-061-0/+9
| | | | | | [fearoffish] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6685 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Also add documentation enhancements for increment_counter. Closes #8092. ↵Marcel Molina2007-05-061-5/+15
| | | | | | [fearoffish] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6684 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Enhance documentation for decrement_counter. Closes #8093. [fearoffish]Marcel Molina2007-05-061-1/+13
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6683 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Improved performance by relying less on exception raising #8159 [Blaine]David Heinemeier Hansson2007-04-241-1/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6571 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Added ActiveRecord::Base.inspect to return a column-view like #<Post ↵David Heinemeier Hansson2007-04-211-0/+5
| | | | | | id:integer, title:string, body:text> [DHH] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6549 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* documentation project patches, closes #7342, #7319, #7316, #7190 ↵Rick Olson2007-03-271-0/+3
| | | | | | [jeremymcanally] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6470 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Base.update_all :order and :limit options. Useful for MySQL updates that ↵Jeremy Kemper2007-03-171-2/+8
| | | | | | must be ordered to avoid violating unique constraints. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6440 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* find_or_create_by_* takes a hash so you can create with more attributes than ↵Jeremy Kemper2007-03-141-2/+14
| | | | | | are in the method name. Closes #7368. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6420 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Make sure with_scope takes both :select and :joins into account when setting ↵Michael Koziarski2007-03-131-1/+1
| | | | | | :readonly. Allows you to save records you retrieve using finders on a has_many :through associations. [Koz] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6413 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Consistently quote primary key column names. Closes #7763.Jeremy Kemper2007-03-091-7/+7
| | | | git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6364 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* Note that find results may not be in the same order as the id arguments. ↵Jeremy Kemper2007-03-061-0/+4
| | | | | | Closes #7719. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6347 5ecf4fe2-1ee6-0310-87b1-e25e094e27de