Skip to content

Commit

Permalink
Paperclip::Railtie.insert should be wrapped in a initializer block
Browse files Browse the repository at this point in the history
  • Loading branch information
joeljunstrom committed Jun 9, 2010
1 parent 1bcfc14 commit c4cf756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 5 additions & 3 deletions lib/paperclip/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ module Paperclip
if defined? Rails::Railtie
require 'rails'
class Railtie < Rails::Railtie
ActiveSupport.on_load :active_record do
Paperclip::Railtie.insert
initializer 'paperclip.insert_into_active_record' do
ActiveSupport.on_load :active_record do
Paperclip::Railtie.insert
end
end
rake_tasks do
load "tasks/paperclip.rake"
Expand All @@ -19,4 +21,4 @@ def self.insert
File.send(:include, Paperclip::Upfile)
end
end
end
end
2 changes: 0 additions & 2 deletions rails/init.rb

This file was deleted.

0 comments on commit c4cf756

Please sign in to comment.