- 15 1月, 2018 3 次提交
-
-
由 Mehmet Emin INAC 提交于
-
由 Ryuta Kamizono 提交于
Currently `object.save` will unfreeze the object, due to `changes_applied` replaces frozen `@attributes` to new `@attributes`. Since originally destroyed objects are not allowed to be mutated, `save` and `save!` should not return success in that case. Fixes #28563.
-
由 Ryuta Kamizono 提交于
If `collation` is given without `charset`, it may generate invalid SQL. For example `create_database(:matt_aimonetti, collation: "utf8mb4_bin")`: ``` > CREATE DATABASE `matt_aimonetti` DEFAULT CHARACTER SET `utf8` COLLATE `utf8mb4_bin`; ERROR 1253 (42000): COLLATION 'utf8mb4_bin' is not valid for CHARACTER SET 'utf8' ``` In MySQL, charset is used to find the default collation. If `collation` is given explicitly, it is not necessary to give extra charset.
-
- 14 1月, 2018 2 次提交
-
-
由 Ryuta Kamizono 提交于
Because `Relation` already have Arel `table`.
-
由 Ryuta Kamizono 提交于
This is a complete fix to #30995. Originally alias tracker will only track table aliases on `Arel::Nodes::Join`, other args are ignored. Since c5ab6e51, parent aliases hash will be passed then it caused the regression #30995. It is enough to pass list of `Arel::Nodes::Join` simply, not need to pass garbage args which will be ignored.
-
- 11 1月, 2018 5 次提交
-
-
由 Ryuta Kamizono 提交于
This option was moved into active_record_deprecated_finders in ac4d101a.
-
由 Lars Kanis 提交于
pg-1.0.0 is just released and most Gemfiles don't restrict it's version. But the version is checked when connecting to the database, which leads to the following error: Gem::LoadError: can't activate pg (~> 0.18), already activated pg-1.0.0 See also this pg issue: https://bitbucket.org/ged/ruby-pg/issues/270/pg-100-x64-mingw32-rails-server-not-start Preparation for pg-1.0 was done in commit f28a3310, but the pg version constraint was not yet relaxed.
-
由 Ryuta Kamizono 提交于
`find_with_associations` is meaningless name in this point since it just contain `construct_join_dependency` and `apply_join_dependency`, does not contain finding anything. If `apply_join_dependency` returns `relation` and `join_dependency` then `find_with_associations` is no longer needed.
-
由 Ryuta Kamizono 提交于
`relation.exists?` just wants to know if there is a result or not, does not need the exact records matched. Therefore, an intermediate SELECT query for eager loading is not necessary.
-
由 Bart de Water 提交于
[ci skip] setting :inverse_of works with :as, :through and :polymorphic options, and is needed for bi-directionality with a scope [ci skip] Remove :conditions opion from association basics guide This got replaced by scopes.
-
- 10 1月, 2018 3 次提交
-
-
由 Ryuta Kamizono 提交于
Need reloading when through record has replaced.
-
由 Ryuta Kamizono 提交于
I removed redundant `Array.wrap(records)` since `Preloader` is nodoc class and Active Record always pass `records` as an array to `Preloader`. But if users relies on that behavior, it is not worth dropping its behavior. Fixes #31661.
-
由 Brian Christian 提交于
-
- 07 1月, 2018 6 次提交
-
-
由 Ryuta Kamizono 提交于
Currently deleting through records doesn't respect `source_type`. It should not be ignored in that case. Related #23209. Fixes #24116.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
We can use `relation.last(index)[-index]` instead of loading all records when using reversible order because `last` will call `reverse_order`.
-
由 Ryuta Kamizono 提交于
Currently `last` with `offset` behaves incorrectly because `offset` can not be reversed like `limit`. Therefore, `offset` should also be handled like `limit`.
-
由 Ryuta Kamizono 提交于
-
由 Ryuta Kamizono 提交于
Commit 4ec5b0d6 was for fixing the regression #18787, but #28379 fixes #18787 as well. So 4ec5b0d6 is no longer necessary.
-
- 05 1月, 2018 1 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of 09cac8c6.
-
- 04 1月, 2018 4 次提交
-
-
由 Ryuta Kamizono 提交于
This is a partial revert of #26182. There is no reason to change the default value.
-
由 Ryuta Kamizono 提交于
Currently reflections keeps the order when first added even if when redefining association. As a result of the order, redefining through association which use newly added association will raise `HasManyThroughOrderError`. We need to redefine reflection order as well when redefining association. Fixes #31068.
-
由 Ryuta Kamizono 提交于
This method which is used only in the internal was introduced in ac384820 and was renamed in #17579. It does not need to be exposed.
-
由 yuuji.yaginuma 提交于
An empty string is an invalid value in Ruby's range class. So need to handle `Float::INFINITY` as it is and cast it in `encode_range`. Fixes #31612
-
- 01 1月, 2018 3 次提交
-
-
由 Ryuta Kamizono 提交于
Follow up of #31606.
-
由 Ryuta Kamizono 提交于
This method was introduced in #26718, which is internally used only in `CollectionAssociation`. There is no need to be in the reflection classes.
-
由 Ryuta Kamizono 提交于
Refactor delegating `join_primary_key` instead of `join_keys` and `association_primary_key` in `TableMetadata` Because `join_primary_key` is called by `join_keys` and it is to abstract calling `association_primary_key`.
-
- 31 12月, 2017 1 次提交
-
-
由 fatkodima 提交于
-
- 30 12月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
We can't replace existing SELECT list as long as having DISTINCT, it will cause incorrect result. And also, PostgreSQL has a limitation that ORDER BY expressions must appear in select list for SELECT DISTINCT. Therefore, we should not replace existing SELECT list when using DISTINCT. Fixes #29779.
-
- 29 12月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
We can't replace existing select list as long as referenced by ORDER BY.
-
- 27 12月, 2017 1 次提交
-
-
由 Bogdan Gusiev 提交于
when model is added to collection association
-
- 26 12月, 2017 2 次提交
-
-
由 Ryuta Kamizono 提交于
Originally I tried to add `assert_equal pk.sql_type, ref.sql_type`. But the assert failed even though the same type due to `sql_type` of primary key in SQLite is upper case. Prefer lower case like other types.
-
由 fatkodima 提交于
-
- 22 12月, 2017 1 次提交
-
-
由 Mike Busch 提交于
update_attribute previously stopped execution, before saving and before running callbacks, if the record's attributes hadn't changed. [The documentation](http://api.rubyonrails.org/classes/ActiveRecord/Persistence.html#method-i-update_attribute) says that "Callbacks are invoked", which was not happening if the persisted attributes hadn't changed.
-
- 20 12月, 2017 5 次提交
-
-
由 Ivan Zinovyev 提交于
-
由 Ryuta Kamizono 提交于
Follow up of #31177.
-
由 Ryuta Kamizono 提交于
Like other query bang methods.
-
由 Eugene Kenny 提交于
The `app:update` rake task will regenerate `development.rb` so that it contains this option; that means we're currently adding it to existing apps in two places, which is unnecessary and confusing. Also: - Remove inaccurate comment about which stack frames are ignored - Clarify that the feature uses `caller_locations`, not `caller` - Remove unused return value in `extract_callstack`
-
由 Ryuta Kamizono 提交于
Currently `count(:all)` with `distinct` doesn't work correctly because SELECT list is always replaced to `*` or primary key in that case even if having custom SELECT list. And also, PostgreSQL has a limitation that ORDER BY expressions must appear in select list for SELECT DISTINCT. Therefore, we should not replace custom SELECT list when using `count(:all)` with `distinct`. Closes #31277.
-
- 19 12月, 2017 1 次提交
-
-
由 Ryuta Kamizono 提交于
Otherwise it will occur syntax error if primary key is a reserved word.
-