Class: Maglev::Sections::ResetCommand
- Inherits:
-
Rails::Command::Base
- Object
- Rails::Command::Base
- Maglev::Sections::ResetCommand
- Defined in:
- lib/commands/maglev/sections/reset_command.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.banner(_command = nil) ⇒ Object
10 11 12 |
# File 'lib/commands/maglev/sections/reset_command.rb', line 10 def self.(_command = nil, *) 'bin/rails maglev:sections:reset TYPE' end |
Instance Method Details
#perform(type) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/commands/maglev/sections/reset_command.rb', line 14 def perform(type) require File.('config/environment', Rails.root) site = fetch_site theme = fetch_theme return if site.blank? || theme.blank? count = Maglev::ResetSectionContent.call( site: site, theme: theme, type: type ) (count, type) end |