Rails 4+:
Article.where.not(title: ['Rails 3', 'Rails 5'])
Rails 3:
Topic.where('id NOT IN (?)', Array.wrap(actions))
Where actions
is an array with: [1,2,3,4,5]
More Related Contents:
- Rails extending ActiveRecord::Base
- How to change default timezone for Active Record in Rails?
- Rails :include vs. :joins
- ActiveModel::ForbiddenAttributesError when creating new user
- Rails ActiveRecord date between
- ActiveRecord OR query
- Rails 4 scope to find parents with no children
- Random record in ActiveRecord
- What is the easiest way to duplicate an activerecord record?
- ActiveRecord: size vs count
- Connecting Rails 3.1 with Multiple Databases
- ActiveRecord OR query Hash notation
- How to chain scope queries with OR instead of AND?
- Combine two ActiveRecord::Relation objects
- Rails 5: ActiveRecord OR query
- Rails where condition using NOT NIL
- Clean way to find ActiveRecord objects by id in the order specified
- Rails – Nested includes on Active Records?
- ActiveRecord Find By Year, Day or Month on a Date field
- Rails 3 SQLite3 Boolean false
- Add a reference column migration in Rails 4
- Float vs Decimal in ActiveRecord
- find vs find_by vs where
- How do you write a migration to rename an ActiveRecord model and its table in Rails?
- query , can not select column count
- Can I write PostgreSQL functions on Ruby on Rails?
- New data not persisting to Rails array column on Postgres
- Validate uniqueness of multiple columns
- What is the difference between pluck and collect in Rails?
- Changing a column type to longer strings in rails