Sha256: f37ed2b2e75ba45af504046d73a4c46eb0a8ad853ee2aab92277bf111f62d088

Contents?: true

Size: 971 Bytes

Versions: 2

Compression:

Stored size: 971 Bytes

Contents

module SportDb

  class Deleter
    ######
    # NB: make models available in sportdb module by default with namespace
    #  e.g. lets you use Team instead of Model::Team
    include SportDb::Models

    def run
      # for now delete all tables
      
      ## stats
      AlltimeStandingEntry.delete_all
      AlltimeStanding.delete_all
      GroupStandingEntry.delete_all
      GroupStanding.delete_all


      Goal.delete_all
      Record.delete_all

      Game.delete_all
      Event.delete_all
      EventTeam.delete_all
      EventGround.delete_all
      Group.delete_all
      GroupTeam.delete_all
      Round.delete_all
      Badge.delete_all

      Run.delete_all
      Race.delete_all
      Roster.delete_all

      Track.delete_all
      Team.delete_all
      
      League.delete_all
      Season.delete_all
      
      Ground.delete_all   # stadiums
    end
    
  end # class Deleter
  
end # module SportDb

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
sportdb-1.8.28 lib/sportdb/deleter.rb
sportdb-1.8.27 lib/sportdb/deleter.rb