- 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 5 次提交
-
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
Reason: all *_value methods are defined dynamically and so don't appear in the documentation.
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
- 14 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 13 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 08 7月, 2012 3 次提交
-
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
- 07 7月, 2012 3 次提交
-
-
由 Vijay Dev 提交于
-
由 Oscar Del Ben 提交于
-
- 06 7月, 2012 3 次提交
-
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
由 Oscar Del Ben 提交于
-
- 28 6月, 2012 1 次提交
-
-
由 Subba Rao Pasupuleti 提交于
-
- 26 6月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Try to use more destructive methods on *args when applicable, to avoid creating new objects.
-
- 23 6月, 2012 1 次提交
-
-
由 Vijay Dev 提交于
-
- 22 6月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 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
-
- 18 6月, 2012 1 次提交
-
-
由 David Paschich 提交于
Based on examples seen in the Rails test suite. [ci skip]
-
- 17 6月, 2012 3 次提交
-
-
由 Florent Guilleux 提交于
-
由 Ulises Cabanillas 提交于
-
由 Florent Guilleux 提交于
-
- 01 6月, 2012 1 次提交
-
-
由 Akira Matsuda 提交于
now we can invoke previously added scope extension methods
-
- 24 5月, 2012 1 次提交
-
- 20 5月, 2012 1 次提交
-
-
由 Henrik Hodne 提交于
For future reference, this is the regex I used: ^\s*#\s*\n(?!\s*#). Replace with the first match, and voilà! Note that the regex matches a little bit too much, so you probably want to `git add -i .` and go through every single diff to check if it actually should be changed.
-
- 17 5月, 2012 1 次提交
-
-
由 Radoslav Stankov 提交于
Record.from("(#{sub_query.to_sql})") -> Record.from(sub_query) Record.from("(#{sub_query.to_sql}) a") -> Record.from(sub_query, :a)
-
- 12 5月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
This helps bring the interfaces of CollectionProxy and Relation closer together, and reduces the delegation backflips we need to perform. For example, first_or_create is defined thus: class ActiveRecord::Relation def first_or_create(...) first || create(...) end end If CollectionProxy < Relation, then post.comments.first_or_create will hit the association's #create method which will actually add the new record to the association, just as post.comments.create would. With the previous delegation, post.comments.first_or_create expands to post.comments.scoped.first_or_create, where post.comments.scoped has no knowledge of the association.
-