Module: SocialStream
- Defined in:
- lib/social_stream-base.rb,
lib/social_stream/d3.rb,
lib/social_stream/ability.rb,
lib/social_stream/populate.rb,
lib/social_stream/views/list.rb,
lib/social_stream/base/engine.rb,
lib/social_stream/ability/base.rb,
lib/social_stream/base/version.rb,
lib/social_stream/test_helpers.rb,
lib/social_stream/models/object.rb,
lib/social_stream/models/subject.rb,
lib/social_stream/migrations/base.rb,
lib/social_stream/models/supertype.rb,
lib/social_stream/views/sidebar/base.rb,
lib/social_stream/controllers/helpers.rb,
lib/social_stream/controllers/objects.rb,
lib/social_stream/toolbar_config/base.rb,
lib/social_stream/views/settings/base.rb,
lib/social_stream/migrations/components.rb,
lib/social_stream/test_helpers/controllers.rb,
lib/social_stream/controllers/cancan_devise_integration.rb
Overview
:nodoc:
Defined Under Namespace
Modules: Base, Controllers, D3, Migrations, Models, Populate, TestHelpers, ToolbarConfig, Views Classes: Ability
Constant Summary collapse
- @@subjects =
[ :user, :group ]
- @@devise_modules =
[ :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :omniauthable, :token_authenticatable]
- @@objects =
[ :post, :comment ]
- @@activity_forms =
[ :post ]
- @@quick_search_models =
[ :user, :group, :post ]
- @@extended_search_models =
[ :user, :group, :post ]
- @@cleditor_controls =
"bold italic underline strikethrough subscript superscript | size style | bullets | image link unlink"
Class Method Summary collapse
- .objects ⇒ Object
-
.require_model(m) ⇒ Object
Load models for rewrite in application.
- .setup {|_self| ... } ⇒ Object
Class Method Details
.objects ⇒ Object
71 72 73 74 |
# File 'lib/social_stream-base.rb', line 71 def objects @@objects.push(:actor) unless @@objects.include?(:actor) @@objects end |
.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!!
89 90 91 92 93 94 95 96 97 98 99 100 |
# File 'lib/social_stream-base.rb', line 89 def require_model(m) paths = $:.find_all{ |f| f =~ Regexp.new(File.join('social_stream.*', 'app', 'models')) } raise "Can't find social_stream path" if paths.blank? paths.each do |path| if File.exists?(File.join(path, "#{m}.rb")) require_dependency File.join(path, m) end end end |
.setup {|_self| ... } ⇒ Object
67 68 69 |
# File 'lib/social_stream-base.rb', line 67 def setup yield self end |