1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/test/cases/relation
Patrick Rebsch 2d6088ced5 Retain selections with includes and joins
Applying `includes` and `joins` to a relation that selected additional
database fields would cause those additional fields not to be included
in the results even though they were queried from the database:

    posts = Post.select('1 as other').includes(:tbl).joins(:tbl)

    posts.to_sql.include?('1 as other')       #=> true
    posts.first.attributes.include?('other')  #=> false

This commit includes these additionally selected fields in the
instantiated results.
2019-12-03 20:45:12 -05:00
..
delegation_test.rb Add missing touch_all delegation to relation 2019-04-05 16:13:40 +09:00
delete_all_test.rb Revert unused code and re-using query annotation for update_all and delete_all 2019-04-01 15:04:11 +09:00
merging_test.rb Add Relation#annotate for SQL commenting 2019-03-21 20:30:56 -07:00
mutation_test.rb Fix order with custom attributes 2019-02-17 02:44:37 +09:00
or_test.rb All of queries should return correct result even if including large number 2019-01-18 16:01:07 +09:00
predicate_builder_test.rb Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
record_fetch_warning_test.rb Use frozen-string-literal in ActiveRecord 2017-07-19 22:27:07 +03:00
select_test.rb Retain selections with includes and joins 2019-12-03 20:45:12 -05:00
update_all_test.rb Remove tests that limit/offset without order which is non-deterministic result 2019-10-18 04:21:51 +09:00
where_chain_test.rb Refactor Active Record to let Arel manage bind params 2017-07-24 09:07:24 -04:00
where_clause_test.rb Enable Layout/EmptyLinesAroundAccessModifier cop 2019-06-13 12:00:45 +09:00
where_test.rb Improve deprecation message for nested where.not condition 2019-10-31 05:31:02 +09:00