aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/models/category.rb
Commit message (Collapse)AuthorAgeFilesLines
* Use frozen-string-literal in ActiveRecordKir Shatrov2017-07-191-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Delegate `ast` and `locked` to `arel` explicitlyRyuta Kamizono2017-05-061-0/+9
| | | | | | | | Currently `ast` and `locked` are used in the internal but delegating to `arel` is depend on `method_missing`. If a model class is defined these methods, `select_all` will be broken. It should be delegated to `arel` explicitly.
* modernizes hash syntax in activerecordXavier Noria2016-08-061-14/+14
|
* applies new string literal convention in activerecord/testXavier Noria2016-08-061-9/+9
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Pass a base relation to build_default_scope when joiningMatt Jones2014-02-211-0/+1
| | | | | This allows the default scope to be built using the current table alias. Resolves #12770
* Goodbye there, very special rubbish!Akira Matsuda2013-01-241-5/+0
|
* Convert association macros to the new syntaxJon Leighton2012-07-201-9/+9
|
* Deprecate eager-evaluated scopes.Jon Leighton2012-03-211-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't use this: scope :red, where(color: 'red') default_scope where(color: 'red') Use this: scope :red, -> { where(color: 'red') } default_scope { where(color: 'red') } The former has numerous issues. It is a common newbie gotcha to do the following: scope :recent, where(published_at: Time.now - 2.weeks) Or a more subtle variant: scope :recent, -> { where(published_at: Time.now - 2.weeks) } scope :recent_red, recent.where(color: 'red') Eager scopes are also very complex to implement within Active Record, and there are still bugs. For example, the following does not do what you expect: scope :remove_conditions, except(:where) where(...).remove_conditions # => still has conditions
* Revert "Deprecate implicit eager loading. Closes #950."Jon Leighton2012-01-161-1/+1
| | | | This reverts commit c99d507fccca2e9e4d12e49b4387e007c5481ae9.
* Deprecate implicit eager loading. Closes #950.Jon Leighton2011-12-291-1/+1
|
* Merge branch 'master' into nested_has_many_throughJon Leighton2011-03-041-2/+5
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: activerecord/CHANGELOG activerecord/lib/active_record/association_preload.rb activerecord/lib/active_record/associations.rb activerecord/lib/active_record/associations/class_methods/join_dependency.rb activerecord/lib/active_record/associations/class_methods/join_dependency/join_association.rb activerecord/lib/active_record/associations/has_many_association.rb activerecord/lib/active_record/associations/has_many_through_association.rb activerecord/lib/active_record/associations/has_one_association.rb activerecord/lib/active_record/associations/has_one_through_association.rb activerecord/lib/active_record/associations/through_association_scope.rb activerecord/lib/active_record/reflection.rb activerecord/test/cases/associations/has_many_through_associations_test.rb activerecord/test/cases/associations/has_one_through_associations_test.rb activerecord/test/cases/reflection_test.rb activerecord/test/cases/relations_test.rb activerecord/test/fixtures/memberships.yml activerecord/test/models/categorization.rb activerecord/test/models/category.rb activerecord/test/models/member.rb activerecord/test/models/reference.rb activerecord/test/models/tagging.rb
| * Rewrote AssociationPreload.Jon Leighton2011-02-281-1/+2
| |
| * Test to verify that #2189 (count with has_many :through and a named_scope) ↵Jon Leighton2010-12-231-0/+2
| | | | | | | | is fixed
* | Fix naughty trailing whitespaceJon Leighton2010-10-311-1/+1
| |
* | Add ↵Jon Leighton2010-10-131-0/+2
|/ | | | test_has_many_through_has_and_belongs_to_many_with_has_many_source_reflection and make it work
* Fixed gruoped_by_title spelling [#5063 state:committed]Ben Somers2010-07-081-1/+1
| | | | Signed-off-by: Xavier Noria <fxn@hashref.com>
* Add :having option to find, to use in combination with grouped finds. Also ↵miloops2008-12-011-0/+1
| | | | | | | added to has_many and has_and_belongs_to_many associations. Signed-off-by: Michael Koziarski <michael@koziarski.com> [#1028 state:committed]
* Use select and change test so new tests can work on postgres.miloops2008-09-121-1/+1
| | | | Signed-off-by: Michael Koziarski <michael@koziarski.com>
* Improve test coverage when using the group option in find, has_many or ↵miloops2008-09-111-0/+3
| | | | | | has_and_belongs_to_many. Signed-off-by: Michael Koziarski <michael@koziarski.com>
* fix eager loading with dynamic findersBrandon Keepers2008-06-091-0/+1
|
* Allow association scoping for built/created records if :conditions is ↵Rick Olson2008-03-211-0/+3
| | | | | | specified as a hash. Closes #11393 [miloops] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9068 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
* move assets and modelsJeremy Kemper2008-01-181-0/+26
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8657 5ecf4fe2-1ee6-0310-87b1-e25e094e27de