Issue in OR condition

22 views
Skip to first unread message

harshad

unread,
Jul 6, 2012, 1:35:03 AM7/6/12
to rubyonra...@googlegroups.com
Hi,

I have a issue in OR confition in where clause. Use rails 3  +  mongoDB (Mongoid). Please send me any solutions asap.
I have a condition: where({:target_device_os_max_ver => appver.to_s} || {:target_device_os_min_ver => appver.to_s})

Thanks

Pravin Mishra

unread,
Jul 6, 2012, 1:39:21 AM7/6/12
to rubyonra...@googlegroups.com
where(:target_device_os_max_ver => appver.to_s).or(:target_device_os_min_ver => appver.to_s)


--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/GxHcseqBTNAJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en-US.

harshad

unread,
Jul 6, 2012, 1:44:55 AM7/6/12
to rubyonra...@googlegroups.com
Hi,

I solve my isseu

where(:$or => [{:target_device_os_max_ver => appver.to_s},{:target_device_os_min_ver => appver.to_s}])
Reply all
Reply to author
Forward
0 new messages