Is it possible to have OR conditions using named scope ??
For e.g. Gather users based on following or conditions.
1. active is one named scope which finds all users whose state is active
2. OR user id is in 1,2,3
This condition can be written in only one named scope as
named_scope :active_or_explicit, lambda{ |ids|
{ :conditions => ['state = ? OR id in (?)', 'active', [1,2,3]] }
}
Is it possible to have two named scopes that can be joined using OR condition.
Please let me know your views...
--
Sandip
---
www.funonrails.com
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.