Sha256: 9597bb637d5cc0ba1d5c24177a43d6652b717a961469ff519dcbd7a96a94b023

Contents?: true

Size: 691 Bytes

Versions: 16

Compression:

Stored size: 691 Bytes

Contents

namespace :fields do

  desc "Report the current schema"
  task :report=>:environment do
    ModalFields.report(
      :tables=>true, :primary_keys=>true, :foreign_keys=>true, :associations=>true,
      :undeclared_fields=>true) do |kind, table, name, data|
        case kind
        when :table
          puts "="*50
          puts table
        when :association
          puts "  Foreign keys for #{name} (table: #{data[:foreign_table]})"
        when :primary_key
          puts "  Primary key: #{name} #{data[:sql_type]}"
        when :foreign_key
          puts "    #{name} #{data[:sql_type]}"
        else
          puts "  #{name} #{data[:sql_type]}"
        end
    end
  end

end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
modalfields-1.5.7 lib/tasks/report.rake
modalfields-1.5.6 lib/tasks/report.rake
modalfields-1.5.5 lib/tasks/report.rake
modalfields-1.5.4 lib/tasks/report.rake
modalfields-1.5.3 lib/tasks/report.rake
modalfields-1.5.2 lib/tasks/report.rake
modalfields-1.5.1 lib/tasks/report.rake
modalfields-1.5.0 lib/tasks/report.rake
modalfields-1.4.7 lib/tasks/report.rake
modalfields-1.4.6 lib/tasks/report.rake
modalfields-1.4.5 lib/tasks/report.rake
modalfields-1.4.4 lib/tasks/report.rake
modalfields-1.4.3 lib/tasks/report.rake
modalfields-1.4.2 lib/tasks/report.rake
modalfields-1.4.1 lib/tasks/report.rake
modalfields-1.4.0 lib/tasks/report.rake