- 31 12月, 2014 2 次提交
-
-
由 Arthur Neves 提交于
When table has a composite primary key, the `primary_key` method for sqlite3 and postgresql was only returning the first field of the key. Ensures that it will return nil instead, as AR dont support composite pks.
-
由 Robin Dupret 提交于
-
- 30 12月, 2014 11 次提交
-
-
由 Yves Senn 提交于
Closes #7247. Conflicts: activerecord/CHANGELOG.md activerecord/test/models/owner.rb
-
由 claudiob 提交于
ActiveRecord::Base `save` and `save!` take an option boolean `:touch` parameter since #18225 (stems from #18202). This commit document that parameter. [ci skip]
-
由 Sean Griffin 提交于
Fixes #18237
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
This is no longer required now that we are injecting a type caster object into the Arel table, with the exception of uniqueness validations. Since it calls `ConnectionAdapter#type_cast`, the value has already been cast for the database. We don't want Arel to attempt to cast it further, so we need to continue wrapping it in a quoted node. This can potentially go away when this validator is refactored to make better use of `where` or the predicate builder.
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
This API will require much less consuming code to change to accomodate the removal of automatic type casting from Arel. As long as the predicates are constructed using the `arel_table` off of an AR subclass, there will be no changes that need to happen.
-
由 Rafael Mendonça França 提交于
It is already docummented at persistence.rb. [ci skip]
-
由 Takashi Kokubun 提交于
-
- 29 12月, 2014 2 次提交
-
-
由 Robin Dupret 提交于
-
由 Yves Senn 提交于
-
- 28 12月, 2014 7 次提交
-
-
由 Ryuta Kamizono 提交于
-
由 Dan Olson 提交于
-
由 Sean Griffin 提交于
We only support classes which provide a no-args constructor to use as a default value. We can provide a more helpful error message if we catch this when `serialize` is called, rather than letting it error when you try to assign the attribute. Fixes #18224
-
由 Ryuta Kamizono 提交于
Example: create_table :foos, id: :bigint do |t| end
-
由 Ryuta Kamizono 提交于
-
由 Yves Senn 提交于
/cc @sgrif
-
由 Yves Senn 提交于
Most of the documentation very closely mirrors the matching docs from `SchemaStatements`. I reduced duplicated copy and added links to the underlying methods for the user to follow.
-
- 27 12月, 2014 18 次提交
-
-
由 Ryuta Kamizono 提交于
Because call the `column` method and set the `options[:primary_key]` is handled at `super`, here need only treat the `options[:default]`.
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
Part of a larger refactoring to remove type casting behavior from Arel
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel.
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. We can inform it that we already have the right type by wrapping the value in an `Arel::Nodes::Quoted`. This commit can be reverted when we have removed type casting from Arel in Rail 5.1
-
由 Sean Griffin 提交于
There are several valid cases where right now we can't determine the association's class in a call to `where`. In these cases, we can fall back to casting by looking up the column from the connection adapter (which is what happens right now when we fall through to Arel) This is ugly, and since we're trying to separate the concept of a type from a column, I'd like to remove it in the future. The problem basically comes down to this: Liquid.joins(molecules: :electrons) .where("molecules.name" => "something", "electrons.name" => "something") The hash in this case will turn into: { molecules: { name: "something" }, electrons: { name: "something" }, } What we actually need is: { molecules: { name: "something", electrons: { name: "something" }, } } /cc @mrgilman
-
由 Sean Griffin 提交于
This code could use some much heavier refactoring. It looks like `build_relation` duplicates most of the logic of `Relation#where` and `PredicateBuilder` with regards to handling associations and attribute aliases
-
由 Sean Griffin 提交于
Part of the larger refactoring to remove type casting from Arel. Since we've already cast the value a few lines above, we don't need to re-cast it later. We can inform Arel of this by wrapping it in an `Arel::Nodes::Quoted`, which will no longer be required in Rails 5.1
-
由 Sean Griffin 提交于
We will always have the correct type for this query, so no casting is needed. We inform Arel that we already have the right type by wrapping it in an `Arel::Nodes::Quoted` (which we will no longer need to do in Rails 5.1)
-
由 Sean Griffin 提交于
This will allow eager type casting to take place as needed. There doesn't seem to be any particular reason that the `in` statement was forced for single values, and the commit message where it was introduced gives no context. See https://github.com/rails/rails/commit/d90b4e2615e8048fdeffc6dffe3246704adee01f
-
由 Sean Griffin 提交于
Part of a larger refactoring to remove type casting from Arel. /cc @mrgilman [Sean Griffin & Melanie Gilman]
-
由 Sean Griffin 提交于
A custom object is required for this, as you cannot build a range object out of `Arel::Nodes::Quoted` objects. Depends on the changes introduced in https://github.com/rails/arel/commit/cf03bd45e39def057a2f63e42a3391b7d750dece /cc @mrgilman
-