Skip to content
This repository has been archived by the owner on Jul 21, 2020. It is now read-only.

Commit

Permalink
Multiple littles changes : .rhtml to .erb.html, indentation, and mogr…
Browse files Browse the repository at this point in the history
…ation format (t.string and t.datetime instead of t.column …)
  • Loading branch information
Dorian authored and technoweenie committed Jul 21, 2010
1 parent 52d71a8 commit f1a1aad
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 32 deletions.
2 changes: 1 addition & 1 deletion generators/authenticated/templates/controller.rb
Expand Up @@ -3,7 +3,7 @@ class <%= controller_class_name %>Controller < ApplicationController
# Be sure to include AuthenticationSystem in Application Controller instead
include AuthenticatedSystem
# render new.rhtml
# render new.erb.html
def new
end
Expand Down
26 changes: 13 additions & 13 deletions generators/authenticated/templates/migration.rb
@@ -1,21 +1,21 @@
class <%= migration_name %> < ActiveRecord::Migration
def self.up
create_table "<%= table_name %>", :force => true do |t|
t.column :login, :string, :limit => 40
t.column :name, :string, :limit => 100, :default => '', :null => true
t.column :email, :string, :limit => 100
t.column :crypted_password, :string, :limit => 40
t.column :salt, :string, :limit => 40
t.column :created_at, :datetime
t.column :updated_at, :datetime
t.column :remember_token, :string, :limit => 40
t.column :remember_token_expires_at, :datetime
t.string :login, :limit => 40
t.string :name, :limit => 100, :default => '', :null => true
t.string :email, :limit => 100
t.string :crypted_password, :limit => 40
t.string :salt, :limit => 40
t.datetime :created_at
t.datetime :updated_at
t.string :remember_token, :limit => 40
t.datetime :remember_token_expires_at
<% if options[:include_activation] -%>
t.column :activation_code, :string, :limit => 40
t.column :activated_at, :datetime<% end %>
t.string :activation_code, :limit => 40
t.datetime :activated_at<% end %>
<% if options[:stateful] -%>
t.column :state, :string, :null => :no, :default => 'passive'
t.column :deleted_at, :datetime<% end %>
t.string :state, :null => :no, :default => 'passive'
t.datetime :deleted_at<% end %>
end
add_index :<%= table_name %>, :login, :unique => true
end
Expand Down
18 changes: 8 additions & 10 deletions generators/authenticated/templates/model.rb
Expand Up @@ -69,15 +69,13 @@ def email=(value)
write_attribute :email, (value ? value.downcase : nil)
end

<% if options[:include_activation] -%>
protected

<% if options[:include_activation] -%>
def make_activation_code
<% if options[:stateful] -%>
self.deleted_at = nil
<% end -%>
self.activation_code = self.class.make_token
end
<% end %>

def make_activation_code
<% if options[:stateful] -%>
self.deleted_at = nil
<% end -%>
self.activation_code = self.class.make_token
end
<% end %>
end
10 changes: 5 additions & 5 deletions generators/authenticated/templates/model_controller.rb
Expand Up @@ -77,9 +77,9 @@ def purge
# smart -- make sure you check that the visitor is authorized to do so, that they
# supply their old password along with a new one to update it, etc.

