Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/controllers/blogit/application_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
module Blogit

# Inherits from the application's controller instead of ActionController::Base
class ApplicationController < ::ApplicationController
class ApplicationController < "::#{Blogit.configuration.parent_controller}".constantize

helper Blogit::ApplicationHelper, Blogit::PostsHelper
helper_method :current_blogger, :blogit_conf
Expand Down Expand Up @@ -33,7 +33,7 @@ def current_blogger

# Returns true or false if current_blogger is present
def is_blogger_logged_in?
!!current_blogger
!!current_blogger
end

# Returns true if the current_blogger is the owner of the post
Expand Down
7 changes: 6 additions & 1 deletion lib/blogit/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ class Configuration
# list of states that will hide the posts from the public.
attr_accessor :hidden_states

# Name of controller that Blogit::ApplicationController descends from
# Defaults to ApplicationController
attr_accessor :parent_controller

# list of states for the Post state machine in order or lifecycle, aggregation of hidden_states and active_states
#attr_accessor :post_states

Expand Down Expand Up @@ -140,6 +144,7 @@ def initialize
@redcarpet_options = REDCARPET_OPTIONS
@active_states = ACTIVE_STATES
@hidden_states = HIDDEN_STATES
@parent_controller = "ApplicationController"
end

def default_parser_class
Expand Down Expand Up @@ -167,7 +172,7 @@ def twitter_username=(username)
def rss_feed_language=(locale)
blogit_warn "#{self.class}#rss_feed_language has been deprecated. You can remove this from your blogit.rb configuration file"
end

def cache_pages=(value)
blogit_warn "config.cache_pages is deprecated. Please remove this from your blogit.rb file"
end
Expand Down
2 changes: 2 additions & 0 deletions lib/generators/templates/blogit.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,6 @@
# List of states that will hide the posts from the public.
# config.hidden_states = [:draft, :archive]

# Name of controller that Blogit::ApplicationController descends from
# config.parent_controller = "ApplicationController"
end