Module: SocialStream

Defined in:
lib/social_stream.rb,
lib/social_stream/seed.rb,
lib/social_stream/rails.rb,
lib/social_stream/version.rb,
lib/social_stream/models/actor.rb,
lib/social_stream/rails/common.rb,
lib/social_stream/rails/engine.rb,
lib/social_stream/rails/railtie.rb,
lib/social_stream/models/supertype.rb,
lib/social_stream/models/activity_object.rb

Overview

:nodoc:

Defined Under Namespace

Modules: Models, Rails Classes: InstallGenerator, Seed

Constant Summary collapse

VERSION =
"0.1.0".freeze
@@actors =
[ :user, :group ]
@@devise_modules =
[ :database_authenticatable, :registerable, :recoverable,
:rememberable, :trackable ]
@@activity_objects =
[ :post, :comment ]

Class Method Summary collapse

Class Method Details

.require_model(m) ⇒ Object

Load models for rewrite in application

Use this method when you want to reopen some model in SocialStream in order to add or modify functionality

Example, in app/models/user.rb

SocialStream.require_model('user')

class User
  some_new_functionality
end

Maybe Rails provides some method to do this, in this case, please tell!!



43
44
45
46
47
48
49
# File 'lib/social_stream.rb', line 43

def require_model(m)
  path = $:.find{ |f| f =~ Regexp.new(File.join('social_stream', 'app', 'models')) }

  raise "Can't find social_stream path" if path.blank?

  require_dependency File.join(path, m)
end

.seed!Object



26
27
28
# File 'lib/social_stream.rb', line 26

def seed!
  Seed.new(File.join(::Rails.root, 'db', 'seeds', 'social_stream.yml'))
end

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

Yields:

  • (_self)

Yield Parameters:

  • _self (SocialStream)

    the object that the method was called on



22
23
24
# File 'lib/social_stream.rb', line 22

def setup
  yield self
end