Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Accepts string conditions (non array)

  • Loading branch information...
commit 2c8eff806c19d8c56dd39eac920b07e91124b13e 1 parent a99faf3
@treeder treeder authored
Showing with 7 additions and 1 deletion.
  1. +7 −1 lib/simple_record.rb
View
8 lib/simple_record.rb
@@ -861,6 +861,11 @@ def self.find(*params)
if params.size > 1
options = params[1]
end
+ conditions = options[:conditions]
+ if conditions && conditions.is_a?(String)
+ conditions = [conditions]
+ options[:conditions] = conditions
+ end
if !options[:shard_find] && is_sharded?
# then break off and get results across all shards
@@ -958,7 +963,8 @@ def self.paginate(options={})
def self.convert_condition_params(options)
return if options.nil?
conditions = options[:conditions]
- if !conditions.nil? && conditions.size > 1
+ return if conditions.nil?
+ if conditions.size > 1
# all after first are values
conditions.collect! { |x|
Translations.pad_and_offset(x)
Please sign in to comment.
Something went wrong with that request. Please try again.