Module: LogDb
- Defined in:
- lib/logutils/activerecord.rb,
lib/logutils/activerecord/models.rb,
lib/logutils/activerecord/schema.rb,
lib/logutils/activerecord/version.rb
Defined Under Namespace
Modules: Model Classes: CreateDb, DbHandler
Constant Summary collapse
- STDDBHANDLER =
default/standard db handler
DbHandler.new
- Models =
add convenience module alias in plural e.g. lets you use include LogDb::Models
Model
- MAJOR =
todo: namespace inside version or something - why? why not??
0
- MINOR =
2
- PATCH =
1
- VERSION =
[MAJOR,MINOR,PATCH].join('.')
Class Method Summary collapse
- .banner ⇒ Object
-
.create ⇒ Object
class DbHandler.
-
.delete! ⇒ Object
delete ALL records (use with care!).
- .root ⇒ Object
-
.setup ⇒ Object
check: use different name? e.g.
- .stats ⇒ Object
- .version ⇒ Object
Class Method Details
.banner ⇒ Object
14 15 16 |
# File 'lib/logutils/activerecord/version.rb', line 14 def self. "logdb/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}]" end |
.create ⇒ Object
class DbHandler
31 32 33 |
# File 'lib/logutils/activerecord.rb', line 31 def self.create CreateDb.up end |
.delete! ⇒ Object
delete ALL records (use with care!)
36 37 38 39 |
# File 'lib/logutils/activerecord.rb', line 36 def self.delete! puts '*** deleting log table records/data...' Model::Log.delete_all end |
.root ⇒ Object
18 19 20 |
# File 'lib/logutils/activerecord/version.rb', line 18 def self.root "#{File.( File.dirname(File.dirname(File.dirname(File.dirname(__FILE__)))) )}" end |
.setup ⇒ Object
check: use different name? e.g. configure or connect ?? why or why not?
50 51 52 53 |
# File 'lib/logutils/activerecord.rb', line 50 def self.setup # check: use different name? e.g. configure or connect ?? why or why not? # turn on logging to db - assumes active connection LogKernel::STDLOGGER.handlers << STDDBHANDLER end |
.stats ⇒ Object
42 43 44 |
# File 'lib/logutils/activerecord.rb', line 42 def self.stats # to be done end |
.version ⇒ Object
10 11 12 |
# File 'lib/logutils/activerecord/version.rb', line 10 def self.version VERSION end |