No release in over 3 years
Low commit activity in last 3 years
Backport of ActiveRecord::Base.ignored_columns into Rails 4 and 5.0
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

>= 4.0, < 5.1
>= 4.0, < 5.1
 Project Readme

activerecord-ignored_columns

Gem Version Build Status Code Climate Test Coverage

activerecord-ignored_columns is a backport of ActiveRecord::Base.ignored_columns (introduced in Rails 5) into Rails 4.
You can also use this gem for Rails 5.0 because it fixes one serious bug in the version (see PR #30980).

Installation

Add this line to your application's Gemfile:

gem 'activerecord-ignored_columns'

And then execute:

$ bundle

Usage

Set columns names that a model should ignore as follows:

class UserProfile < ActiveRecord::Base
  self.ignored_columns = %i(full_name)
end

Ignored columns won't have attribute accessors defined, and won't be referenced in SQL queries.

Contributing

You should follow the steps below.

  1. Fork the repository
  2. Create a feature branch: git checkout -b add-new-feature
  3. Commit your changes: git commit -am 'Add new feature'
  4. Push the branch: git push origin add-new-feature
  5. Send us a pull request

License

The gem is available as open source under the terms of the MIT License.