diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/active_relation/extensions/base.rb | 1 | ||||
-rw-r--r-- | lib/active_relation/primitives/aggregation.rb | 2 |
2 files changed, 1 insertions, 2 deletions
diff --git a/lib/active_relation/extensions/base.rb b/lib/active_relation/extensions/base.rb index 8fe00146d2..0115586b00 100644 --- a/lib/active_relation/extensions/base.rb +++ b/lib/active_relation/extensions/base.rb @@ -21,7 +21,6 @@ class ActiveRecord::Base end # all of the below disables normal AR behavior. It's rather destructive and purely for demonstration purposes (see scratch_spec). - class ActiveRecord::Associations::BelongsToAssociation def instantiate(record, joins = []) @target = proxy_reflection.klass.instantiate(record, joins) diff --git a/lib/active_relation/primitives/aggregation.rb b/lib/active_relation/primitives/aggregation.rb index 20fdcf46c5..a3c7747165 100644 --- a/lib/active_relation/primitives/aggregation.rb +++ b/lib/active_relation/primitives/aggregation.rb @@ -10,7 +10,7 @@ module ActiveRelation end def to_sql(options = {}) - "#{function_sql}(@attribute.to_sql)" + "#{function_sql}(#{@attribute.to_sql})" end def ==(other) |