- 24 9月, 2013 1 次提交
-
-
由 kennyj 提交于
-
- 23 9月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
-
- 19 9月, 2013 1 次提交
-
-
由 Aaron Patterson 提交于
or even be numbers, so sorting by id doesn't make sense. Please use `sort_by` and specify the attribute you wish to sort with. For example, change: Post.all.to_a.sort to: Post.all.to_a.sort_by(&:id)
-
- 13 9月, 2013 2 次提交
-
-
由 Paul Nikitochkin 提交于
In order to remove duplication with joining arel where constraints with `AND`, all constraints on `build_arel` are collapsed into one head node: `Arel::Nodes::And` Closes: #11963
-
由 Rafael Mendonça França 提交于
[ci skip]
-
- 12 9月, 2013 2 次提交
-
-
由 Rafael Mendonça França 提交于
When the adapter is with prepared statement disabled and the binds array is not empty the connection adapter will try to set the binds values and will fail. Now we are checking if the adapter has the prepared statement disabled. Fixes #12023
-
由 Dylan Thacker-Smith 提交于
-
- 11 9月, 2013 1 次提交
-
-
由 thedarkone 提交于
The original code ignores the `false` value because `false.blank? # => true`.
-
- 10 9月, 2013 1 次提交
-
-
由 Lann Martin 提交于
When first or last is called with an integer on an unloaded association, the entire collection is loaded. This differs surprisingly from the behavior of Relation#first/last, which translate the call into a limit query. For large collections this can make a big difference in performance. Change CollectionAssociation#fetch_first_or_last_using_find? to make this kind of call delegate to Relation.
-
- 09 9月, 2013 2 次提交
-
-
由 Ryan Wallace 提交于
-
由 Ryan Wallace 提交于
-
- 04 9月, 2013 2 次提交
-
-
由 Paul Nikitochkin 提交于
-
由 Ben Woosley 提交于
The primary means of returning results for Array bang methods is to modify the array in-place. When you call these methods on a relation, that array is created, modified, and then thrown away. Only the secondary return value is exposed to the caller. Removing this delegation is a straight-forward way to reduce user error by forcing callers to first explicitly call #to_a in order to expose the array to be acted on by the bang method.
-
- 30 8月, 2013 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
- 29 8月, 2013 1 次提交
-
-
由 Ben Cherry 提交于
-
- 27 8月, 2013 1 次提交
-
-
由 Mikhail Dieterle 提交于
add changelog entry for #11945
-
- 26 8月, 2013 1 次提交
-
-
由 Yves Senn 提交于
Closes #11899.
-
- 21 8月, 2013 1 次提交
-
-
由 Yves Senn 提交于
-
- 19 8月, 2013 1 次提交
-
-
由 Xavier Noria 提交于
-
- 15 8月, 2013 1 次提交
-
-
由 Paul Nikitochkin 提交于
In order that set attribute should not be bang method
-
- 12 8月, 2013 2 次提交
-
-
由 Ben Woosley 提交于
Restore the use of `#add_to_target` for nested attribute updates on existing records, and don't bother updating the association if the update is going to be rejected anyway. This requires adding a `skip_callbacks` argument to `#add_to_target` so that we don't call the callbacks multiple times in this case, which is functionally an application of existing association data, rather than an addition of a new record to the association.
-
由 Dr.(USA) Joerg Schray 提交于
Issue #1: :before_add callback is called when nested attributes assignment assigns to existing record if the association is not yet loaded Issue #2: Nested Attributes assignment does not affect the record in the association target when callback triggers loading of the association
-
- 10 8月, 2013 1 次提交
-
-
由 Eric Tipton 提交于
If 'enable_extension' is used in a migration's 'change' method, use 'disable_extension' on down migration (and vice-versa).
-
- 08 8月, 2013 2 次提交
- 06 8月, 2013 2 次提交
-
-
由 Rafael Mendonça França 提交于
[ci skip]
-
由 schneems 提交于
If the `db/` directory is not present on a remote machine it will blow up in unexpected ways with error messages that do not indicate there is a missing directory: ``` SQLite3::CantOpenException: unable to open database file ``` This PR checks to see if a directory exists for the sqlite3 file and if not creates it for you. This PR is an alternative to #11692 as suggested by @josevalim
-
- 02 8月, 2013 3 次提交
-
-
由 Carlos Antonio da Silva 提交于
-
由 Paul Nikitochkin 提交于
Closes: #11706
-
由 Rajarshi Das 提交于
-
- 30 7月, 2013 1 次提交
-
-
由 Rafael Mendonça França 提交于
order on the old ones The previous behavior added a major backward incompatibility since it impossible to have a upgrade path without major changes on the application code. We are taking the most conservative path to be consistent with the idea of having a smoother upgrade on Rails 4. We are reverting the behavior for what was in Rails 3.x and, if needed, we will implement a new API to prepend the order clauses in Rails 4.1.
-
- 29 7月, 2013 1 次提交
-
-
由 sgrif 提交于
This adds the ability for rails apps or gems to have granular control over how a domain object is converted to sql. One simple use case would be to add support for Regexp. Another simple case would be something like the following: class DateRange < Struct.new(:start, :end) def include?(date) (start..end).cover?(date) end end class DateRangePredicate def call(attribute, range) attribute.in(range.start..range.end) end end ActiveRecord::PredicateBuilder.register_handler(DateRange, DateRangePredicate.new) More complex cases might include taking a currency object and converting it from EUR to USD before performing the query. By moving the existing handlers to this format, we were also able to nicely refactor a rather nasty method in PredicateBuilder.
-
- 22 7月, 2013 4 次提交
-
-
由 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.
-
由 Ben Woosley 提交于
This includes fixing typos in changelog, removing a deprecated mocha/setup test require, and preferring the `column_for_attribute` accessor over direct access to the columns_hash in the new code.
-
由 Alfred Wong 提交于
When calling quote_value the underlying connection sometimes requires more information about the column to properly return the correct quoted value. I ran into this issue when using optimistic locking in JRuby and the activerecord-jdbcmssql-adapter. In SQLSever 2000, we aren't allowed to insert a integer into a NVARCHAR column type so we need to format it as N'3' if we want to insert into the NVARCHAR type. Unfortuantely, without the column type being passed the connection adapter cannot properly return the correct quote value because it doesn't know to return N'3' or '3'. This patch is fairly straight forward where it just passes in the column type into the quote_value, as it already has the ability to take in the column, so it can properly handle at the connection level. I've added the tests required to make sure that the quote_value method is being passed the column type so that the underlying connection can determine how to quote the value.
-
由 Vipul A M 提交于
Fixes #11497 As `ActiveRecord::ConnectionAdapters::ConnectionManagement` middleware does not rescue from Exception (but only from StandardError), the Connection Pool quickly runs out of connections when multiple erroneous Requests come in right after each other. Recueing from all exceptions and not just StandardError, fixes this behaviour.
-
- 17 7月, 2013 1 次提交
-
- 16 7月, 2013 3 次提交
-
-
由 awilliams 提交于
Using the mysql2 adapter, boolean values were sometimes being incorrectly cast to 't' or 'f'. This changes the cast to match the mysql adapter behavior, ie 1 and 0.
-
由 Yves Senn 提交于
-
由 Arun Agrawal 提交于
for attributes that are columns.
-