Test multiple values with blank value
This commit is contained in:
parent
c08ee7f142
commit
4774fa0d26
@ -1359,12 +1359,11 @@ def preprocess_order_args(order_args)
|
||||
end
|
||||
|
||||
def sanitize_order_arguments(order_args)
|
||||
order_args.compact_blank!
|
||||
order_args.map! do |arg|
|
||||
klass.sanitize_sql_for_order(arg)
|
||||
end
|
||||
order_args.flatten!
|
||||
order_args
|
||||
order_args.compact_blank!
|
||||
end
|
||||
|
||||
def column_references(order_args)
|
||||
|
@ -2204,6 +2204,13 @@ def test_find_by_with_take_memoization
|
||||
assert_empty authors
|
||||
end
|
||||
|
||||
(ActiveRecord::Relation::MULTI_VALUE_METHODS - [:extending]).each do |method|
|
||||
test "#{method} with blank value" do
|
||||
authors = Author.public_send(method, [""])
|
||||
assert_empty authors.public_send(:"#{method}_values")
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
def custom_post_relation(alias_name = "omg_posts")
|
||||
table_alias = Post.arel_table.alias(alias_name)
|
||||
|
Loading…
Reference in New Issue
Block a user