Class: ValidationErrorReporter::Runner
- Inherits:
-
Object
- Object
- ValidationErrorReporter::Runner
- Defined in:
- lib/validation_error_reporter/runner.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Runner
constructor
A new instance of Runner.
- #run ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Runner
Returns a new instance of Runner.
5 6 7 |
# File 'lib/validation_error_reporter/runner.rb', line 5 def initialize( = {}) @options = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/validation_error_reporter/runner.rb', line 3 def @options end |
Instance Method Details
#run ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/validation_error_reporter/runner.rb', line 9 def run Rails.application.eager_load! models = Entity.models_for([:models]) configuration = Configuration.new() reporter = Reporter.new(configuration) models.each do |model| model.find_each do |record| reporter.report(Error.new(record)) unless record.valid? end end reporter.finalize end |