- 17 9月, 2012 1 次提交
-
-
由 Steve Klabnik 提交于
The COUNT clause of a finder_sql relationship is being rewritten from COUNT(*) to COUNT(table_name.*). This does not appear to be valid syntax in MySQL: ``` mysql> SELECT COUNT( table_name.* ) FROM `table_name`; ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '* ) FROM `table_name`' at line 1 ``` This fixes the bug, as well as adding tests so we don't re-introduce it in the future. Fixes #3956.
-
- 11 8月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
It's not really a good idea to have this as a global config option. We should allow people to specify the behaviour per association. There will now be two new values: * :dependent => :restrict_with_exception implements the current behaviour of :restrict. :restrict itself is deprecated in favour of :restrict_with_exception. * :dependent => :restrict_with_error implements the new behaviour - it adds an error to the owner if there are dependent records present See #4727 for the original discussion of this.
-
- 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.
-
- 02 8月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
This reverts commit 3803fcce. Conflicts: activerecord/CHANGELOG.md It will be deprecated only in 4.0, and removed properly in 4.1.
-
- 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 1 次提交
-
-
由 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 7月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
Closes #1190
-
- 21 7月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
now everything is converted to the new style, this is not needed
-
由 Jon Leighton 提交于
-
- 18 7月, 2012 1 次提交
-
-
由 kennyj 提交于
-
- 13 7月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 30 6月, 2012 1 次提交
-
-
由 Brian Cardarella 提交于
-
- 12 6月, 2012 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 29 5月, 2012 1 次提交
-
-
由 Francesco Rodriguez 提交于
I found the next issue between CollectionAssociation `delete` and `destroy`. class Person < ActiveRecord::Base has_many :pets end person.pets.destroy(1) # => OK, returns the destroyed object person.pets.destroy("2") # => OK, returns the destroyed object person.pets.delete(1) # => ActiveRecord::AssociationTypeMismatch person.pets.delete("2") # => ActiveRecord::AssociationTypeMismatch Adding support for deleting with a fixnum or string like `destroy` method.
-
- 26 5月, 2012 1 次提交
-
-
由 Patrick Mahoney 提交于
The core of this fix is a threadsafe, fair Queue class. It is very similar to Queue in stdlib except that it supports waiting with a timeout. The issue this solves is that if several threads are contending for database connections, an unfair queue makes is possible that a thread will timeout even while other threads successfully acquire and release connections. A fair queue means the thread that has been waiting the longest will get the next available connection. This includes a few test fixes to avoid test ordering issues that cropped up during development of this patch.
-
- 19 5月, 2012 2 次提交
-
-
由 Piotr Sarnacki 提交于
The fix commited in e2a070cf was returning the `new_target`, as a try to return whatever user replaced association with. The problem is, the resulting association target may be ordered differently. In such case we want to return the target that will be later used for that association.
-
由 Jon Leighton 提交于
Bug #6289
-
- 18 5月, 2012 1 次提交
-
-
由 Jon Leighton 提交于
-
- 17 5月, 2012 1 次提交
-
-
由 Piotr Sarnacki 提交于
-
- 12 5月, 2012 2 次提交
-
-
由 Jon Leighton 提交于
Makes it consistent with Relation. Can't see a use for this.
-
由 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.
-
- 03 5月, 2012 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Change CollectionProxy#method_missing to use scoped.public_send, to avoid a problem described in issue #2508 when trying to use class methods with names like "open", that clash with private kernel methods. Also changed the dynamic matcher instantiator to send straight to scoped, to avoid another roundtrip to method_missing.
-
- 27 4月, 2012 8 次提交
-
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
由 Jon Leighton 提交于
-
- 09 3月, 2012 1 次提交
-
-
由 Alexey Vakhov 提交于
-
- 06 3月, 2012 1 次提交
-
-
由 Jean Boussier 提交于
-
- 02 2月, 2012 1 次提交
-
-
由 Manoj 提交于
-
- 01 2月, 2012 2 次提交
-
-
由 Rafael Mendonça França 提交于
-
由 gregolsen 提交于
-
- 31 1月, 2012 2 次提交
- 29 1月, 2012 1 次提交
-
-
由 Manoj 提交于
-