| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
`eager_load` preserves readonly flag for associations
|
| | |
|
| |
| |
| |
| |
| |
| | |
It is already docummented at persistence.rb.
[ci skip]
|
| | |
|
|\ \
| |/
|/|
| | |
Fix html_safe string access modifying frozen values
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
the object being accessed currently returns `html_safe?` as true,
we used to set `@html_safe` variable as true on new object created. When doing something like
x = 'Hello'.html_safe
x[/a/, 1]
would throw an error on ruby 2.2, since when nothign gets matched nil is returned by the code and it tries to set `@html_safe` value to true,
which would error since starting 2.2 nil is frozen.
This change adds a safety net to avoid setting `@html_safe = true` on frozen objects.
Fixes #18235
|
|\
| |
| | |
adjust args of Bundler.require in guides [ci skip]
|
|/
|
|
|
|
| |
Arguments of Bundler.require of generator has been changed from rails4.0.4.
https://github.com/rails/rails/blob/v4.0.4/railties/lib/rails/generators/rails/app/templates/config/application.rb#L16
|
|\
| |
| | |
Expectation comes first
|
|/ |
|
| |
|
|\
| |
| | |
Require Ruby 2.2 for Rails 5.0
|
| |
| |
| |
| |
| | |
Stems from [this comment](https://github.com/rails/rails/pull/18203#issuecomment-68138096) by @robin850
and by the blog post http://weblog.rubyonrails.org/2014/12/19/Rails-4-2-final
|
|\ \
| | |
| | | |
Actually autoload all second-level directories called `app/*/concerns`
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Update example test documentation
|
|/ / /
| | |
| | | |
Example does not work with session headers, should use request headers. [ci skip]
|
|\ \ \
| | | |
| | | | |
Fix warning: `*' interpreted as argument prefix
|
|/ / / |
|
|\ \ \
| | | |
| | | | |
Provide :touch option to save() to accommodate saving without updating t...
|
|/ / /
| | |
| | |
| | | |
timestamps. [#18202]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
|\ \ \
| | | |
| | | | |
Add bigint primary key support for MySQL.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Example:
create_table :foos, id: :bigint do |t|
end
|
|/ / / |
|
| | |
| | |
| | |
| | | |
/cc @sgrif
|
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| | |
| | |
| | |
| | | |
[ci skip]
|
|\ \ \
| | | |
| | | | |
Refactor `PostgreSQL::TableDefinition#primary_key`
|
|/ / /
| | |
| | |
| | |
| | | |
Because call the `column` method and set the `options[:primary_key]` is
handled at `super`, here need only treat the `options[:default]`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | | |
|
| | |
| | |
| | |
| | | |
Part of a larger refactoring to remove type casting behavior from Arel
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | | |
Part of the larger refactoring to remove type casting from Arel.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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)
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Part of a larger refactoring to remove type casting from Arel.
/cc @mrgilman
[Sean Griffin & Melanie Gilman]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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]
|