Skip to content

Commit

Permalink
Added check for database set up in acts_as_authentic to avoid errors …
Browse files Browse the repository at this point in the history
…during initial migrations
  • Loading branch information
binarylogic committed Nov 14, 2008
1 parent ebdebfa commit 97c6668
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.rdoc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
== 1.1.2 released 2008-11-13

* Added check for database set up in acts_as_authentic to prevent errors during migrations.

== 1.1.1 released 2008-11-13

* Removed ActiveRecord dependency.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,13 @@ def first_column_to_exist(*columns_to_check) # :nodoc:
end

def acts_as_authentic_with_config(options = {})
# Stop all configuration if the DB is not set up
begin
column_names
rescue Exception
return
end

options[:session_class] ||= "#{name}Session"
options[:crypto_provider] ||= CryptoProviders::Sha512
options[:login_field] ||= first_column_to_exist(:login, :username, :email)
Expand Down

0 comments on commit 97c6668

Please sign in to comment.