Skip to content

Commit

Permalink
Back port #303 to 2.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
tfausak committed Oct 2, 2015
1 parent cebba64 commit b07c6fe
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions lib/active_interaction/filters/array_filter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,16 @@ def method_missing(*, &block)
# @return [Array<Class>]
def classes
result = [Array]
return result unless Object.const_defined?(:ActiveRecord)
return result unless ActiveRecord.const_defined?(:Relation)

result.push(ActiveRecord::Relation)
%w[
ActiveRecord::Relation
ActiveRecord::Associations::CollectionProxy
].each do |name|
next unless (klass = name.safe_constantize)
result.push(klass)
end

result
end

# @param filter [Filter]
Expand Down

0 comments on commit b07c6fe

Please sign in to comment.