Module: SocialStream::Rails::Common

Included in:
Engine, Railtie
Defined in:
lib/social_stream/rails/common.rb

Overview

Common methods for Rails::Railtie and Rails::Engine

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/social_stream/rails/common.rb', line 12

def included(base)
  base.class_eval do
    config.generators.authentication :devise
    config.generators.javascript :jquery

    config.to_prepare do
      %w( actor activity_object ).each do |supertype|
        supertype.classify.constantize.load_subtype_features
      end

    # https://rails.lighthouseapp.com/projects/8994/tickets/1905-apphelpers-within-plugin-not-being-mixed-in
      ApplicationController.helper ActivitiesHelper
      ApplicationController.helper TiesHelper
    end

    initializer "social_stream.inflections" do
      Common.inflections
    end
  end
end

.inflectionsObject



6
7
8
9
10
# File 'lib/social_stream/rails/common.rb', line 6

def inflections
  ActiveSupport::Inflector.inflections do |inflect|
    inflect.singular /^([Tt]ie)s$/, '\1'
  end
end