Class: ActiveRecord::DataIntegrity::CLI
- Inherits:
-
Thor
- Object
- Thor
- ActiveRecord::DataIntegrity::CLI
- Defined in:
- lib/active_record/data_integrity/cli.rb
Overview
CLI application class
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
10 11 12 |
# File 'lib/active_record/data_integrity/cli.rb', line 10 def @options end |
Instance Method Details
#check(_args = ARGV) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/active_record/data_integrity/cli.rb', line 17 def check(_args = ARGV) @options = Options.new() require_rails results = cops.map do |cop_class| ActiveRecord::Base.descendants.each do |model| cop_class.new(model).call end end ActiveRecord::DataIntegrity::Collector.render exit(1) if results.include?(false) end |
#version ⇒ Object
34 35 36 |
# File 'lib/active_record/data_integrity/cli.rb', line 34 def version puts ActiveRecord::DataIntegrity::VERSION end |