- 26 2月, 2013 1 次提交
-
-
由 Yves Senn 提交于
Fixes #9275. When `#order` is called with a Symbol this patch will prepend the quoted_table_name. Before the postgresql adapter failed to build queries containg a join and an order with a symbol. This expansion happens for all adapters.
-
- 25 2月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
Taking the wise advice of @carlosantoniodasilva
-
- 21 2月, 2013 3 次提交
-
-
由 Xavier Noria 提交于
-
由 Xavier Noria 提交于
-
由 wangjohn 提交于
The function is now called has_arguments? so that it's easier to tell that it's just checking to see if the args are blank or not.
-
- 20 2月, 2013 2 次提交
-
-
由 wangjohn 提交于
for query methods in a where_clause. Also, modified the CHANGELOG entry because it had false information and added tests.
-
由 John J Wang 提交于
-
- 08 2月, 2013 3 次提交
-
-
由 Maurizio De Santis 提交于
-
由 Maurizio De Santis 提交于
-
由 Maurizio De Santis 提交于
-
- 25 1月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 09 12月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
* Fix example queries * Remove doc entries of where.like/not_like. * Remove :chain from where.not related docs. To me that's an implementation detail and we don't expect people to use where(:chain).not.
-
- 08 12月, 2012 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
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.
-
由 claudiob 提交于
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
-
- 07 12月, 2012 3 次提交
-
-
由 Carlos Antonio da Silva 提交于
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.
-
由 claudiob 提交于
This commit updates the rdoc of AR#where to match the changes applied in https://github.com/rails/rails/commit/6ba0f97 that is: * `where(nil)` has the same effect of `where('')`: a no op * `where` (no args) has the same effect of `where(:chain)`: to create a WhereChain
-
由 Carlos Antonio da Silva 提交于
Consider this scenario: if params[:foo] conditions = { foo: true } end foos = Foo.where(conditions).order(:id) When params[:foo] is nil, this would call: foos = Foo.where(nil).order(:id) In this scenario, we want Foo.where(conditions) to be the same as calling Foo.all, otherwise we'd get a "NoMethodError order for WhereChain". Related to #8332.
-
- 30 11月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
These are for internal use only and cannot be relied on as part of the public API. See discussion on 8c2c6051.
-
由 Akira Matsuda 提交于
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
-
- 10 11月, 2012 1 次提交
-
-
由 AvnerCohen 提交于
-
- 05 11月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 29 10月, 2012 1 次提交
-
-
由 Juanjo Bazán 提交于
-
- 16 10月, 2012 1 次提交
-
-
由 Aaron Patterson 提交于
allocations
-
- 13 10月, 2012 2 次提交
-
-
由 Aaron Patterson 提交于
Before: Calculating ------------------------------------- ar 87 i/100ms ------------------------------------------------- ar 823.4 (±11.8%) i/s - 4089 in 5.070234s After: Calculating ------------------------------------- ar 88 i/100ms ------------------------------------------------- ar 894.1 (±3.9%) i/s - 4488 in 5.028161s Same test as 3a6dfca7
-
由 Yves Senn 提交于
-
- 12 10月, 2012 1 次提交
-
-
由 Tima Maslyuchenko 提交于
-
- 05 10月, 2012 2 次提交
-
-
由 Santiago Pastorino 提交于
This reverts commit abf8de85. We should take a deeper look to those cases flat_map doesn't do deep flattening. irb(main):002:0> [[[1,3], [1,2]]].map{|i| i}.flatten => [1, 3, 1, 2] irb(main):003:0> [[[1,3], [1,2]]].flat_map{|i| i} => [[1, 3], [1, 2]]
-
由 Santiago Pastorino 提交于
-
- 13 9月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
In some circumstances engine was Arel::Table.engine which for separate reasons was an ActiveRecord::Model::DeprecationProxy, which caused a deprecation warning. In any case, we want the actual model class here, since we want to use it to infer information about associations.
-
- 12 9月, 2012 1 次提交
-
-
由 beerlington 提交于
Allows you to specify the model association key in a belongs_to relationship instead of the foreign key. The following queries are now equivalent: Post.where(:author_id => Author.first) Post.where(:author => Author.first) PriceEstimate.where(:estimate_of_type => 'Treasure', :estimate_of_id => treasure) PriceEstimate.where(:estimate_of => treasure)
-
- 24 8月, 2012 1 次提交
-
-
由 Isaac Sanders 提交于
This is a cleaner version of #6916. Closes #3165.
-
- 03 8月, 2012 1 次提交
-
-
由 Xavier Noria 提交于
-
- 31 7月, 2012 1 次提交
-
-
由 Bogdan Gusiev 提交于
User.order("name asc").order("created_at desc") # SELECT * FROM users ORDER BY created_at desc, name asc This also affects order defined in `default_scope` or any kind of associations.
-
- 28 7月, 2012 3 次提交
-
-
由 Rafael Mendonça França 提交于
This reverts commit 14fc8b34. Reason: we need to discuss a better path from this removal. Conflicts: activerecord/lib/active_record/reflection.rb activerecord/test/cases/base_test.rb activerecord/test/models/developer.rb
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
-
- 22 7月, 2012 2 次提交
- 17 7月, 2012 2 次提交
-
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-