Skip to content

Commit

Permalink
Add documentation about Rails 4 & 5
Browse files Browse the repository at this point in the history
  • Loading branch information
trptcolin committed Oct 27, 2017
1 parent ed97491 commit fc976ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 6 deletions.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ source "https://rubygems.org"

# Specify your gem's dependencies in consistency_fail.gemspec
gemspec

gem 'pry'
26 changes: 21 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,35 @@ database-level enforcement is lacking there as well.
For more detail, see [my blog post on the
subject](http://blog.8thlight.com/articles/2011/6/11/winning-at-consistency).


## Installation

I'm currently only maintaining consistency\_fail for Rails 3. If you need or
want Rails 2.3 support, I'd be happy to take patches based off the 0.1.1
branch.
You can install the gem directly:

gem install consistency_fail

Or, even better if you're using bundler, add it to your Gemfile, with the
appropriate version number to match your Rails version.
Or if you're using Bundler (which you probably are), add it to your Gemfile.

gem 'consistency_fail'


## Limitations

The master branch should work for the following ActiveRecord versions:

- 5.x
- 4.x (*has a known issue around views*)
- 3.x
- 2.3 (on the `rails-2.3` branch)

The known issue with views in ActiveRecord 4.x is that in this version, the
connection adapter's `tables` method includes both tables and views. This means
that without additional monkeypatches to the various connection adapters, we
cannot reliably detect whether a given model is backed by a table or a view. I
wouldn't mind monkeypatching a bounded set of adapters, but I don't want to be
on the hook for arbitrary connection adapters that may require licenses to test
(e.g. SQL Server, Oracle).

consistency\_fail depends on being able to find all your `ActiveRecord::Base`
subclasses with some `$LOAD_PATH` trickery. If any models are in a path either
not on your project's load path or in a path that doesn't include the word
Expand Down
2 changes: 1 addition & 1 deletion consistency_fail.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ stop ignoring the C in ACID.
EOF
s.license = "MIT"

s.add_development_dependency "activerecord", "~>3.0"
s.add_development_dependency "activerecord", "~>5.0"
s.add_development_dependency "sqlite3", "~>1.3"
s.add_development_dependency "rspec", "~>3.2"

Expand Down

0 comments on commit fc976ba

Please sign in to comment.