Sha256: decb670b9434edfaae5bd03f689585db53e6cfcf518b85305021e0cb2a30a6cf

Contents?: true

Size: 729 Bytes

Versions: 1

Compression:

Stored size: 729 Bytes

Contents

require 'acts_as_shellscript_executable/version'
require 'acts_as_shellscript_executable/active_record/acts/shellscript_executable'

module ActsAsShellscriptExecutable
  if defined? Rails::Railtie
    require 'rails'
    class Railtie < Rails::Railtie
      initializer 'acts_as_shellscript_executable.insert_into_active_record' do
        ActiveSupport.on_load :active_record do
          ActsAsShellscriptExecutable::Railtie.insert
        end
      end
    end
  end

  class Railtie
    def self.insert
      if defined?(ActiveRecord)
        require 'active_record'
        ActiveRecord::Base.send(:include, ActiveRecord::Acts::ShellscriptExecutable)
      end
    end
  end
end

ActsAsShellscriptExecutable::Railtie.insert

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
acts_as_shellscript_executable-0.0.0 lib/acts_as_shellscript_executable.rb