From 74847f2d042102d10f6ccc3dda3d26d87e5f17ea Mon Sep 17 00:00:00 2001 From: Antonio C Nalesso Moreira Date: Sun, 14 Jul 2013 23:36:06 +0100 Subject: [PATCH] fixed #96, fixed generator for orms --- lib/generators/active_record/impressionist_generator.rb | 1 + lib/generators/templates/impression.rb | 5 +++-- tests/test_app/config/initializers/impression.rb | 7 +++++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/generators/active_record/impressionist_generator.rb b/lib/generators/active_record/impressionist_generator.rb index 31f4c1a..f71a3ab 100644 --- a/lib/generators/active_record/impressionist_generator.rb +++ b/lib/generators/active_record/impressionist_generator.rb @@ -4,6 +4,7 @@ module ActiveRecord include Rails::Generators::Migration source_root File.join(File.dirname(__FILE__), 'templates') + # FIX, why is this implementing rails behaviour? def self.next_migration_number(dirname) sleep 1 if ActiveRecord::Base.timestamped_migrations diff --git a/lib/generators/templates/impression.rb b/lib/generators/templates/impression.rb index 5de89e4..2130c45 100644 --- a/lib/generators/templates/impression.rb +++ b/lib/generators/templates/impression.rb @@ -1,5 +1,6 @@ # Use this hook to configure impressionist parameters -Impressionist.setup do |config| +#Impressionist.setup do |config| # Define ORM. Could be :active_record (default), :mongo_mapper or :mongoid # config.orm = :active_record -end +#end +Impressionist.orm = :<%= options.orm if options.orm %> diff --git a/tests/test_app/config/initializers/impression.rb b/tests/test_app/config/initializers/impression.rb index a2fcb52..5de89e4 100644 --- a/tests/test_app/config/initializers/impression.rb +++ b/tests/test_app/config/initializers/impression.rb @@ -1,2 +1,5 @@ -# Define ORM. Could be :active_record (default) and :mongo_mapper -#Impressionist.config.orm = :mongoid +# Use this hook to configure impressionist parameters +Impressionist.setup do |config| + # Define ORM. Could be :active_record (default), :mongo_mapper or :mongoid + # config.orm = :active_record +end