From 0933deb20e7020bb3967c14aa63d99f848d432a9 Mon Sep 17 00:00:00 2001 From: Nick Gervasi Date: Sun, 9 Aug 2015 22:52:47 -0700 Subject: [PATCH] bump version to v0.0.7 and update readme --- CHANGELOG.md | 11 ++++++++++- README.md | 21 +++++++++++++++++---- lib/broken_record/version.rb | 2 +- 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a7a6488..6a0cd54 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,4 +17,13 @@ ## v0.0.6 -* Allow classes_to_skip and default_scope keys to be strings as well as classes \ No newline at end of file +* 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 diff --git a/README.md b/README.md index 13f1f06..163aa54 100644 --- a/README.md +++ b/README.md @@ -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| @@ -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 ``` diff --git a/lib/broken_record/version.rb b/lib/broken_record/version.rb index cfcaa15..99fd485 100644 --- a/lib/broken_record/version.rb +++ b/lib/broken_record/version.rb @@ -1,3 +1,3 @@ module BrokenRecord - VERSION = "0.0.6" + VERSION = '0.0.7' end