alecdotninja / active_record_distinct_on

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

incompatibility with 5.2 #4

Closed kshahkshah closed 6 years ago

kshahkshah commented 6 years ago

wrong number of arguments (given 1, expected 0)

    private

    def build_arel
      super.tap do |arel|
        build_distinct_on(arel, distinct_on_values)
      end
active_record_distinct_on (0.1.3) lib/active_record_distinct_on/distinct_on_query_methods.rb:38:in `build_arel'
activerecord (5.2.0) lib/active_record/relation/query_methods.rb:903:in `arel'
activerecord (5.2.0) lib/active_record/relation/calculations.rb:198:in `block in pluck'
activerecord (5.2.0) lib/active_record/relation.rb:578:in `skip_query_cache_if_necessary'
activerecord (5.2.0) lib/active_record/relation/calculations.rb:198:in `pluck'
activerecord (5.2.0) lib/active_record/schema_migration.rb:48:in `all_versions'
activerecord (5.2.0) lib/active_record/migration.rb:1059:in `get_all_versions'
activerecord (5.2.0) lib/active_record/migration.rb:1071:in `needs_migration?'
activerecord (5.2.0) lib/active_record/migration.rb:579:in `check_pending!'
activerecord (5.2.0) lib/active_record/migration.rb:556:in `call'

Looks like they changed the underlying API again

alecdotninja commented 6 years ago

Thanks for letting me know.

I'll push a fix out later tonight. I'm going to update the version constraint for activerecord in the gemspec to match what is actually being tested here so that we can whitelist new versions of activerecord instead of breaking at runtime.