Skip to content

Commit

Permalink
Merge branch 'nikhilmat-accept-aggregator'
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Gervasi committed Aug 28, 2015
2 parents 80ba2c7 + bd47ca8 commit 6c41f4b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions lib/broken_record/config.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
module BrokenRecord
module Config
extend self
attr_accessor :classes_to_skip, :before_scan_callbacks, :after_fork_callbacks, :default_scopes, :compact_output
attr_accessor :classes_to_skip, :before_scan_callbacks, :after_fork_callbacks,
:default_scopes, :compact_output, :aggregator_class
self.before_scan_callbacks = []
self.after_fork_callbacks = []
self.default_scopes = {}
self.compact_output = false
self.aggregator_klass = 'BrokenRecord::ResultAggregator'

def before_scan(&block)
self.before_scan_callbacks << block
Expand All @@ -15,4 +17,4 @@ def after_fork(&block)
self.after_fork_callbacks << block
end
end
end
end
2 changes: 1 addition & 1 deletion lib/broken_record/scanner.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
module BrokenRecord
class Scanner
def run(class_names)
ResultAggregator.new.tap do |aggregator|
BrokenRecord::Config.aggregator_klass.constantize.new.tap do |aggregator|
classes = classes_to_validate(class_names)

BrokenRecord::Config.before_scan_callbacks.each { |callback| callback.call }
Expand Down

0 comments on commit 6c41f4b

Please sign in to comment.