aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Revert "Style fixes"Pratik Naik2010-07-151-1/+1
| | | | This reverts commit 3c300b31219f2af3ecd46ef22b04e5c5548db899.
* Style fixeswycats2010-07-141-1/+1
|
* Style fixesPratik Naik2010-07-141-1/+1
|
* Added reorder delegation for ActiveRecord::Base(to be able to overwrite the ↵Vitalii Khustochka2010-07-131-1/+1
| | | | | | default_scope ordering in the named scope [#5093 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Return from ActiveRecord::Base#attributes= unless value is a hash [#4070 ↵David Trasbo2010-07-081-1/+1
| | | | | | state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* removed an old unused method in AR which removed readonly attributesJosh Kalderimis2010-07-081-9/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* removing unused methodNeeraj Singh2010-07-081-5/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* mass_assignment_security moved from AR to AMo, and minor test cleanupJosh Kalderimis2010-07-081-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* minor changes to mass assignment security patch to bring it in line with ↵Josh Kalderimis2010-07-081-2/+2
| | | | | | rails standards Signed-off-by: José Valim <jose.valim@gmail.com>
* Mass assignment security refactoringEric Chapweske2010-07-081-133/+11
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge remote branch 'docrails/master'Xavier Noria2010-07-071-2/+4
|\
| * clarifying the comments regarding base_class declarationNeeraj Singh2010-07-011-2/+4
| |
* | Make relation a private method.José Valim2010-07-011-5/+6
|/
* Remove ActiveRecord::Base#class_name [#379 state:committed]David Trasbo2010-06-291-8/+0
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Tidy up deprecation message for with_exclusive_scope.José Valim2010-06-291-10/+11
|
* Add scoping and unscoped as the syntax to replace the old with_scope and ↵José Valim2010-06-291-10/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* with_exclusive_scope does not work properly if ARel is passed. It does work ↵Neeraj Singh2010-06-291-0/+13
| | | | | | | | nicely if hash is passed. Blow up if user is attempting it pass ARel to with_exclusive_scope. [#3838 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Add missing require, Base use deprecate methodSantiago Pastorino2010-06-271-0/+1
|
* Warn that ActiveRecord::Base.reset_subclasses is gone in Rails 3 final.Jeremy Kemper2010-06-271-0/+12
|
* quotes are not necessary hereSantiago Pastorino2010-06-241-2/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Move Rails::LogSubscriber to ActiveSupport::LogSubscriber, allowing ↵José Valim2010-06-241-0/+1
| | | | frameworks like ActiveRecord and ActiveResource to log outsude Rails::Application [#4816 state:resolved]
* Remove incorrect comment regarding #initialize_copyPaul Gillard2010-06-231-8/+0
| | | | | | Comment added in #3164 is incorrect after reading http://dev.rubyonrails.org/ticket/7191. Signed-off-by: José Valim <jose.valim@gmail.com>
* Don't clone associations [#4894 state:resolved]Paul Gillard2010-06-231-0/+1
| | | | | | Cloning an active record object should be shallow in that it should copy attributes but not associations. This was no longer true as a result of #3164. Signed-off-by: José Valim <jose.valim@gmail.com>
* Merge remote branch 'rails/master'Xavier Noria2010-06-201-32/+4
|\ | | | | | | | | Conflicts: actionpack/lib/abstract_controller/base.rb
| * remove executable permission from files that don't need it. [#4802 ↵rohit2010-06-201-0/+0
| | | | | | | | | | | | state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
| * ActiveModel::Validations::Callbacks should not be required by default.José Valim2010-06-191-1/+0
| |
| * moving before_validation and after_validation functionality from ↵Neeraj Singh2010-06-191-0/+1
| | | | | | | | | | | | | | | | ActiveRecord to ActiveModel [#4653 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
| * ActiveRecord and ActionPack now use the new descendants implementation.José Valim2010-06-191-32/+4
| |
* | Adds title and basic description where needed.Rizwan Reza2010-06-151-0/+2
| |
* | Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-151-1/+1
|\ \ | |/ |/|
| * Fix a bunch of minor spelling mistakesEvgeniy Dolzhenko2010-06-111-1/+1
| |
* | refactors AR::Base#reset_table_nameXavier Noria2010-06-141-19/+20
| |
* | Documentation for #quoted_table_name methodThiago Pradi2010-06-141-0/+2
| | | | | | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* | Remove an unused methodPratik Naik2010-06-121-13/+0
|/
* Fix ActiveRecord::Base.compute_type swallowing NoMethodError. [#4751 ↵Andrew Bloomgarden2010-06-081-1/+3
| | | | | | state:resolved] Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* refactor evals and adds some __FILE__ and __LINE__Santiago Pastorino2010-05-201-1/+1
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Remove Model.clear_default_scopePratik Naik2010-05-181-4/+0
|
* AR::Base#clone fixed to set dirty bits for cloned objectpleax2010-05-161-1/+7
| | | | | | [#2919 state:committed] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* cache connection when quotingComron Sattari2010-05-161-5/+6
| | | | | | | [#3642 state:committed] Signed-off-by: Marius Nuennerich <marius@nuenneri.ch> Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* a cloned object no longer mimics changed flags from creator , plus a test ↵Federico Brubacher2010-05-161-0/+1
| | | | | | case [#4614 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* Reset quoted_table_name after set_table_name [#4568 state:resolved]Santiago Pastorino2010-05-151-1/+1
| | | | Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
* Modified default_scope to merge with any pre-existing default_scopeDavid Chelimsky + Brian Tatnall2010-05-151-1/+5
| | | | | | | | | | | | and added AR::Base::clear_default_scope - clear_default_scope provides users who rely on the old behaviour of each call to default_scope overwriting any previous default scopes an opportunity to maintain that behaviour. [#4583 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* eliminate alias_method_chain from ActiveRecordwycats2010-05-091-329/+2
|
* Fix failing test.José Valim2010-04-281-1/+1
|
* Makes validates_acceptance_of to not override database fields [#4460 ↵Santiago Pastorino2010-04-281-0/+4
| | | | | | state:committed] Signed-off-by: José Valim <jose.valim@gmail.com>
* Restore HWIA#stringify_keys! and update changelogJeremy Kemper2010-04-221-2/+1
|
* removes unnecessary assignment and local variable in AR::Base#subclasses, ↵Xavier Noria2010-04-131-3/+2
| | | | and revises its rdoc
* Refactor compute_type to handle situations where the correct class is ↵Andrew White2010-04-121-16/+19
| | | | | | already loaded Signed-off-by: wycats <wycats@gmail.com>
* make ActiveRecord::Base.subclasses a public methodEmmanuel Oga2010-04-121-1/+5
| | | | Signed-off-by: wycats <wycats@gmail.com>
* table_name_prefix and table_name_suffix are class_attributes instead of ↵Phil Smith2010-04-121-4/+5
| | | | | | cattr_accessors. [#4230] Signed-off-by: José Valim <jose.valim@gmail.com>