Skip to content

Commit

Permalink
bump version to v0.0.7 and update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Gervasi committed Aug 10, 2015
1 parent 4a7d7c5 commit 0933deb
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 6 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,13 @@

## v0.0.6

* Allow classes_to_skip and default_scope keys to be strings as well as classes
* Allow classes_to_skip and default_scope keys to be strings as well as classes

## v0.0.7

* Make BrokenRecord work with colorize >= 0.5.8
* Allow BrokenRecord::Scanner to be used programmatically (i.e. from rails console)
* Remove assumption that all models are in app/models/**/*.rb
* Show backtrace when exception occurs during scan
* Change parallelization strategy to better distribute load across cores
* Add an after_fork hook
21 changes: 17 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,21 @@ To scan all records of all models in your project:
rake broken_record:scan
```

If you want to scan all records of a specific model (e.g. the User model)
If you want to scan all records of a specific model (e.g. the User model):

```bash
rake broken_record:scan[User]
```

You can also specify a list of models to scan:

```bash
rake broken_record:scan[Product,User]
```

## Configuration

BrokenRecord provides a configure method with two options. Here's an example:
BrokenRecord provides a configure method with multiple options. Here's an example:

```ruby
BrokenRecord.configure do |config|
Expand All @@ -48,11 +54,18 @@ BrokenRecord.configure do |config|
# Set a scope for which models should be validated
config.default_scopes = { Foo => proc { with_bars } }

# BrokenRecord will call the block provided in before_scan before scanning
# your records. This is useful for skipping validations you want to ignore.
# The follow block will be called before scanning your records.
# This is useful for skipping validations you want to ignore.
config.before_scan do
User.skip_callback :validate, :before, :user_must_be_active
end

# BrokenRecord uses the parallelize gem to distribute work across
# multiple cores. The following block will be called every time
# the process is forked (useful for re-establishing connections).
config.after_fork do
Rails.cache.reconnect if Rails.cache.respond_to? :reconnect
end
end
```

Expand Down
2 changes: 1 addition & 1 deletion lib/broken_record/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module BrokenRecord
VERSION = "0.0.6"
VERSION = '0.0.7'
end

0 comments on commit 0933deb

Please sign in to comment.