Skip to content

Commit

Permalink
Reorganize initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
bogdan committed Oct 26, 2011
1 parent cdfda6c commit 730ad80
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 14 deletions.
2 changes: 1 addition & 1 deletion lib/datagrid/core.rb
@@ -1,4 +1,4 @@
require "datagrid/drivers/active_record_driver"
require "datagrid/drivers"

module Datagrid
module Core
Expand Down
1 change: 1 addition & 0 deletions lib/datagrid/drivers.rb
@@ -0,0 +1 @@
require "datagrid/drivers/active_record"
11 changes: 0 additions & 11 deletions lib/datagrid/drivers/abstract_driver.rb

This file was deleted.

@@ -1,6 +1,6 @@
module Datagrid
module Drivers
module ActiveRecordDriver
module ActiveRecord

def self.included(base)
base.extend ClassMethods
Expand Down Expand Up @@ -37,7 +37,9 @@ module InstanceMethods

end

ActiveRecord::Base.send(:include, ActiveRecordDriver) if defined?(ActiveRecord)

end
end
if defined?(::ActiveRecord)
::ActiveRecord::Base.send(:include, Datagrid::Drivers::ActiveRecord)
end

0 comments on commit 730ad80

Please sign in to comment.