aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/base.rb
Commit message (Collapse)AuthorAgeFilesLines
* Delegate ActiveRecord::Base.offset to scoped methods (analogous to limit) ↵Marcelo Giorgi2010-09-241-1/+1
| | | | | | [#5688 state:resolved] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
* use instance_eval, reduce method calls.Stevie Graham2010-09-211-15/+7
| | | | | | | | | | | | | | | | execution time in seconds for `rake test_sqlite3`: ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-darwin10.4.0] - before: 52.771426, 52.159505, 52.937056 - after: 51.452584, 51.897017, 51.584431 rubinius 1.0.1 (1.8.7 release 2010-06-03 JI) [x86_64-apple-darwin10.4.0] - before: 284.334076 - after: 285.753028 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0] - before: 75.811548, 75.533153, 75.353122 - after: 75.244243, 75.19226, 75.256925
* Cache unserialized attributesJeremy Kemper2010-09-091-6/+5
|
* refactor a couple injects to map + Hash[]Aaron Patterson2010-09-081-5/+2
|
* avoid an inject in favor of dupAaron Patterson2010-09-081-3/+3
|
* serialized attributes should be serialized before validation [#5525 ↵Aaron Patterson2010-09-071-2/+2
| | | | state:resolved]
* no need to freeze this stringAaron Patterson2010-09-071-1/+1
|
* unscoped has nothing so merging with a relation just returns the relationSantiago Pastorino2010-09-071-1/+1
|
* Cleanup deprecation warnings in active recordCarlos Antonio da Silva2010-09-061-22/+2
| | | | Signed-off-by: José Valim <jose.valim@gmail.com>
* Revert "Setup explicit requires for files with exceptions. Removed them from ↵José Valim2010-09-021-1/+0
| | | | | | | | autoloading." Booting a new Rails application does not work after this commit [#5359 state:open] This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
* Setup explicit requires for files with exceptions. Removed them from ↵Łukasz Strzałkowski2010-09-021-0/+1
| | | | | | autoloading. Signed-off-by: José Valim <jose.valim@gmail.com>
* Reset default scope in Thread.current when class is unloaded [#5497 ↵Andrew White2010-09-011-0/+8
| | | | | | state:resolved] Signed-off-by: Xavier Noria <fxn@hashref.com>
* Replacing superclass_delegating_accessoror with class_attribute.Neeraj Singh2010-08-311-1/+1
| | | | | | | :store_full_sti_class will have value true or false so there is no danger of mutability here. Signed-off-by: José Valim <jose.valim@gmail.com>
* :nodoc:s #unscoped until its behavior is more clear, now sometimes works, ↵Xavier Noria2010-08-251-1/+1
| | | | sometimes not
* Merge remote branch 'docrails/master'Xavier Noria2010-08-251-0/+5
|\
| * unscoped does not work when chained with named_scopeNeeraj Singh2010-08-231-0/+5
| |
* | fix broken relative links [#5415 state:committed]Joost Baaij2010-08-241-1/+1
|/ | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Fix docs to reference ActiveRecord::LogSubscriberEvgeniy Dolzhenko2010-08-211-1/+1
| | | | since Rails::LogSubscriber doesn't seem to be defined anymore
* Optimize find_sti_class when store_full_sti_class is trueAndrew White2010-08-191-1/+5
| | | | | | [#5403] Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
* Memoize STI class lookups for the duration of a requestJeremy Kemper2010-08-191-2/+2
|
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-87/+87
| | | | 's/[ \t]*$//' -i {} \;)
* Removing most of the symbol to proc usage in Active RecordPrem Sichanugrist2010-08-131-3/+3
| | | | This will hopefully make Active Record run a bit more faster.
* commit review: applies guidelines to "# =>"Xavier Noria2010-08-121-2/+2
|
* updating documentation for named_scope and default_scopeNeeraj Singh2010-08-121-0/+10
|
* Merge remote branch 'docrails/master'Xavier Noria2010-08-051-9/+9
|\
| * fixing documentationNeeraj Singh2010-08-031-9/+9
| |
* | I'm unsure how cloning was working in Rails 3 beforewycats2010-08-041-1/+1
|/
* Correcting the documentation which wrongly states that each dynamic finder ↵Neeraj Singh2010-08-021-7/+4
| | | | | | | creates method on the class. Only dynamic finders using <tt>scoped_by_*</tt> creates new methods.
* Adding to AR::Base documentation about dynamically scopeded_by queryNeeraj Singh2010-08-021-9/+17
| | | | User.scoped_by_user_name('David')
* updating documentation to ensure line does not exceed 100 columnsNeeraj Singh2010-08-021-88/+128
|
* slight performance improvement when grabbing an arel tableAaron Patterson2010-07-271-1/+1
|
* Don't interpolate a blank string, avoid warningsSantiago Pastorino2010-07-261-0/+2
|
* Fixes syntax error in "with_scope" exampleArkadiusz Holko2010-07-251-1/+1
|
* 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>