- 27 12月, 2014 27 次提交
-
-
由 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
-
由 Sean Griffin 提交于
As part of the larger refactoring to remove type casting from Arel, we need to do the casting of values eagerly. The predicate builder is the closest place that knows about the Active Record class, and can therefore have the type information. /cc @mrgilman [Sean Griffin & Melanie Gilman]
-
由 Sean Griffin 提交于
This class cares far too much about the internals of other parts of Active Record. This is an attempt to break out a meaningful object which represents the needs of the predicate builder. I'm not fully satisfied with the name, but the general concept is an object which represents a table, the associations to/from that table, and the types associated with it. Many of these exist at the `ActiveRecord::Base` class level, not as properties of the table itself, hence the need for another object. Currently it provides these by holding a reference to the class, but that will likely change in the future. This allows the predicate builder to remain wholy concerned with building predicates. /cc @mrgilman
-
由 Sean Griffin 提交于
-
由 Sean Griffin 提交于
I'm attempting to remove `klass` as a dependency of the predicate builder, in favor of an object that better represents what we're using it for. The only part of this which doesn't fit nicely into that picture is the check for an association being polymorphic. Since I'm not yet sure what that is going to look like, I've moved this logic into another class in an attempt to separate things that will change from things that won't.
-
由 Sean Griffin 提交于
This reduces the number of places which will need to care about single value or range specific logic as we introduce type casting. The array handler is only responsible for producing `in` statements. /cc @mrgilman [Sean Griffin & Melanie Gilman]
-
由 Sean Griffin 提交于
This will allow us to pass the predicate builder into the constructor of these handlers. The procs had to be changed to objects, because the `PredicateBuilder` needs to be marshalable. If we ever decide to make `register_handler` part of the public API, we should come up with a better solution which allows procs. /cc @mrgilman [Sean Griffin & Melanie Gilman]
-
由 Sean Griffin 提交于
We're accidentally documenting `PredicateBuilder` and `ArrayHandler` since there's a constant which is missing `# :nodoc:`
-
由 Sean Griffin 提交于
Construction of relations can be a hotspot, we don't want to create one of these in the constructor. This also allows us to do more expensive things in the predicate builder's constructor, since it's created once per AR::Base subclass
-
由 Sean Griffin 提交于
We don't memoize the relation instance
-
由 Sean Griffin 提交于
-
由 brainopia 提交于
-
由 Sean Griffin 提交于
I think we should deprecate this behavior and just error if you tell us to do a case insensitive comparison for types which are not case sensitive. Partially reverts 35592307 Fixes #18195
-
由 Robin Dupret 提交于
With rails/coffee-rails#61 (and #17241), the `.coffee` extension is favoured over `.js.coffee`. Respectively, with rails/sass-rails#271 `.scss` and `.sass` are favoured over `.css.scss` and `.css.sass`. Let's update the documentation to reflect that. [ci skip]
-
- 26 12月, 2014 12 次提交
-
-
由 Yves Senn 提交于
Dump the default `nil` for PostgreSQL UUID primary key.
-
由 Ryuta Kamizono 提交于
-
由 Guillermo Iguaran 提交于
Fixed warning `possible reference to past scope` from railties
-
由 Vipul A M 提交于
-
由 Guillermo Iguaran 提交于
Fixed AR warning on ruby 2.2
-
由 Guillermo Iguaran 提交于
Targeting 2.2
-
由 Guillermo Iguaran 提交于
Remove unnecessary double space
-
由 Guillermo Iguaran 提交于
Remove ActionController::ModelNaming
-
由 Kenta Okamoto 提交于
-
由 Kyle Decot 提交于
-
由 Zachary Scott 提交于
-
由 Vipul A M 提交于
-
- 25 12月, 2014 1 次提交
-
-
由 Matthew Draper 提交于
Check for Rails.env instead of Rails
-