Skip to content
This repository has been archived by the owner on Jun 7, 2021. It is now read-only.

Commit

Permalink
Merge pull request #97 from prescod/fixtest
Browse files Browse the repository at this point in the history
Update Rails and fix running tests
  • Loading branch information
bborn committed Jul 5, 2012
2 parents bdd754d + 262cff5 commit 044ac2c
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 12 deletions.
24 changes: 14 additions & 10 deletions app/models/user.rb
Expand Up @@ -15,18 +15,22 @@ class User < ActiveRecord::Base
MALE = 'M'
FEMALE = 'F'

acts_as_authentic do |c|
c.transition_from_crypto_providers = CommunityEngineSha1CryptoMethod
c.crypto_provider = Authlogic::CryptoProviders::BCrypt

c.validates_length_of_password_field_options = { :within => 6..20, :if => :password_required? }
c.validates_length_of_password_confirmation_field_options = { :within => 6..20, :if => :password_required? }
begin
acts_as_authentic do |c|
c.transition_from_crypto_providers = CommunityEngineSha1CryptoMethod
c.crypto_provider = Authlogic::CryptoProviders::BCrypt

c.validates_length_of_password_field_options = { :within => 6..20, :if => :password_required? }
c.validates_length_of_password_confirmation_field_options = { :within => 6..20, :if => :password_required? }

c.validates_length_of_login_field_options = { :minimum => 5, :unless => :omniauthed? }
c.validates_format_of_login_field_options = { :with => /\A[\sA-Za-z0-9_-]+\z/, :unless => :omniauthed? }
c.validates_length_of_login_field_options = { :minimum => 5, :unless => :omniauthed? }
c.validates_format_of_login_field_options = { :with => /\A[\sA-Za-z0-9_-]+\z/, :unless => :omniauthed? }

c.validates_length_of_email_field_options = { :within => 3..100, :if => :email_required? }
c.validates_format_of_email_field_options = { :with => /\A([^@\s]+)@((?:[-a-z0-9A-Z]+\.)+[a-zA-Z]{2,})\z/, :if => :email_required? }
c.validates_length_of_email_field_options = { :within => 3..100, :if => :email_required? }
c.validates_format_of_email_field_options = { :with => /\A([^@\s]+)@((?:[-a-z0-9A-Z]+\.)+[a-zA-Z]{2,})\z/, :if => :email_required? }
end
rescue StandardError
puts 'Failed to initialize AuthLogic'
end

acts_as_taggable
Expand Down
2 changes: 1 addition & 1 deletion app/views/sb_posts/_edit.html.erb
Expand Up @@ -28,4 +28,4 @@
<% end -%>
</div>
</div>
<%= include_tiny_mce_if_needed %>
<%= tiny_mce_init_if_needed %>
2 changes: 1 addition & 1 deletion community_engine.gemspec
Expand Up @@ -25,7 +25,7 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split("\n") rescue ''
s.test_files = `git ls-files -- {test}/*`.split("\n")

s.add_dependency(%q<rails>, ["= 3.2.0"])
s.add_dependency(%q<rails>, ["~> 3.2.0"])
s.add_dependency(%q<rack>, [">= 1.4.1"])
s.add_dependency(%q<authlogic>, [">= 0"])
s.add_dependency(%q<bcrypt-ruby>, [">= 0"])
Expand Down

0 comments on commit 044ac2c

Please sign in to comment.