protected
def find_<%= file_name %>
@<%= file_name %> = <%= class_name %>.find(params[:id])
end
<% end -%>
protected
def find_<%= file_name %>
@<%= file_name %> = <%= class_name %>.find(params[:id])
end
<% end -%>
end
6 changes: 3 additions & 3 deletions restful-authentication.gemspec
Expand Up @@ -9,11 +9,11 @@ Gem::Specification.new do |s|
s.date = %q{2008-07-04}
s.description = %q{This widely-used plugin provides a foundation for securely managing user.}
s.email = %q{railsjedi@gmail.com}
s.extra_rdoc_files = ["README.textile"]
s.files = ["CHANGELOG", "README.textile", "Rakefile", "TODO", "generators/authenticated/authenticated_generator.rb", "generators/authenticated/lib/insert_routes.rb", "generators/authenticated/templates/_model_partial.html.erb", "generators/authenticated/templates/activation.erb", "generators/authenticated/templates/authenticated_system.rb", "generators/authenticated/templates/authenticated_test_helper.rb", "generators/authenticated/templates/controller.rb", "generators/authenticated/templates/helper.rb", "generators/authenticated/templates/login.html.erb", "generators/authenticated/templates/mailer.rb", "generators/authenticated/templates/migration.rb", "generators/authenticated/templates/model.rb", "generators/authenticated/templates/model_controller.rb", "generators/authenticated/templates/model_helper.rb", "generators/authenticated/templates/model_helper_spec.rb", "generators/authenticated/templates/observer.rb", "generators/authenticated/templates/signup.html.erb", "generators/authenticated/templates/signup_notification.erb", "generators/authenticated/templates/site_keys.rb", "generators/authenticated/templates/spec/controllers/access_control_spec.rb", "generators/authenticated/templates/spec/controllers/authenticated_system_spec.rb", "generators/authenticated/templates/spec/controllers/sessions_controller_spec.rb", "generators/authenticated/templates/spec/controllers/users_controller_spec.rb", "generators/authenticated/templates/spec/fixtures/users.yml", "generators/authenticated/templates/spec/helpers/users_helper_spec.rb", "generators/authenticated/templates/spec/models/user_spec.rb", "generators/authenticated/templates/stories/rest_auth_stories.rb", "generators/authenticated/templates/stories/rest_auth_stories_helper.rb", "generators/authenticated/templates/stories/steps/ra_navigation_steps.rb", "generators/authenticated/templates/stories/steps/ra_resource_steps.rb", "generators/authenticated/templates/stories/steps/ra_response_steps.rb", "generators/authenticated/templates/stories/steps/user_steps.rb", "generators/authenticated/templates/stories/users/accounts.story", "generators/authenticated/templates/stories/users/sessions.story", "generators/authenticated/templates/test/functional_test.rb", "generators/authenticated/templates/test/mailer_test.rb", "generators/authenticated/templates/test/model_functional_test.rb", "generators/authenticated/templates/test/unit_test.rb", "generators/authenticated/USAGE", "init.rb", "lib/authentication/by_cookie_token.rb", "lib/authentication/by_password.rb", "lib/authentication.rb", "lib/authorization/aasm_roles.rb", "lib/authorization/stateful_roles.rb", "lib/authorization.rb", "lib/trustification/email_validation.rb", "lib/trustification.rb", "rails/init.rb"]
s.extra_rdoc_files = ["README.makdown"]
s.files = ["CHANGELOG", "README.markdown", "Rakefile", "TODO", "generators/authenticated/authenticated_generator.rb", "generators/authenticated/lib/insert_routes.rb", "generators/authenticated/templates/_model_partial.html.erb", "generators/authenticated/templates/activation.erb", "generators/authenticated/templates/authenticated_system.rb", "generators/authenticated/templates/authenticated_test_helper.rb", "generators/authenticated/templates/controller.rb", "generators/authenticated/templates/helper.rb", "generators/authenticated/templates/login.html.erb", "generators/authenticated/templates/mailer.rb", "generators/authenticated/templates/migration.rb", "generators/authenticated/templates/model.rb", "generators/authenticated/templates/model_controller.rb", "generators/authenticated/templates/model_helper.rb", "generators/authenticated/templates/model_helper_spec.rb", "generators/authenticated/templates/observer.rb", "generators/authenticated/templates/signup.html.erb", "generators/authenticated/templates/signup_notification.erb", "generators/authenticated/templates/site_keys.rb", "generators/authenticated/templates/spec/controllers/access_control_spec.rb", "generators/authenticated/templates/spec/controllers/authenticated_system_spec.rb", "generators/authenticated/templates/spec/controllers/sessions_controller_spec.rb", "generators/authenticated/templates/spec/controllers/users_controller_spec.rb", "generators/authenticated/templates/spec/fixtures/users.yml", "generators/authenticated/templates/spec/helpers/users_helper_spec.rb", "generators/authenticated/templates/spec/models/user_spec.rb", "generators/authenticated/templates/stories/rest_auth_stories.rb", "generators/authenticated/templates/stories/rest_auth_stories_helper.rb", "generators/authenticated/templates/stories/steps/ra_navigation_steps.rb", "generators/authenticated/templates/stories/steps/ra_resource_steps.rb", "generators/authenticated/templates/stories/steps/ra_response_steps.rb", "generators/authenticated/templates/stories/steps/user_steps.rb", "generators/authenticated/templates/stories/users/accounts.story", "generators/authenticated/templates/stories/users/sessions.story", "generators/authenticated/templates/test/functional_test.rb", "generators/authenticated/templates/test/mailer_test.rb", "generators/authenticated/templates/test/model_functional_test.rb", "generators/authenticated/templates/test/unit_test.rb", "generators/authenticated/USAGE", "init.rb", "lib/authentication/by_cookie_token.rb", "lib/authentication/by_password.rb", "lib/authentication.rb", "lib/authorization/aasm_roles.rb", "lib/authorization/stateful_roles.rb", "lib/authorization.rb", "lib/trustification/email_validation.rb", "lib/trustification.rb", "rails/init.rb"]
s.has_rdoc = true
s.homepage = %q{http://github.com/technoweenie/restful-authentication}
s.rdoc_options = ["--main", "README.textile"]
s.rdoc_options = ["--main", "README.makdown"]

This comment has been minimized.

Copy link
@plantpurecode

plantpurecode Aug 3, 2010

this should probably be s.rdoc_options = ["--main", "README.markdown"]

s.require_paths = ["lib"]
s.rubygems_version = %q{1.3.0}
s.summary = %q{Generates code for user login and authentication}
Expand Down

0 comments on commit f1a1aad

Please sign in to comment.