Skip to content

Commit

Permalink
from_value may be nil in rails 3 and 4
Browse files Browse the repository at this point in the history
  • Loading branch information
khiav reoy committed Aug 14, 2021
1 parent 1aac842 commit 1eaff50
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rails_or.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def spawn_relation(relation, method, condition)
new_relation = relation.klass.send(method, condition)

from_value = relation.send(FROM_VALUE_METHOD)
new_relation.send(ASSIGN_FROM_VALUE, from_value) if not from_value.empty?
new_relation.send(ASSIGN_FROM_VALUE, from_value) if from_value.present?

copy_values(new_relation, relation) if IS_RAILS5_FLAG
return new_relation
Expand Down

0 comments on commit 1eaff50

Please sign in to comment.