lib/request_log_analyzer/database/base.rb in wvanbergen-request-log-analyzer-1.3.5 vs lib/request_log_analyzer/database/base.rb in wvanbergen-request-log-analyzer-1.3.6
- old
+ new
@@ -30,12 +30,12 @@
# Serialize complex fields into the database
definition.captures.select { |c| c.has_key?(:provides) }.each do |capture|
klass.send(:serialize, capture[:name], Hash)
end
- database.request_class.has_many "#{definition.name}_lines".to_sym
- database.source_class.has_many "#{definition.name}_lines".to_sym
+ RequestLogAnalyzer::Database::Request.has_many "#{definition.name}_lines".to_sym
+ RequestLogAnalyzer::Database::Source.has_many "#{definition.name}_lines".to_sym
return klass
end
def self.subclass_from_table(table)
@@ -44,15 +44,15 @@
klass = Class.new(RequestLogAnalyzer::Database::Base)
klass.set_table_name(table)
if klass.column_names.include?('request_id')
klass.belongs_to :request
- database.request_class.has_many table.to_sym
+ RequestLogAnalyzer::Database::Request.has_many table.to_sym
end
if klass.column_names.include?('source_id')
klass.belongs_to :source
- database.source_class.has_many table.to_sym
+ RequestLogAnalyzer::Database::Source.has_many table.to_sym
end
return klass
end
\ No newline at end of file