Module: Thredded

Defined in:
lib/thredded/seed_database.rb,
lib/thredded.rb,
lib/thredded/engine.rb,
lib/thredded/errors.rb,
lib/thredded/version.rb,
lib/thredded/at_users.rb,
app/models/thredded/post.rb,
app/models/thredded/stats.rb,
app/models/thredded/topic.rb,
lib/thredded/search_parser.rb,
app/models/thredded/ability.rb,
app/models/thredded/category.rb,
app/forms/thredded/topic_form.rb,
app/models/thredded/null_user.rb,
lib/thredded/post_sql_builder.rb,
app/models/thredded/null_topic.rb,
lib/thredded/table_sql_builder.rb,
lib/thredded/topic_sql_builder.rb,
app/models/thredded/user_detail.rb,
lib/thredded/search_sql_builder.rb,
app/mailers/thredded/base_mailer.rb,
app/mailers/thredded/post_mailer.rb,
app/models/thredded/messageboard.rb,
app/models/thredded/private_post.rb,
app/models/thredded/private_user.rb,
app/jobs/thredded/at_notifier_job.rb,
app/models/thredded/private_topic.rb,
app/models/thredded/user_extender.rb,
app/models/thredded/topic_category.rb,
lib/thredded/post_user_permissions.rb,
app/models/thredded/null_preference.rb,
app/models/thredded/null_topic_read.rb,
app/models/thredded/user_preference.rb,
app/models/thredded/user_topic_read.rb,
lib/thredded/topic_user_permissions.rb,
app/forms/thredded/private_topic_form.rb,
app/models/thredded/messageboard_user.rb,
app/models/thredded/post_notification.rb,
lib/thredded/main_app_route_delegator.rb,
app/decorators/thredded/post_decorator.rb,
app/jobs/thredded/activity_updater_job.rb,
app/decorators/thredded/topic_decorator.rb,
app/helpers/thredded/application_helper.rb,
app/mailers/thredded/private_post_mailer.rb,
app/models/concerns/thredded/post_common.rb,
app/controllers/thredded/posts_controller.rb,
app/mailers/thredded/private_topic_mailer.rb,
app/models/concerns/thredded/topic_common.rb,
app/controllers/thredded/setups_controller.rb,
app/controllers/thredded/topics_controller.rb,
lib/thredded/messageboard_user_permissions.rb,
app/models/thredded/notification_preference.rb,
lib/thredded/private_topic_user_permissions.rb,
app/commands/thredded/messageboard_destroyer.rb,
app/commands/thredded/notify_mentioned_users.rb,
app/decorators/thredded/base_topic_decorator.rb,
app/decorators/thredded/user_topic_decorator.rb,
app/commands/thredded/members_marked_notified.rb,
app/decorators/thredded/topic_email_decorator.rb,
app/models/thredded/user_permissions/read/all.rb,
app/commands/thredded/user_reads_private_topic.rb,
app/decorators/thredded/messageboard_decorator.rb,
app/models/thredded/user_permissions/write/all.rb,
app/commands/thredded/at_notification_extractor.rb,
app/controllers/thredded/application_controller.rb,
app/controllers/thredded/preferences_controller.rb,
app/decorators/thredded/private_topic_decorator.rb,
app/models/thredded/user_permissions/admin/none.rb,
app/models/thredded/user_permissions/write/none.rb,
app/commands/thredded/notify_private_topic_users.rb,
app/jobs/thredded/notify_private_topic_users_job.rb,
app/controllers/thredded/messageboards_controller.rb,
app/decorators/thredded/base_user_topic_decorator.rb,
lib/generators/thredded/install/install_generator.rb,
app/controllers/thredded/private_topics_controller.rb,
app/controllers/thredded/theme_previews_controller.rb,
app/models/thredded/user_permissions/moderate/none.rb,
app/decorators/thredded/user_private_topic_decorator.rb,
app/commands/thredded/user_resets_private_topic_to_unread.rb,
app/models/thredded/user_permissions/admin/if_admin_column_true.rb,
app/models/thredded/user_permissions/moderate/if_moderator_column_true.rb,
app/models/thredded/user_permissions/message/readers_of_writeable_boards.rb

Overview

rubocop:enable HandleExceptions

Defined Under Namespace

Modules: ApplicationHelper, Errors, Generators, MainAppRouteDelegator, PostCommon, TopicCommon, UserExtender, UserPermissions Classes: Ability, ActivityUpdaterJob, ApplicationController, AtNotificationExtractor, AtNotifierJob, AtUsers, BaseMailer, BaseTopicDecorator, BaseUserTopicDecorator, Category, Engine, Error, MembersMarkedNotified, Messageboard, MessageboardDecorator, MessageboardDestroyer, MessageboardUser, MessageboardUserPermissions, MessageboardsController, NotificationPreference, NotifyMentionedUsers, NotifyPrivateTopicUsers, NotifyPrivateTopicUsersJob, NullPreference, NullTopic, NullTopicRead, NullUser, Post, PostDecorator, PostMailer, PostNotification, PostSqlBuilder, PostUserPermissions, PostsController, PreferencesController, PrivatePost, PrivatePostMailer, PrivateTopic, PrivateTopicDecorator, PrivateTopicForm, PrivateTopicMailer, PrivateTopicUserPermissions, PrivateTopicsController, PrivateUser, SearchParser, SearchSqlBuilder, SeedDatabase, SetupsController, Stats, TableSqlBuilder, ThemePreviewsController, Topic, TopicCategory, TopicDecorator, TopicEmailDecorator, TopicForm, TopicSqlBuilder, TopicUserPermissions, TopicsController, UserDetail, UserPreference, UserPrivateTopicDecorator, UserReadsPrivateTopic, UserResetsPrivateTopicToUnread, UserTopicDecorator, UserTopicRead

Constant Summary collapse

VERSION =
'0.2.2'

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.standalone_layout? ⇒ Boolean

Whether the layout is a thredded layout as opposed to the application layout.



82
83
84
# File 'lib/thredded.rb', line 82

def self.standalone_layout?
  layout.is_a?(String) && layout.start_with?('thredded/')
end

.user_class ⇒ Class<Thredded::UserExtender>



56
57
58
59
60
61
62
63
64
65
66
67
68
# File 'lib/thredded.rb', line 56

def self.user_class
  if @@user_class.is_a?(Class)
    fail 'Please use a string instead of a class'
  end

  if @@user_class.is_a?(String)
    begin
      Object.const_get(@@user_class)
    rescue NameError
      @@user_class.constantize
    end
  end
end

.user_path(view_context, user) ⇒ String



73
74
75
76
77
78
79
# File 'lib/thredded.rb', line 73

def self.user_path(view_context, user)
  if @@user_path.respond_to? :call
    view_context.instance_exec(user, &@@user_path)
  else
    '/'
  end
end

Instance Method Details

#admin_column ⇒ Symbol



45
# File 'lib/thredded.rb', line 45

mattr_accessor :admin_column

#moderator_column ⇒ Symbol



42
# File 'lib/thredded.rb', line 42

mattr_accessor :moderator_column