| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
| |
`lengh` should be `length`
|
|
|
|
| |
database_tasks instead of Migrator
|
|
|
|
|
|
|
|
| |
Apparently I managed to forget how similar the "tests passing" and
"no status reported" merge indicators look.
Note that the previous `stubs` in test_add_index wasn't working:
the method was still called, and just happened to return false.
|
|\
| |
| |
| |
| |
| | |
greysteil/support-postgres-drop-index-concurrently
Support dropping indexes concurrently in Postgres
|
| |
| |
| |
| |
| | |
See http://www.postgresql.org/docs/9.4/static/sql-dropindex.html
for more details.
|
|/ |
|
| |
|
|
|
|
| |
[Rafael Mendonça França + Jean Boussier]
|
|
|
|
|
|
| |
This is fix of #11826 which miss to add `disable_extension` to
`ReversibleAndIrreversibleMethods`. So `CommandRecorder#method_missing`
catches `change_column_default` and @delegate's method is called.
|
|
|
|
|
|
|
|
| |
Closes #21418.
Previously schema names were not quoted. This leads to issues when a
schema names contains a ".". Methods in `schema_statements.rb` should
quote user input.
|
| |
|
| |
|
|\
| |
| | |
Removed duplicate requires
|
| | |
|
|/
|
|
|
|
|
|
| |
This fixes the following warning.
```ruby
warning: assigned but unused variable - index_definition
```
|
|\
| |
| | |
Removed mocha from Active Record Part 1
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is fix of #20018 which removes `change_column_default` from
array, so `CommandRecorder#method_missing` catches
`change_column_default` and @delegate's method is called.
This PR
* fix this bug
* define `ReversibleAndIrreversibleMethods` const making clear
which this array means to prevent these miss
|
|\ \
| | |
| | | |
Add `assert_nothing_raised` to make clear test case perpose
|
| | | |
|
| | | |
|
| |/
|/| |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since after 87d1aba3c `dependent: :destroy` callbacks on has_one
assocations run *after* destroy, it is possible that a nullification is
attempted on an already destroyed target:
class Car < ActiveRecord::Base
has_one :engine, dependent: :nullify
end
class Engine < ActiveRecord::Base
belongs_to :car, dependent: :destroy
end
> car = Car.create!
> engine = Engine.create!(car: car)
> engine.destroy! # => ActiveRecord::ActiveRecordError: cannot update a
> destroyed record
In the above case, `engine.destroy!` deletes `engine` and *then* triggers the
deletion of `car`, which in turn triggers a nullification of `engine.car_id`.
However, `engine` is already destroyed at that point.
Fixes #21223.
|
|/
|
|
|
|
| |
Remove `MigrationTest#connection` and write `ActiveRecord::Base.connection`
directly to test, because `MigrationTest#connection` is only used in
`test_migration_instance_has_connection`.
|
|
|
|
|
|
|
|
| |
Closes #21304.
While we can validate uniqueness for record without primary key on
creation, there is no way to exclude the current record when
updating. (The update itself will need a primary key to work correctly).
|
|
|
|
|
|
|
|
|
|
| |
As of MySQL 5.7.8, MySQL supports a native JSON data type.
Example:
create_table :json_data_type do |t|
t.json :settings
end
|
|\
| |
| |
| | |
Correct error message in Standard American english and add a test cas…
|
|/
|
|
| |
the same.
|
|\
| |
| |
| | |
Require explicit counter_cache option for has_many
|
| |
| |
| |
| |
| | |
Assert that counter_cache behaviour is not used on belongs_to or
has_many associations if the option is not given explicitly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously has_many associations assumed a counter_cache was to be used
based on the presence of an appropriately named column. This is
inconsistent, since the inverse belongs_to association will not make
this assumption. See issues #19042 #8446.
This commit checks for the presence of the counter_cache key in the
options of either the has_many or belongs_to association as well as
ensuring that the *_count column is present.
|
|\ \
| | |
| | | |
Prevent duplicating `where` clauses
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
class
Fixes #19528
fix for mysql2 test
better test
|
| | |
| | |
| | |
| | | |
Closes #21201.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As described in the "Follow Coding Conventions" section in our
contribution guide (http://edgeguides.rubyonrails.org/contributing_to_ruby_on_rails.html#follow-the-coding-conventions)
we favor `assert_not` over `refute`.
While we don't usually make stylistic changes on it's own I opted to do
it in this case. The reason being that test cases are usually copied as
a starting point for new tests. This results in a spread of `refute` in
files that have been using it already.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If the through class has default scopes we should skip the statement
cache.
Closes #20745.
|
|\ \ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add method to run command-line db apps
Conflicts:
activerecord/CHANGELOG.md
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
- Added run_cmd() class method to dry up Kernel.system() messages within
this namespace and avoid shell expansion by passing a list of
arguments instead of a string
- Update structure_dump, structure_load, and related tests units to
pass a list of params instead of using a string to
avoid shell expansion
|
|\ \ \ \
| | | | |
| | | | | |
use correct DB connection for generated HABTM table
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This includes the following classes:
- ActiveModel::Serializers::Xml
- ActiveRecord::Serialization::XmlSerializer
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`in_batches` yields Relation objects if a block is given, otherwise it
returns an instance of `BatchEnumerator`. The existing `find_each` and
`find_in_batches` methods work with batches of records. The new API
allows working with relation batches as well.
Examples:
Person.in_batches.each_record(&:party_all_night!)
Person.in_batches.update_all(awesome: true)
Person.in_batches.delete_all
Person.in_batches.map do |relation|
relation.delete_all
sleep 10 # Throttles the delete queries
end
|
|\ \ \ \ |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use memoization for collection associations ids reader
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes #21082
remove extra space
|
|/ / / / /
| | | | |
| | | | |
| | | | | |
encapsulate all arguments
|
|\ \ \ \ \
| |_|/ / /
|/| | | |
| | | | | |
Add #cache_key to ActiveRecord::Relation.
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Fix misleading errors for has_one through relations
|