Module: TagDb

Defined in:
lib/tagutils/tags/readers/tag.rb,
lib/tagutils/tags.rb,
lib/tagutils/tags/schema.rb,
lib/tagutils/tags/models/tag.rb,
lib/tagutils/tags/active_record.rb,
lib/tagutils/tags/models/tagging.rb,
lib/tagutils/tags/models/tag_comp.rb

Overview

use TagUtils - why? why not??

Defined Under Namespace

Modules: ClassMacros, Model Classes: CreateDb, TagReader

Constant Summary collapse

VERSION =
TagUtils::VERSION
Models =

add convenience module alias in plural

e.g. lets you use include TagDb::Models
Model

Class Method Summary collapse

Class Method Details

.createObject



16
17
18
19
# File 'lib/tagutils/tags.rb', line 16

def self.create
  CreateDb.new.up
  ConfDb::Model::Prop.create!( key: 'db.schema.tag.version', value: VERSION )
end

.delete!Object

delete ALL records (use with care!)



22
23
24
25
26
# File 'lib/tagutils/tags.rb', line 22

def self.delete!
  puts '*** deleting tag/tagging table records/data...'
  Model::Tagging.delete_all
  Model::Tag.delete_all
end

.tablesObject



28
29
30
31
# File 'lib/tagutils/tags.rb', line 28

def self.tables
  puts "  #{Model::Tag.count} tags"
  puts "  #{Model::Tagging.count} taggings"
end