Skip to content

Commit

Permalink
Update rolify_generator.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
mido18 committed Apr 12, 2014
1 parent 38336a4 commit c7b4bc3
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion lib/generators/active_record/rolify_generator.rb
Expand Up @@ -13,6 +13,15 @@ def generate_model
end

def inject_role_class
if args[1]=="engine"
if args[2]=="devise"
require 'devise'
require "#{ENGINE_ROOT}/config/initializers/devise.rb"
require "#{ENGINE_ROOT}/app/models/#{user_cname.downcase}.rb"
else
require "#{ENGINE_ROOT}/app/models/#{user_cname.downcase}.rb"
end
end
inject_into_class(model_path, class_name, model_content)
end

Expand Down Expand Up @@ -47,4 +56,4 @@ def model_content
end
end
end
end
end

0 comments on commit c7b4bc3

Please sign in to comment.