Module: SocialStream

Defined in:
lib/social_stream/base.rb,
lib/social_stream/d3.rb,
lib/social_stream/search.rb,
lib/social_stream/ability.rb,
lib/social_stream/population.rb,
lib/social_stream/views/list.rb,
lib/social_stream/base/engine.rb,
lib/social_stream/base/ability.rb,
lib/social_stream/base/version.rb,
lib/social_stream/test_helpers.rb,
lib/social_stream/base/autoload.rb,
lib/social_stream/models/object.rb,
lib/social_stream/models/subject.rb,
lib/social_stream/models/subtype.rb,
lib/social_stream/routing/mapper.rb,
lib/social_stream/views/location.rb,
lib/social_stream/migrations/base.rb,
lib/social_stream/activity_streams.rb,
lib/social_stream/models/supertype.rb,
lib/social_stream/population/actor.rb,
lib/social_stream/controllers/avatars.rb,
lib/social_stream/controllers/helpers.rb,
lib/social_stream/controllers/objects.rb,
lib/social_stream/base/thinking-sphinx.rb,
lib/social_stream/controllers/subjects.rb,
lib/social_stream/population/power_law.rb,
lib/social_stream/migrations/components.rb,
lib/social_stream/population/timestamps.rb,
lib/social_stream/controllers/authorship.rb,
lib/social_stream/activity_streams/subtype.rb,
lib/social_stream/test_helpers/controllers.rb,
lib/social_stream/activity_streams/supertype.rb,
lib/social_stream/population/activity_object.rb,
lib/social_stream/routing/constraints/resque.rb,
lib/social_stream/controllers/i18n_integration.rb,
lib/social_stream/devise/controllers/user_sign_in.rb,
lib/social_stream/controllers/mark_notifications_read.rb,
lib/social_stream/controllers/cancan_devise_integration.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Ability, ActivityStreams, Base, Controllers, D3, Devise, Migrations, Models, Population, Routing, Search, TestHelpers, Views

Constant Summary collapse

@@subjects =
[ :user, :group, :site ]
@@devise_modules =
[ :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable, :omniauthable, :token_authenticatable]
@@objects =
[ :post, :comment ]
@@activity_forms =
[]
@@single_relations =
[ :public, :follow, :reject ]
@@custom_relations =
{
  'user' => {
    'friend' => {
      'name' => 'friend',
      'permissions' => [
        [ 'follow' ],
        [ 'create',  'activity' ],
        [ 'read',    'activity' ]
      ]
    },
    'acquaintance' => {
      'name' => 'acquaintance',
      'permissions' => [
        [ 'read', 'activity' ]
      ]
    },
    'colleague' => {
      'name' => 'colleague',
      'permissions' => [
        [ 'follow' ],
        [ 'create',  'activity' ],
        [ 'read',    'activity' ]
      ]
    }
  },
  'group' => {
    'member' => {
      'name' => 'member',
      'permissions' => [
        [ 'represent' ],
        [ 'create', 'activity' ],
        [ 'read',   'activity' ],
        [ 'read',   'tie' ]
      ]
    },
    'partner' => {
      'name' => 'partner',
      'permissions' => [
        [ 'read', 'activity' ]
      ]
    }
  },
  'site/current' => {}
}
@@system_relations =
{
  user: [],
  group: [ :owner ]
}
@@available_permissions =
{
  'user' => [
    [ "read",    "activity" ],
    [ "create",  "activity" ],
    [ "follow", nil ],
    [ "represent", nil ],
    [ "notify", nil ]
  ],
  'group' => [
    [ "read",    "activity" ],
    [ "create",  "activity" ],
    [ "follow", nil ],
    [ "represent", nil ],
    [ "notify", nil ]
  ]
}
@@suggested_models =
[ :user, :group ]
@@contact_index_models =
[ :user, :group ]
@@repository_models =
[]
@@resque_access =
true
@@quick_search_models =
[ :user, :group, :post ]
@@extended_search_models =
[ :user, :group, :post, :comment ]
@@cleditor_controls =
"bold italic underline strikethrough subscript superscript | size style | bullets | image link unlink"
@@default_notification_settings =
{
    someone_adds_me_as_a_contact: true,
    someone_confirms_my_contact_request: true,
    someone_likes_my_post: true,
    someone_comments_on_my_post: true
}

Class Method Summary collapse

Class Method Details

.objectsObject



144
145
146
147
# File 'lib/social_stream/base.rb', line 144

def objects
  @@objects.push(:actor) unless @@objects.include?(:actor)
  @@objects
end

.profile_subject_keysObject

An array of the keys that must be tried when searching for a profile subject



139
140
141
142
# File 'lib/social_stream/base.rb', line 139

def profile_subject_keys
  @profile_subject_keys ||=
    routed_subjects.map{ |s| s.to_s.split('/').last }
end

.routed_subjectsObject

All the subjects that appear in routes and can be accessed through the browser / API



133
134
135
# File 'lib/social_stream/base.rb', line 133

def routed_subjects
  @@routed_subjects ||= subjects.dup
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (SocialStream)

    the object that the method was called on



127
128
129
# File 'lib/social_stream/base.rb', line 127

def setup
  yield self
end