Module: Refinery::Blog

Includes:
ActiveSupport::Configurable
Defined in:
lib/refinery/blog.rb,
lib/refinery/blog/tabs.rb,
lib/refinery/blog/engine.rb,
app/models/refinery/blog/post.rb,
lib/refinery/blog/configuration.rb,
app/models/refinery/blog/comment.rb,
app/models/refinery/blog/category.rb,
app/helpers/refinery/blog/posts_helper.rb,
app/models/refinery/blog/categorization.rb,
app/mailers/refinery/blog/comment_mailer.rb,
app/helpers/refinery/blog/controller_helper.rb,
app/controllers/refinery/blog/blog_controller.rb,
app/controllers/refinery/blog/posts_controller.rb,
app/controllers/refinery/blog/categories_controller.rb,
app/controllers/refinery/blog/admin/posts_controller.rb,
app/controllers/refinery/blog/admin/comments_controller.rb,
app/controllers/refinery/blog/admin/settings_controller.rb,
app/controllers/refinery/blog/admin/categories_controller.rb

Defined Under Namespace

Modules: Admin, ControllerHelper, PostsHelper Classes: BlogController, CategoriesController, Categorization, Category, Comment, CommentMailer, Engine, Post, PostsController, Tab

Constant Summary collapse

@@user_class_name =

Refinery::User isn't available when this line gets hit, so we use static methods instead

nil

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.rootObject


23
24
25
# File 'lib/refinery/blog.rb', line 23

def root
  @root ||= Pathname.new(File.expand_path('../../../', __FILE__))
end

.tabsObject


27
28
29
# File 'lib/refinery/blog.rb', line 27

def tabs
  @tabs ||= []
end

Class Method Details

.factory_pathsObject


35
36
37
# File 'lib/refinery/blog.rb', line 35

def factory_paths
  @factory_paths ||= [ root.join("spec/factories").to_s ]
end

.user_classObject


28
29
30
31
32
33
34
35
# File 'lib/refinery/blog/configuration.rb', line 28

def user_class
  class_name = @@user_class_name
  begin
    Object.const_get(class_name) if class_name.present?
  rescue NameError
    class_name.constantize
  end
end

.user_class=(class_name) ⇒ Object


18
19
20
21
22
23
24
25
26
# File 'lib/refinery/blog/configuration.rb', line 18

def user_class=(class_name)
  if class_name.is_a?(Class)
    raise TypeError, "You can't set user_class to be a class, e.g., User.  Instead, please use a string like 'User'"
  elsif class_name.is_a?(String)
    @@user_class_name = class_name
  else
    raise TypeError, "Invalid type for user_class.  Please use a string like 'User'"
  end
end

.versionObject


31
32
33
# File 'lib/refinery/blog.rb', line 31

def version
  ::Refinery::Blog::Version.to_s
end