lib/cachai.rb in cachai-0.2.2 vs lib/cachai.rb in cachai-0.2.3
- old
+ new
@@ -16,11 +16,13 @@
# use Rack::CommonLogger, LOGGER
# use Rack::Static, :urls => %w(/css /img /js /favicon.ico), :root => 'public'
use ActiveRecord::ConnectionAdapters::ConnectionManagement
- CACHE_MINUTES = 10 * 60 # 10 minutes
+ error do
+ 'Oops, nasty error: ' + env['sinatra.error'].message
+ end
def initialize(app, opts = {})
domain = opts.delete(:domain) or raise 'Domain required.'
redis_host = opts.delete(:redis_host) || 'localhost'
@@ -144,9 +146,10 @@
comment = {
:user_ip => request.ip,
:referrer => request.referrer,
:user_agent => request.user_agent,
:permalink => link,
+ :blog => 'http://' + data['domain'],
:comment_type => 'comment',
:comment_content => data['content'],
:comment_author => data['author_name'],
:comment_author_url => data['author_url'],
:comment_author_email => data['author_email']