1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activerecord/lib/active_record
Ryuta Kamizono e450a4a497 Fix average on decimal and enum attributes
Follow up to #40351 and #41418.

This fixes `average` on decimal and enum (on integer in general)
attributes to not do `type.deserialize`.

The precision and the scale on the column might be lower than the
calculated result.

And also, mapping the calculated result to enum label is quite
meaningless, the mapping result is almost nil.
2021-02-13 15:07:48 +09:00
..
associations Enable scoping to apply to all queries 2021-02-11 16:03:55 -05:00
attribute_methods Allow multiple decorations which can be used by such like EncryptedType 2021-01-17 11:38:40 +09:00
coders Update rubocop-performance gem and enable Performance/DeletePrefix and Performance/DeleteSuffix cops 2020-05-24 12:51:35 +03:00
connection_adapters Fix unprepared_statement to work it when nesting 2021-02-12 22:47:27 +09:00
database_configurations Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
fixture_set feat(rubocop): Add Style/RedundantRegexpEscape 2020-12-08 18:57:09 +00:00
locale
locking Restore the ability that update/destroy optimistic locking object without default 2021-01-12 09:27:11 +09:00
middleware Make AR::Middleware::DatabaseSelector loadable without full core ext 2020-06-09 19:43:50 +09:00
migration Ensure migration version is 7.0 2021-02-04 12:54:38 -05:00
railties Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
relation Fix average on decimal and enum attributes 2021-02-13 15:07:48 +09:00
scoping Allow reload to be default_scoped 2020-12-11 13:24:56 -05:00
tasks Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
type Use bind_call(obj, ...) instead of bind(obj).call(...) 2021-02-08 17:01:23 +09:00
type_caster Use Arel::Table#type_for_attribute 2020-06-03 06:30:22 +09:00
validations MySQL: Uniqueness validator now respects default database collation 2020-10-30 00:25:46 +00:00
aggregations.rb Use Enumerator#all? and Enumerator#any? with classes instead of iterations 2021-02-07 01:29:50 -05:00
association_relation.rb Allow build multiple records even on non association relation 2021-02-08 21:48:27 +09:00
associations.rb Remove unused requires on lib/active_record/associations.rb 2021-02-06 12:54:22 -03:00
asynchronous_queries_tracker.rb Allow Adapter#select_all to be performed asynchronously from a background thread pool 2021-02-08 19:17:52 +01:00
attribute_assignment.rb Use Enumerator#all? and Enumerator#any? with classes instead of iterations 2021-02-07 01:29:50 -05:00
attribute_methods.rb Make sure that attribute_for_inspect respect filter_attributes 2020-12-02 23:01:34 +00:00
attributes.rb Allow serialize attribute on alias_attribute 2021-02-08 20:47:19 +09:00
autosave_association.rb Remove checks for Module#method_defined? arity 2021-02-07 19:30:43 -05:00
base.rb Refactoring the code to not add methods to all models 2021-02-01 23:26:04 +00:00
callbacks.rb Document metaprogrammed Active Record callbacks [ci-skip] 2020-11-06 21:22:07 -06:00
connection_adapters.rb Fix autoload for NullPool 2021-02-09 11:58:25 -05:00
connection_handling.rb Expose primary_abstract_class public API 2021-01-27 15:01:59 -05:00
core.rb Allow Adapter#select_all to be performed asynchronously from a background thread pool 2021-02-08 19:17:52 +01:00
counter_cache.rb
database_configurations.rb Use Enumerator#all? and Enumerator#any? with classes instead of iterations 2021-02-07 01:29:50 -05:00
delegated_type.rb Fixing delegated types example. 2021-01-25 12:17:39 -05:00
destroy_association_async_job.rb Destroy associations in a background job. 2020-09-24 14:24:15 -04:00
dynamic_matchers.rb
enum.rb Merge pull request #41370 from kamipo/serialized_attribute_on_alias_attribute 2021-02-08 15:08:54 -05:00
errors.rb Merge pull request #40037 from Shopify/ar-adapter-async-query 2021-02-08 14:06:00 -05:00
explain.rb Should not substitute binds when prepared_statements: true 2020-05-10 21:59:27 +09:00
explain_registry.rb
explain_subscriber.rb
fixtures.rb Merge pull request #41227 from seanpdoyle/active-record-fixture-set-hook 2021-01-26 18:59:46 -05:00
future_result.rb Add ActiveRecord::Result.empty 2021-02-11 10:55:01 -05:00
gem_version.rb Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
inheritance.rb Set ApplicationRecord to primary_abstract_class 2021-02-05 17:02:08 -05:00
insert_all.rb timestamp_attributes_for_update_in_model is a public method 2021-01-02 11:09:30 +09:00
integration.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
internal_metadata.rb Eagerly define attribute methods for internal models 2020-11-06 23:46:16 +00:00
legacy_yaml_adapter.rb Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
log_subscriber.rb Allow Adapter#select_all to be performed asynchronously from a background thread pool 2021-02-08 19:17:52 +01:00
migration.rb Fixes a typo and some cosmetic changes for migration documentation added in #40806 [ci skip] 2021-02-12 10:04:45 +05:30
model_schema.rb Rails 6.2 is now Rails 7.0 2021-02-04 16:47:16 +00:00
nested_attributes.rb
no_touching.rb
null_relation.rb
persistence.rb Extract primary key constraints hash to a method. 2021-02-12 15:20:32 -05:00
query_cache.rb Revert "Merge pull request #41046 from eileencodes/dont-check-if-qc-is-enabled" 2021-01-27 09:31:43 -05:00
querying.rb Add ActiveRecord::FinderMethods#sole, #find_sole_by 2020-12-30 00:33:32 +11:00
railtie.rb Allow Adapter#select_all to be performed asynchronously from a background thread pool 2021-02-08 19:17:52 +01:00
readonly_attributes.rb
reflection.rb Raise error when passing passing a class to :source_type 2021-01-20 12:44:35 +01:00
relation.rb Use +/<tt> instead of ` in the rdoc [ci skip] 2021-02-12 12:56:44 +09:00
result.rb Add ActiveRecord::Result.empty 2021-02-11 10:55:01 -05:00
runtime_registry.rb Get rid of the unused RuntimeRegistry.connection_handler 2020-08-05 14:16:56 +02:00
sanitization.rb Strip whitespace in disallow_raw_sql! 2021-02-04 16:51:58 -05:00
schema.rb
schema_dumper.rb Add basic support for check constraints to database migrations 2020-06-02 22:11:27 -07:00
schema_migration.rb Eagerly define attribute methods for internal models 2020-11-06 23:46:16 +00:00
scoping.rb Enable scoping to apply to all queries 2021-02-11 16:03:55 -05:00
secure_token.rb
serialization.rb has_attribute? should be aware of attribute aliases 2020-06-03 00:59:35 +09:00
signed_id.rb Docs: fix code formatting [ci skip] 2020-12-14 20:43:17 -05:00
statement_cache.rb Fix CI failure when prepared_statements: false 2020-06-25 02:12:35 +09:00
store.rb Attribute reader / writer methods are defined as public methods 2020-10-02 22:23:38 +09:00
suppressor.rb save and save! doesn't take positional arguments 2020-05-05 16:51:21 +09:00
table_metadata.rb Fix complicated has_many through with nested where condition 2021-01-05 11:40:04 +09:00
test_databases.rb
test_fixtures.rb Share connection pools for non-default shards 2020-10-29 22:52:23 +00:00
timestamp.rb Restore attribute alias resolution for attribute_{for_inspect,present?} 2020-06-14 10:34:38 +09:00
touch_later.rb Ensure alias resolved before clear_attribute_changes 2020-06-04 12:02:28 +09:00
transactions.rb add new module to handle queueing of jobs to enqueue after commit is successful 2021-01-27 15:33:25 -05:00
translation.rb
type.rb attribute should not require a connection is established 2021-02-02 15:04:23 +09:00
type_caster.rb
validations.rb
version.rb