clearance 1.0.0.rc2 → 1.0.0.rc3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of clearance might be problematic. Click here for more details.
- data/Gemfile.lock +2 -5
- data/NEWS.md +4 -1
- data/README.md +10 -10
- data/Rakefile +0 -1
- data/app/controllers/clearance/passwords_controller.rb +1 -10
- data/clearance.gemspec +0 -1
- data/features/add_migrations_to_project.feature +65 -0
- data/features/integration_with_rspec.feature +21 -0
- data/features/step_definitions/configuration_steps.rb +21 -0
- data/features/step_definitions/gem_file_steps.rb +7 -0
- data/features/support/env.rb +8 -18
- data/gemfiles/3.0.17.gemfile.lock +1 -4
- data/gemfiles/3.1.8.gemfile.lock +1 -4
- data/gemfiles/3.2.8.gemfile.lock +1 -4
- data/{features/support/clearance.rb → lib/clearance/testing/app/controllers/application_controller.rb} +0 -9
- data/lib/clearance/testing/application.rb +46 -0
- data/lib/clearance/testing/config/database.yml +11 -0
- data/lib/clearance/testing/config/routes.rb +3 -0
- data/lib/clearance/version.rb +1 -1
- data/lib/generators/clearance/install/install_generator.rb +103 -22
- data/lib/generators/clearance/install/templates/README +14 -7
- data/lib/generators/clearance/install/templates/db/migrate/add_clearance_to_users.rb +21 -0
- data/lib/generators/clearance/install/templates/db/migrate/create_users.rb +18 -0
- data/lib/generators/clearance/specs/USAGE +5 -0
- data/lib/generators/clearance/specs/specs_generator.rb +13 -0
- data/lib/generators/clearance/specs/templates/factories/clearance.rb +10 -0
- data/lib/generators/clearance/specs/templates/integration/clearance/user_signs_out_spec.rb +10 -0
- data/lib/generators/clearance/specs/templates/integration/clearance/visitor_resets_password_spec.rb +28 -0
- data/lib/generators/clearance/specs/templates/integration/clearance/visitor_signs_in_spec.rb +42 -0
- data/lib/generators/clearance/specs/templates/integration/clearance/visitor_signs_up_spec.rb +21 -0
- data/lib/generators/clearance/specs/templates/integration/clearance/visitor_updates_password_spec.rb +47 -0
- data/lib/generators/clearance/specs/templates/support/action_mailer.rb +3 -0
- data/lib/generators/clearance/specs/templates/support/clearance.rb +1 -0
- data/lib/generators/clearance/specs/templates/support/factory_girl.rb +5 -0
- data/lib/generators/clearance/specs/templates/support/integration.rb +4 -0
- data/lib/generators/clearance/specs/templates/support/integration/action_mailer_helpers.rb +19 -0
- data/lib/generators/clearance/specs/templates/support/integration/clearance_helpers.rb +49 -0
- data/lib/generators/clearance/views/USAGE +15 -0
- data/lib/generators/clearance/views/views_generator.rb +23 -2
- data/spec/controllers/passwords_controller_spec.rb +1 -2
- data/spec/spec_helper.rb +5 -3
- metadata +30 -35
- data/features/engine/visitor_resets_password.feature +0 -34
- data/features/engine/visitor_signs_in.feature +0 -33
- data/features/engine/visitor_signs_out.feature +0 -12
- data/features/engine/visitor_signs_up.feature +0 -17
- data/features/integration.feature +0 -50
- data/features/step_definitions/engine/clearance_steps.rb +0 -124
- data/lib/generators/clearance/features/features_generator.rb +0 -8
- data/lib/generators/clearance/install/templates/db/migrate/upgrade_clearance_to_diesel.rb +0 -37
@@ -1,37 +0,0 @@
|
|
1
|
-
<%
|
2
|
-
existing_columns = ActiveRecord::Base.connection.columns(:users).map(&:name)
|
3
|
-
new_columns = {
|
4
|
-
:email => 't.string :email',
|
5
|
-
:encrypted_password => 't.string :encrypted_password, :limit => 128',
|
6
|
-
:confirmation_token => 't.string :confirmation_token, :limit => 128',
|
7
|
-
:remember_token => 't.string :remember_token, :limit => 128'
|
8
|
-
}.reject { |column| existing_columns.include?(column.to_s) }
|
9
|
-
-%>
|
10
|
-
<%
|
11
|
-
existing_indexes = ActiveRecord::Base.connection.indexes(:users).map(&:name)
|
12
|
-
new_indexes = {
|
13
|
-
:index_users_on_email => 'add_index :users, :email',
|
14
|
-
:index_users_on_remember_token => 'add_index :users, :remember_token'
|
15
|
-
}.reject { |index| existing_indexes.include?(index.to_s) }
|
16
|
-
-%>
|
17
|
-
class UpgradeClearanceToDiesel < ActiveRecord::Migration
|
18
|
-
def self.up
|
19
|
-
change_table :users do |t|
|
20
|
-
<% new_columns.values.each do |column| -%>
|
21
|
-
<%= column %>
|
22
|
-
<% end -%>
|
23
|
-
end
|
24
|
-
|
25
|
-
<% new_indexes.values.each do |index| -%>
|
26
|
-
<%= index %>
|
27
|
-
<% end -%>
|
28
|
-
end
|
29
|
-
|
30
|
-
def self.down
|
31
|
-
change_table :users do |t|
|
32
|
-
<% if new_columns.any? -%>
|
33
|
-
t.remove <%= new_columns.keys.map { |column| ":#{column}" }.join(',') %>
|
34
|
-
<% end -%>
|
35
|
-
end
|
36
|
-
end
|
37
|
-
end
|