Skip to content

Commit

Permalink
Attributes for devise generator
Browse files Browse the repository at this point in the history
  • Loading branch information
jinzhu authored and josevalim committed Jul 17, 2010
1 parent 55fd7e3 commit aecc014
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/generators/active_record/devise_generator.rb
Expand Up @@ -4,6 +4,8 @@
module ActiveRecord
module Generators
class DeviseGenerator < ActiveRecord::Generators::Base
argument :attributes, :type => :array, :default => [], :banner => "field:type field:type"

include Devise::Generators::OrmHelpers
source_root File.expand_path("../templates", __FILE__)

Expand All @@ -23,4 +25,4 @@ def inject_devise_content
end
end
end
end
end
4 changes: 4 additions & 0 deletions lib/generators/active_record/templates/migration.rb
Expand Up @@ -10,6 +10,10 @@ def self.up
# t.lockable :lock_strategy => :<%= Devise.lock_strategy %>, :unlock_strategy => :<%= Devise.unlock_strategy %>
# t.token_authenticatable

<% for attribute in attributes -%>
t.<%= attribute.type %> :<%= attribute.name %>
<% end -%>
t.timestamps
end
Expand Down

0 comments on commit aecc014

Please sign in to comment.