- 29 7月, 2013 1 次提交
-
-
由 Neeraj Singh 提交于
This method is already present in helper.rb
-
- 22 7月, 2013 1 次提交
-
-
由 Ben Woosley 提交于
Some adapters require column information to do their job properly. By enforcing the provision of the column for this internal method we ensure that those using adapters that require column information will always get the proper behavior.
-
- 10 5月, 2013 1 次提交
-
-
由 Ben Woosley 提交于
The combination of a :uniq => true association and the #distinct call in #construct_limited_ids_condition combine to create invalid SQL, because we're explicitly selecting DISTINCT, and also sending #distinct on to AREL, via the relation#distinct_value. Rather than build a select distinct clause in #construct_limited_ids_condition, I set #distinct! and pass just the columns into the select statement. This requires introducing a #columns_for_distinct method to return the select columns but not the statement itself.
-
- 02 5月, 2013 1 次提交
-
-
由 Godfrey Chan 提交于
When using symbol keys, ActiveRecord will now translate aliased attribute names to the actual column name used in the database: With the model class Topic alias_attribute :heading, :title end The call Topic.where(heading: 'The First Topic') should yield the same result as Topic.where(title: 'The First Topic') This also applies to ActiveRecord::Relation::Calculations calls such as `Model.sum(:aliased)` and `Model.pluck(:aliased)`. This will not work with SQL fragment strings like `Model.sum('DISTINCT aliased')`. Github #7839 *Godfrey Chan*
-
- 27 4月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
-
- 24 4月, 2013 1 次提交
-
-
由 Andrew White 提交于
-
- 15 3月, 2013 1 次提交
-
-
由 Yves Senn 提交于
The similarity of `Relation#uniq` to `Array#uniq` is confusing. Since our Relation API is close to SQL terms I renamed `#uniq` to `#distinct`. There is no deprecation. `#uniq` and `#uniq!` are aliases and will continue to work. I also updated the documentation to promote the use of `#distinct`.
-
- 09 2月, 2013 1 次提交
-
-
由 Guillermo Iguaran 提交于
-
- 08 2月, 2013 1 次提交
-
-
由 robertomiranda 提交于
-
- 03 1月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
Conflicts: activerecord/lib/active_record/dynamic_matchers.rb
-
- 14 11月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Nothing should be raised anyway
😄 Thanks @spastorino❤ https://github.com/rails/rails/pull/8202/files#r2112067
-
- 13 11月, 2012 1 次提交
-
-
由 Nikita Afanasenko 提交于
-
- 09 9月, 2012 1 次提交
-
-
由 Ernie Miller 提交于
When calling a query method on an attribute that was not selected by an ActiveRecord query, an ActiveModel::MissingAttributeError is not raised. Instead, a nil value is returned, which will return false once cast to boolean. This is undesirable, as we should not give the impression that we know the attribute's boolean value when we haven't loaded the attribute's (possibly) non-boolean value from the database. This issue is present on versions going back as far as 2.3, at least.
-
- 03 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
On reflection, it seems like a bit of a weird method to have on ActiveRecord::Base, and it shouldn't be needed most of the time anyway.
-
- 28 7月, 2012 2 次提交
-
-
由 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 提交于
It doesn't serve much purpose now that ActiveRecord::Base.all returns a Relation. The code is moved to active_record_deprecated_finders.
-
- 27 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
Previously it returned an Array. If you want an array, call e.g. `Post.to_a` rather than `Post.all`. This is more explicit. In most cases this should not break existing code, since Relations use method_missing to delegate unknown methods to #to_a anyway.
-
- 25 6月, 2012 1 次提交
-
-
由 Egor Lynko 提交于
`FinderMethods#exists?` finder method now returns *false* with the *false* argument
-
- 22 6月, 2012 1 次提交
-
-
由 Maximilian Schneider 提交于
previously dynamic finders only worked in combination with the actual column name and not its alias defined with #alias_attribute
-
- 19 6月, 2012 1 次提交
-
-
由 Steve Klabnik 提交于
This feature adds a lot of complication to ActiveRecord for dubious value. Let's talk about what it does currently: class Customer < ActiveRecord::Base composed_of :balance, :class_name => "Money", :mapping => %w(balance amount) end Instead, you can do something like this: def balance @balance ||= Money.new(value, currency) end def balance=(balance) self[:value] = balance.value self[:currency] = balance.currency @balance = balance end Since that's fairly easy code to write, and doesn't need anything extra from the framework, if you use composed_of today, you'll have to add accessors/mutators like that. Closes #1436 Closes #2084 Closes #3807
-
- 11 6月, 2012 3 次提交
-
-
由 Yasuo Honda 提交于
-
由 Ben Woosley 提交于
reflection. ActiveRecord::FinderMethods#construct_limited_ids_condition will raise ThrowResult if the limited reflection comes back empty. The other callers of #construct_limited_ids_condition handle this exception (more specifically, the callers of construct_relation_for*), but #exists? didn't until now.
-
由 Rafael Mendonça França 提交于
This behavior was added in be4ecdcc. Closes #1139. Fixes #2553, #1141, #1623 and #2062.
-
- 06 6月, 2012 1 次提交
-
-
由 Akira Matsuda 提交于
Module#methods are Symbols in Ruby >= 1.9
-
- 18 5月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 11 5月, 2012 1 次提交
-
-
由 Andrew White 提交于
-
- 05 5月, 2012 1 次提交
-
-
由 Marcelo Silveira 提交于
-
- 03 5月, 2012 2 次提交
-
-
由 Marcelo Silveira 提交于
-
由 Marcelo Silveira 提交于
default order clause (fixes #5103)
-
- 27 4月, 2012 7 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 26 4月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 14 4月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-