aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'master' of git://github.com/lifo/docrailsXavier Noria2011-05-251-0/+2
|\ | | | | | | | | | | Conflicts: actionmailer/lib/action_mailer/base.rb activesupport/lib/active_support/core_ext/kernel/requires.rb
| * Add more doc to #update_column.Sebastian Martinez2011-05-201-0/+2
| |
* | rescue record invalid exceptions and return false from the save method. ↵Aaron Patterson2011-05-241-1/+5
|/ | | | fixes #796
* renamed mass-assignment scopes to roles, updated code, tests, docs and ↵Josh Kalderimis2011-05-081-1/+1
| | | | security guide
* postgresql supports prepare statement deletesAaron Patterson2011-04-291-1/+9
|
* Fix #update_attributes api format errorSebastian Martinez2011-04-261-1/+1
|
* AR update_attributes api is updated to reflect the addition of assign_attributesJosh Kalderimis2011-04-261-4/+9
|
* Added new #update_column method.Sebastian Martinez2011-03-271-0/+14
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Revert "Removed #update_attribute method. New #update_column method."Sebastian Martinez2011-03-271-8/+10
| | | | | | This reverts commit 45c233ef819dc7b67e259dd73f24721fec28b8c8. Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* Removed #update_attribute method. New #update_column method.Sebastian Martinez2011-03-261-10/+8
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* pushing id insertion and prefetch primary keys down to Relation#insertAaron Patterson2011-03-221-9/+1
|
* Merge remote branch 'rails/master' into identity_mapEmilio Tagua2011-02-151-3/+6
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/examples/performance.rb activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/nested_attributes.rb activerecord/test/cases/relations_test.rb
| * removed some duplication from LH issue 5505 regarding AR touch and ↵Josh Kalderimis2011-02-091-5/+1
| | | | | | | | | | | | optimistic locking [#5505 state:resolved] Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com>
| * The optimistic lock column should be increased when calling touchFranck Verrot2011-02-091-0/+7
| | | | | | | | Signed-off-by: Santiago Pastorino and José Ignacio Costa <santiago+jose@wyeworks.com>
| * Do not use primary key on insertion when it's nilSantiago Pastorino2010-12-291-2/+2
| |
| * Allow primary_key to be an attribute when the model is a new recordSantiago Pastorino2010-12-281-1/+1
| |
* | Merge remote branch 'rails/master' into identity_mapEmilio Tagua2010-12-201-6/+8
|\| | | | | | | | | | | | | | | Conflicts: activerecord/lib/active_record/associations/association_proxy.rb activerecord/lib/active_record/autosave_association.rb activerecord/lib/active_record/base.rb activerecord/lib/active_record/persistence.rb
| * removing calls to deprecated methodsAaron Patterson2010-12-021-1/+2
| |
| * refactor `self.class` to a variableAaron Patterson2010-12-021-1/+2
| |
| * Partialy revert f1c13b0dd7b22b5f6289ca1a09f1d7a8c7c8584bJosé Valim2010-11-281-5/+5
| |
* | Use identity mapper only if enabled.Emilio Tagua2010-11-191-3/+3
| |
* | IdentityMap - adding and removing of records on create/updateMarcin Raczkowski2010-11-191-2/+12
|/
* STI type is now updated when calling AR::Base.becomes on subclasses [#5953 ↵Franck Verrot2010-11-121-0/+1
| | | | state:resolved]
* Double negation of an already boolean value produces the same resultSantiago Pastorino2010-11-091-1/+1
|
* Don't check if persisted is defined just initialize it properlySantiago Pastorino2010-11-091-2/+0
|
* use persisted? instead of new_record? wherever possibleDavid Chelimsky2010-11-091-5/+7
| | | | | | | | | | | - persisted? is the API defined in ActiveModel - makes it easier for extension libraries to conform to ActiveModel APIs without concern for whether the extended object is specifically ActiveRecord [#5927 state:committed] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* restore behavior of touch for models without :updated_xx [#5439 state:resolved]tnp2010-09-241-3/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Use map instead inject.Emilio Tagua2010-09-221-4/+3
| | | | Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* The call-seq directive has no useful effect on our documentation and is not ↵Joost Baaij2010-08-281-3/+0
| | | | | | | | | | | used anywhere else. Worse still, its use breaks some rdoc, replacing method names with a curly brace. Having just one call-seq directive doesn't add anything since this is covered by regular rdoc. Having multiple might make sense, but these are already documented with examples. This partly re-reverts 60de0e56b7f57f0052d7e4f43bd2ef9e363c6a1a but does not touch the vendorized code in html-scanner.
* edit pass to a recent doc patchXavier Noria2010-08-251-3/+10
|
* Merge remote branch 'docrails/master'Xavier Noria2010-08-251-2/+6
|\
| * touch operationg if used along with belongs_to will also be invoked on ↵Neeraj Singh2010-08-241-2/+6
| | | | | | | | associated objects
* | @user.touch should not fail if User does not have updated_at/updated_on column.Neeraj Singh2010-08-241-9/+11
|/ | | | | | [#5439 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Make update_attribute behave as in Rails 2.3 and document the behavior ↵José Valim2010-08-121-33/+30
| | | | intrinsic to its implementation.
* standarizes the use of the article "an" for "SQL" and "SQLite"Xavier Noria2010-08-051-1/+1
|
* Merge remote branch 'docrails/master' into 3-0-stableXavier Noria2010-08-031-2/+2
|\
| * ensuring that description does not exceed 100 columnsNeeraj Singh2010-08-021-2/+2
| |
* | Add an internal (private API) after_touch callback. [#5271 state:resolved]José Valim2010-08-021-0/+13
|/
* adding punctuationsNeeraj Singh2010-07-281-4/+4
|
* more documentation for update_attributeNeeraj Singh2010-07-281-5/+6
|
* adding comments to update_attribute methodNeeraj Singh2010-07-271-0/+4
|
* expanded comment for update_attribute methodNeeraj Singh2010-07-221-2/+9
|
* update_attribute should not update readonly attributesNeeraj Singh2010-07-211-0/+2
| | | | | | [#5106 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* revises the rdoc of update_attributes and update_attributes! to document ↵Xavier Noria2010-07-141-4/+9
| | | | they are wrapped in a transaction, and adds code comments explaining why
* update_attributes and update_attributes! are now wrapped in a transactionNeeraj Singh2010-07-131-4/+8
| | | | | | [#922 state:resovled] Signed-off-by: José Valim <jose.valim@gmail.com>
* Tidying up a bit, so update_attribute is not called twice on touch.José Valim2010-07-131-10/+8
|
* with this fix touch method - does not call validations - doest not call ↵Neeraj Singh2010-07-131-0/+1
| | | | | | | | callbacks - updates updated_at/on along with attribute if attribute is provided - marks udpated_at/on and attribute as NOT changed [#2520 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Improve a bit the code in latest commits.José Valim2010-07-081-7/+9
|
* This patch changes update_attribute implementatino so:Neeraj Singh2010-07-081-5/+12
| | | | | | | | | | - it will only save the attribute it has been asked to save and not all dirty attributes - it does not invoke callbacks - it does change updated_at/on Signed-off-by: José Valim <jose.valim@gmail.com>
* Add scoping and unscoped as the syntax to replace the old with_scope and ↵José Valim2010-06-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | with_exclusive_scope. A few examples: * with_scope now should be scoping: Before: Comment.with_scope(:find => { :conditions => { :post_id => 1 } }) do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end After: Comment.where(:post_id => 1).scoping do Comment.first #=> SELECT * FROM comments WHERE post_id = 1 end * with_exclusive_scope now should be unscoped: class Post < ActiveRecord::Base default_scope :published => true end Post.all #=> SELECT * FROM posts WHERE published = true Before: Post.with_exclusive_scope do Post.all #=> SELECT * FROM posts end After: Post.unscoped do Post.all #=> SELECT * FROM posts end Notice you can also use unscoped without a block and it will return an anonymous scope with default_scope values: Post.unscoped.all #=> SELECT * FROM posts