Revision 16802
Added by Jean-Philippe Lang almost 8 years ago
sandbox/rails-5.1/app/models/query.rb | ||
---|---|---|
619 | 619 |
|
620 | 620 |
# Add multiple filters using +add_filter+ |
621 | 621 |
def add_filters(fields, operators, values) |
622 |
if fields.is_a?(Array) && operators.is_a?(Hash) && (values.nil? || values.is_a?(Hash))
|
|
622 |
if fields.present? && operators.present?
|
|
623 | 623 |
fields.each do |field| |
624 | 624 |
add_filter(field, operators[field], values && values[field]) |
625 | 625 |
end |
sandbox/rails-5.1/lib/plugins/acts_as_attachable/lib/acts_as_attachable.rb | ||
---|---|---|
90 | 90 |
if attachments.is_a?(Array) |
91 | 91 |
@failed_attachment_count = 0 |
92 | 92 |
attachments.each do |attachment| |
93 |
next unless attachment.is_a?(Hash)
|
|
93 |
next unless attachment.present?
|
|
94 | 94 |
a = nil |
95 | 95 |
if file = attachment['file'] |
96 | 96 |
a = Attachment.create(:file => file, :author => author) |
Also available in: Unified diff
Don't check the class.