alecdotninja / active_record_distinct_on

Support for `DISTINCT ON` statements when querying with ActiveRecord
MIT License
34 stars 11 forks source link

Fix arel_attribute deprecation #14

Closed yosiat closed 2 years ago

yosiat commented 2 years ago

Error:

ActiveSupport::DeprecationException:
  DEPRECATION WARNING: arel_attribute is deprecated and will be removed from Rails 6.2
./vendor/bundle/ruby/2.7.0/gems/active_record_distinct_on-1.1.0/lib/active_record_distinct_on/distinct_on_query_methods.rb:35:in `block in distinct_on!'
./vendor/bundle/ruby/2.7.0/gems/active_record_distinct_on-1.1.0/lib/active_record_distinct_on/distinct_on_query_methods.rb:31:in `map!'
./vendor/bundle/ruby/2.7.0/gems/active_record_distinct_on-1.1.0/lib/active_record_distinct_on/distinct_on_query_methods.rb:31:in `distinct_on!'
./vendor/bundle/ruby/2.7.0/gems/active_record_distinct_on-1.1.0/lib/active_record_distinct_on/distinct_on_query_methods.rb:26:in `distinct_on'

arel_attribute is going to be deprecated (see: https://github.com/rails/rails/pull/39881), using arel_table instead.

yosiat commented 2 years ago

@alecdotninja can you please give it a look?

alecdotninja commented 2 years ago

Thanks for your work on this, @yosiat . I'm sorry to keep you waiting.

I would merge, but it looks like CI for this project is not actually running. I'll pull everything down and verify it this weekend. :smile:

yosiat commented 2 years ago

@alecdotninja if you want, I can do a PR for setting-up a CI using Github Actions (I created one for panko, and it's simple - https://github.com/panko-serializer/panko_serializer/blob/master/.github/workflows/ruby.yml)

alecdotninja commented 2 years ago

Thank you for getting this fixed, @yosiat ! This is now released in v1.2.0. :tada: