| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit ae96f229f6501d8635811d6b22d75d43cdb880a4.
Conflicts:
activerecord/CHANGELOG.md
activerecord/lib/active_record/attribute_methods.rb
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
`ActiveModel::Dirty#reset_changes`.
|
|/
|
|
| |
`silence_stderr`, `silence_stream`, `capture` and `quietly`.
|
|\
| |
| | |
`sql_type` has been determined already when quoting defaults
|
| |
| |
| |
| | |
No need to call `type_to_sql` again.
|
|\ \
| | |
| | |
| | |
| | | |
kamipo/stop_passing_the_column_when_quoting_defaults
Stop passing the column to the `quote` method when quoting defaults
|
| |/
| |
| |
| | |
Related the commit 8f8f8058e58dda20259c1caa61ec92542573643d.
|
|/
|
|
|
|
| |
Slightly refactoring `PostgreSQLColumn`. `array` should be readonly.
`default_function` should be initialized by `super`. `sql_type` has been
removed `[]`. Since we already choose to remove it we should not change.
|
|\
| |
| |
| |
| |
| |
| | |
Introduce explicit way of halting callback chains by throwing :abort. Deprecate current implicit behavior of halting callback chains by returning `false` in apps ported to Rails 5.0. Completely remove that behavior in brand new Rails 5.0 apps.
Conflicts:
railties/CHANGELOG.md
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This stems from [a comment](rails#17227 (comment)) by @dhh.
In summary:
* New Rails 5.0 apps will not accept `return false` as a way to halt callback chains, and will not display a deprecation warning.
* Existing apps ported to Rails 5.0 will still accept `return false` as a way to halt callback chains, albeit with a deprecation warning.
For this purpose, this commit introduces a Rails configuration option:
```ruby
config.active_support.halt_callback_chains_on_return_false
```
For new Rails 5.0 apps, this option will be set to `false` by a new initializer
`config/initializers/callback_terminator.rb`:
```ruby
Rails.application.config.active_support.halt_callback_chains_on_return_false = false
```
For existing apps ported to Rails 5.0, the initializers above will not exist.
Even running `rake rails:update` will not create this initializer.
Since the default value of `halt_callback_chains_on_return_false` is set to
`true`, these apps will still accept `return true` as a way to halt callback
chains, displaying a deprecation warning.
Developers will be able to switch to the new behavior (and stop the warning)
by manually adding the line above to their `config/application.rb`.
A gist with the suggested release notes to add to Rails 5.0 after this
commit is available at https://gist.github.com/claudiob/614c59409fb7d11f2931
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Before this commit, returning `false` in an ActiveRecord `before_` callback
such as `before_create` would halt the callback chain.
After this commit, the behavior is deprecated: will still work until
the next release of Rails but will also display a deprecation warning.
The preferred way to halt a callback chain is to explicitly `throw(:abort)`.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After this commit, returning `false` in a callback will display a deprecation
warning to make developers aware of the fact that they need to explicitly
`throw(:abort)` if their intention is to halt a callback chain.
This commit also patches two internal uses of AS::Callbacks (inside
ActiveRecord and ActionDispatch) which sometimes return `false` but whose
returned value is not meaningful for the purpose of execution.
In both cases, the returned value is set to `true`, which does not affect the
execution of the callbacks but prevents unrequested deprecation warnings from
showing up.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This commit changes arguments and default value of CallbackChain's :terminator
option.
After this commit, Chains of callbacks defined **without** an explicit
`:terminator` option will be halted as soon as a `before_` callback throws
`:abort`.
Chains of callbacks defined **with** a `:terminator` option will maintain their
existing behavior of halting as soon as a `before_` callback matches the
terminator's expectation. For instance, ActiveModel's callbacks will still
halt the chain when a `before_` callback returns `false`.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before:
![before](https://cloud.githubusercontent.com/assets/10076/5592809/25ce08e8-9199-11e4-9dfe-5baa8bd6b658.png)
After:
![after](https://cloud.githubusercontent.com/assets/10076/5592810/25ceef9c-9199-11e4-88f4-d286203d7f6f.png)
[ci skip]
|
|\ \ \
| |_|/
|/| | |
Fully support datetime values in AR::Type::DateTime#type_cast_for_database
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add missing nodoc's
Change `assoc_klass` argument name to `association_klass`
Change `prev_reflection` argument name to `previous_reflection`
Change `prev` to `previous_reflection` in `#get_chain`
Switch use of `refl` and `reflection` in `#get_chain` so main parameter
is not abbreviated.
Add missing space in `#add_constraints`
|
| | |
| | |
| | |
| | |
| | | |
This moves the `#type_caster` from the `aliased_table_for` and into the
initialize of the `alias_tracker`.
|
| | |
| | |
| | |
| | |
| | | |
`yield` instead of relying on checking if the reflection is equal to the
`chain_head`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of initializing an empty connection use the base table name
instead. Split up and refactor `#create` to be 2 methods `#create` and
`#create_with_joins`. Removes the need to update the count by 1 on
initialzing a JoinDependency.
|
| | |
| | |
| | |
| | |
| | |
| | | |
This moves `alias_candidate` out of the `ReflectionProxy` and into the
`AbstractReflection` so it is shared by all reflections. Change
`alias_name` to a method and and remove assignment in `#get_chain`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
After the refactorings we're only using the connection and not the alias
tracker anymore. This builds on commit 18019.
Reuse the already available `@connection` to reduce the surface area of
the alias tracker's API. We can then remove the `attr_reader` because
the connection is already available.
|
| | |
| | |
| | |
| | | |
This makes the `#alias_name` more functional.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Move `RuntimeReflection` and `PolymorphicReflect` into Reflection. This
allows the methods to inherit from `ThroughReflection` and DRY up the
methods by removing duplicates.
|
| | |
| | |
| | |
| | |
| | |
| | | |
The linked list lets us use a loop in `#add_constraints` and completely
remove the need for indexing the iteration becasue we have access to the
next item in the chain.
|
| | |
| | |
| | |
| | |
| | |
| | | |
By concatnating the `ReflectionProxy` with the `chain` we remove
the need for `#construct_tables` because the `chain` is now in the
correct order (order of the chain DOES matter).
|
| | |
| | |
| | |
| | |
| | | |
Putting the `#alias_name` into ReflectionProxy means we don't have to
cache the `#alias_name` globally anymore - it's not cached per query.
|
| | |
| | |
| | |
| | |
| | |
| | | |
`is_first_chain`, `items` and `klass` are no longer beneficial and can
be called directly instead of via their assignments - because they are
each only used once.
|
| | |
| | |
| | |
| | |
| | | |
Move method structure into reflection classes for accessibly on each
reflection rather than by traversing the chain.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The `RuntimeReflection` class allows the reflection to be accessed at
runtime - then we always know which reflection we are accessing in the
chain. The `#get_chain` method then allows us to recursively access the
chain through the `RuntimeReflection`.
|
| | |
| | |
| | |
| | |
| | |
| | | |
`#constraints` builds a flattened version of `scope_chain` to
allow it to be accessible without requiring an index when iterating
over the `scope_chain`
|
| | |
| | |
| | |
| | | |
It already treats the message
|
| | | |
|
|\ \ \
| | | |
| | | | |
Refactor `visit_ChangeColumnDefinition`
|
| | | |
| | | |
| | | |
| | | | |
`visit_ChangeColumnDefinition` is the same "CHANGE column_name " + `visit_ColumnDefinition(o)`.
|
| | | |
| | | |
| | | |
| | | |
| | | | |
In most cases, `create_table_definition` called by table_name (the first
argument) only.
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
fix for messages in invalid encoding from db-drivers
Conflicts:
activerecord/lib/active_record/connection_adapters/abstract_adapter.rb
activerecord/test/cases/connection_adapters/abstract_adapter_test.rb
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | |
| | | | | |
Clear query cache on rollback
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Add setting of FK for throgh associations while building
Conflicts:
activerecord/CHANGELOG.md
activerecord/test/cases/associations/has_many_through_associations_test.rb
|
| | | | | | |
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Improve a dump of the primary key support.
Conflicts:
activerecord/CHANGELOG.md
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
If it is not a default primary key, correctly dump the type and options.
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
kamipo/format_datetime_string_according_to_precision
Format the datetime string according to the precision of the datetime field.
Conflicts:
activerecord/CHANGELOG.md
|