Sha256: ad340873772794c92acedfae1352b1f6b7ab71f9644471a5128c79ccf3a182d6

Contents?: true

Size: 538 Bytes

Versions: 12

Compression:

Stored size: 538 Bytes

Contents

require 'delayed_cron'

module DelayedCron

  if defined? Rails::Railtie
    require 'rails'

    # On initialzation, include DelayedCron
    class Railtie < Rails::Railtie
      initializer 'delayed_cron.insert_into_active_record' do
        ActiveSupport.on_load :active_record do
          DelayedCron::Railtie.insert
        end
      end
    end
  end

  class Railtie

    # Glue includes DelayedCron Class Methods into ActiveRecord
    def self.insert
      ActiveRecord::Base.send(:include, DelayedCron::Glue)
    end

  end

end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
delayed_cron-0.2.11 lib/delayed_cron/railtie.rb
delayed_cron-0.2.10 lib/delayed_cron/railtie.rb
delayed_cron-0.2.9 lib/delayed_cron/railtie.rb
delayed_cron-0.2.8 lib/delayed_cron/railtie.rb
delayed_cron-0.2.7 lib/delayed_cron/railtie.rb
delayed_cron-0.2.6 lib/delayed_cron/railtie.rb
delayed_cron-0.2.5 lib/delayed_cron/railtie.rb
delayed_cron-0.2.4 lib/delayed_cron/railtie.rb
delayed_cron-0.2.3 lib/delayed_cron/railtie.rb
delayed_cron-0.2.2 lib/delayed_cron/railtie.rb
delayed_cron-0.2.1 lib/delayed_cron/railtie.rb
delayed_cron-0.2.0 lib/delayed_cron/railtie.rb