File: railtie.rb

package info (click to toggle)
ruby-i18n-inflector-rails 1.0.7-5
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 332 kB
  • sloc: ruby: 465; makefile: 7
file content (27 lines) | stat: -rw-r--r-- 804 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# encoding: utf-8
#
# Author::    Paweł Wilk (mailto:pw@gnu.org)
# Copyright:: (c) 2011-2013 by by Paweł Wilk
# License::   This program is licensed under the terms of {file:LGPL-LICENSE GNU Lesser General Public License} or {file:COPYING Ruby License}.
# 
# This file loads I18n::Inflector::Rails goodies into Rails.

module I18n
  module Inflector
    module Rails

      class Railtie < ::Rails::Engine

        initializer :before_initialize do
          ActionController::Base.send(:extend,  I18n::Inflector::Rails::ClassMethods)
          ActionController::Base.send(:include, I18n::Inflector::Rails::InstanceMethods)
        end

        initializer :after_initialize do
          ActionController::Base.helper I18n::Inflector::Rails::InflectedTranslate
        end
      end

    end
  end
end