Module: RailsConsolePro::ActiveRecordExtensions::ClassMethods

Defined in:
lib/rails_console_pro/active_record_extensions.rb

Instance Method Summary collapse

Instance Method Details

#export_schema_to_file(file_path, format: nil) ⇒ Object

Export schema to file



10
11
12
13
# File 'lib/rails_console_pro/active_record_extensions.rb', line 10

def export_schema_to_file(file_path, format: nil)
  result = Commands.schema(self)
  result&.export_to_file(file_path, format: format)
end

#schema_to_html(style: :default) ⇒ Object

Export schema to HTML



28
29
30
31
# File 'lib/rails_console_pro/active_record_extensions.rb', line 28

def schema_to_html(style: :default)
  result = Commands.schema(self)
  result&.to_html(style: style)
end

#schema_to_json(pretty: true) ⇒ Object

Export schema to JSON



16
17
18
19
# File 'lib/rails_console_pro/active_record_extensions.rb', line 16

def schema_to_json(pretty: true)
  result = Commands.schema(self)
  result&.to_json(pretty: pretty)
end

#schema_to_yamlObject

Export schema to YAML



22
23
24
25
# File 'lib/rails_console_pro/active_record_extensions.rb', line 22

def schema_to_yaml
  result = Commands.schema(self)
  result&.to_yaml
end