aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/relation/where_chain_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* raise `ArgumentError` exception if `Model.where.not` is called with `nil` ↵Kuldeep Aggarwal2013-12-301-0/+6
| | | | argument
* Added ActiveRecord::QueryMethods#rewhere which will overwrite an existing, ↵David Heinemeier Hansson2013-11-021-0/+30
| | | | named where condition.
* stop calling to_sym when building arel nodes [CVE-2013-1854]Aaron Patterson2013-03-151-10/+15
|
* Rollback where.like and where.not_likeCarlos Antonio da Silva2012-12-071-17/+2
| | | | | | | | | | | | | | | | | | | The real win with these chain methods is where.not, that takes care of different scenarios in a graceful way, for instance when the given value is nil. where("author.id != ?", author_to_ignore.id) where.not("author.id", author_to_ignore.id) Both where.like and where.not_like compared to the SQL versions doesn't seem to give us that much: Post.where("title LIKE 'ruby on%'") Post.where.like(title: 'ruby on%'") Post.where("title NOT LIKE 'ruby on%'") Post.where.not_like(title: 'ruby on%'") Thus Rails is adding where.not, but not where.like/not_like and others.
* Document the types of arguments accepted by AR#notclaudiob2012-12-071-0/+12
| | | | | | | | This commit stems from https://github.com/rails/rails/pull/8332#issuecomment-11127957 Since the formats in which conditions can be passed to `not` differ from the formats in which conditions can be passed to `like` and `not_like`, then I think it's worth adding rdoc and tests to show this behavior
* Fix where.not with in clauseCarlos Antonio da Silva2012-12-071-1/+1
| | | | | | Arel::Nodes::In inherits from Arel::Nodes::Equality, so the case statement was always using the Equality operator for both scenarios, resulting in a not equal query instead.
* Relation.where with no args can be chained with not, like, and not_likeAkira Matsuda2012-11-301-0/+78
examples: Model.where.not field: nil #=> "SELECT * FROM models WHERE field IS NOT NULL Model.where.like name: 'Jeremy%' #=> "SELECT * FROM models WHERE name LIKE 'Jeremy%' this feature was originally suggested by Jeremy Kemper https://github.com/rails/rails/pull/5950#issuecomment-5591330 Closes #5950