Class: ActiveRecord::Generators::CookieCryptGenerator
- Inherits:
-
Base
- Object
- Base
- ActiveRecord::Generators::CookieCryptGenerator
- Defined in:
- lib/generators/active_record/cookie_crypt_generator.rb
Instance Method Summary collapse
- #copy_cookie_crypt_migration_1_0 ⇒ Object
- #copy_cookie_crypt_migration_1_1 ⇒ Object
- #copy_cookie_crypt_migration_1_1_cleanup ⇒ Object
Instance Method Details
#copy_cookie_crypt_migration_1_0 ⇒ Object
8 9 10 11 12 |
# File 'lib/generators/active_record/cookie_crypt_generator.rb', line 8 def if ActiveRecord::Base.class_eval("#{table_name.camelize.singularize}.inspect['security_question_one: string'].blank?") migration_template "migration.rb", "db/migrate/cookie_crypt_add_to_#{table_name}" end end |
#copy_cookie_crypt_migration_1_1 ⇒ Object
14 15 16 17 18 |
# File 'lib/generators/active_record/cookie_crypt_generator.rb', line 14 def if ActiveRecord::Base.class_eval("#{table_name.camelize.singularize}.inspect['security_hash: text'].blank?") migration_template "migration_1_1.rb", "db/migrate/cookie_crypt_1_1_update_to_#{table_name}" end end |
#copy_cookie_crypt_migration_1_1_cleanup ⇒ Object
20 21 22 23 24 |
# File 'lib/generators/active_record/cookie_crypt_generator.rb', line 20 def if $generate_1_1_cleanup_migration migration_template "migration_1_1_cleanup.rb", "db/migrate/cookie_crypt_1_1_cleanup_to_#{table_name}" end end |