Commit ef3febbb
Changed files (2)
app
models
app/models/creation.rb
@@ -16,11 +16,11 @@ class Creation < ActiveRecord::Base
end
def primary_image
- photos.any? ? photos.sample : Photo.new
+ published? ? photos.sample : Photo.new
end
def published?
- photos.count > 0
+ photos.any?
end
def is_liked_by(user)
app/models/user.rb
@@ -1,6 +1,6 @@
class User < ActiveRecord::Base
before_save :ensure_authentication_token
- after_create :send_welcome_email
+ after_create :send_welcome_email unless Rails.env.test?
validates :name, :presence => true
validates :website, :format => URI::regexp(%w(http https)), :allow_blank => true