Sha256: 21220c92fc8f10c4a501e4269573fe1b937113cf637218ea3fc91ea5131c3a24

Contents?: true

Size: 843 Bytes

Versions: 2

Compression:

Stored size: 843 Bytes

Contents

require 'livelist/rails/active_record'

module Livelist
  module Rails

    class Railtie < ::Rails::Railtie
      initializer "livelist-rails" do |app|
        ActiveSupport.on_load :active_record do
          ::ActiveRecord::Base.send :extend, ActiveRecord
        end
      end

      if ::Rails.version < "3.1.0"
        config.before_configuration do
          if ::Rails.root.join("public/javascripts/livelist.min.js").exist? ||
             %W(production staging).include?(::Rails.env)
            livelist_filename = 'livelist-min'
          else
            livelist_filename = 'livelist'
          end

          config.action_view.javascript_expansions[:livelist_dependencies] = %W(mustache underscore.min)
          config.action_view.javascript_expansions[:livelist] = [livelist_filename]
        end
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
livelist-rails-0.0.4 lib/livelist/rails/railtie.rb
livelist-rails-0.0.3 lib/livelist/rails/railtie.rb