days 0.1.2 → 0.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/lib/days/app.rb CHANGED
@@ -53,6 +53,14 @@ module Days
53
53
  helpers Helpers
54
54
  helpers Kaminari::Helpers::SinatraHelpers
55
55
 
56
+ before do
57
+ # for thread safe
58
+ begin
59
+ ActionView::LogSubscriber.log_subscribers.clear
60
+ rescue NameError, NoMethodError
61
+ end
62
+ end
63
+
56
64
  set :admin_only do |_|
57
65
  condition do
58
66
  unless logged_in?
data/lib/days/config.rb CHANGED
@@ -26,7 +26,7 @@ module Days
26
26
  end
27
27
 
28
28
  def establish_db_connection(force=false)
29
- if !self.has_key?(:activerecord_log) || self.activerecord_log == true
29
+ if Days::App.environment.to_sym == :development && (self.has_key?(:activerecord_log) ? true : self.activerecord_log == true)
30
30
  ActiveRecord::Base.logger = Logger.new($stdout)
31
31
  end
32
32
 
@@ -18,6 +18,8 @@ module Days
18
18
  order('published_at DESC')
19
19
  end
20
20
 
21
+ paginates_per 12
22
+
21
23
  def draft=(x)
22
24
  if x.present?
23
25
  @draft = true
data/lib/days/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Days
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -30,7 +30,7 @@ Post.order('id ASC').all.each do |post|
30
30
  hash[:slug] = post.slug
31
31
  hash[:title] = post.title
32
32
  hash[:body] = post.body
33
- if post.draft == 1
33
+ if post.draft
34
34
  hash[:published_at] = nil
35
35
  hash[:draft] = true
36
36
  else
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: days
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: