require 'rails'
require 'acts_as_sorting'

p "Railtie loaded"

begin
module ActsAsSorting
  class Railtie < Rails::Railtie
    config.to_prepare do
      p "hook sorting added"
      ActiveRecord::Base.send(:extend, ActsAsSorting::Hook)
    end
  end
end
rescue
p $!, $!.message
raise $!
end
