Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Load rake tasks using Railtie. - Load ActiveRecordExtensions using Railtie.
- Loading branch information
Jason Harrelson
committed
Mar 24, 2013
1 parent
fd7bb09
commit 68fb697
Showing
5 changed files
with
46 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
$:.unshift(File.dirname(__FILE__)) unless | ||
$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) | ||
#$:.unshift(File.dirname(__FILE__)) unless | ||
#$:.include?(File.dirname(__FILE__)) || $:.include?(File.expand_path(File.dirname(__FILE__))) | ||
|
||
require 'genesis/active_record_extensions' | ||
require 'genesis/seeder' | ||
require 'genesis/railtie' | ||
require 'genesis/schema_seed' | ||
require 'genesis/seeder' | ||
|
||
module Genesis | ||
SEEDS_ROOT = 'db/seeds' | ||
end | ||
|
||
ActiveRecord::Base.send :include, Genesis::ActiveRecordExtensions if defined? ActiveRecord::Base | ||
#ActiveRecord::Base.send :include, Genesis::ActiveRecordExtensions if defined? ActiveRecord::Base |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
require 'genesis' | ||
require 'rails' | ||
|
||
class Railtie < Rails::Railtie | ||
|
||
initializer 'genesis.insert_into_active_record' do |app| | ||
ActiveSupport.on_load :active_record do | ||
ActiveRecord::Base.send :include, Genesis::ActiveRecordExtensions | ||
end | ||
end | ||
|
||
rake_tasks do | ||
Dir[File.join(File.dirname(__FILE__),'tasks/*.rake')].each { |f| load f } | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.