You would do
Person.where('name=? OR lastname=?', 'John', 'Smith')
Right now, there isn’t any other OR support by the new AR3 syntax (that is without using some 3rd party gem).
More Related Contents:
- ActiveRecord Find By Year, Day or Month on a Date field
- Validate uniqueness of multiple columns
- ActiveRecord OR query
- ActiveRecord: size vs count
- Connecting Rails 3.1 with Multiple Databases
- Eager load polymorphic
- ActiveRecord OR query Hash notation
- Rails order by results count of has_many association
- When to use a “has_many :through” relation in Rails?
- Rails 3: Get Random Record
- Rails 5: ActiveRecord OR query
- Setting session timeout in Rails 3
- Alias for column names in Rails
- Clean way to find ActiveRecord objects by id in the order specified
- Rails 3 devise, current_user is not accessible in a Model ?
- Rails 3 SQLite3 Boolean false
- Rails 3, has_one / has_many with lambda condition
- Rails update_attributes without save?
- Rails 3 – select with Include?
- query , can not select column count
- belongs_to through associations
- Check if record exists from controller in Rails
- Creating a PostgreSQL sequence to a field (which is not the ID of the record)
- Rails – Validate Presence Of Association?
- How to implement bulk insert in Rails 3
- PGError: ERROR: aggregates not allowed in WHERE clause on a AR query of an object and its has_many objects
- Specifying column name in a “references” migration
- Rails: Order with nulls last
- Purge or recreate a Ruby on Rails database
- How to change a Ruby on Rails application name?