From f04b9f676a8d80449c38cd9c3c076105892b8f8b Mon Sep 17 00:00:00 2001 From: Michael Hartl Date: Tue, 14 May 2013 16:48:54 -0700 Subject: [PATCH] Get Guard working with Spork --- Guardfile | 1 + app/models/user.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Guardfile b/Guardfile index 9ff5701af..78aa1f0da 100644 --- a/Guardfile +++ b/Guardfile @@ -1,5 +1,6 @@ # A sample Guardfile # More info at https://github.com/guard/guard#readme +require 'active_support/inflector' guard 'spork', :cucumber_env => { 'RAILS_ENV' => 'test' }, :rspec_env => { 'RAILS_ENV' => 'test' } do diff --git a/app/models/user.rb b/app/models/user.rb index 4e8787426..4925159de 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -8,7 +8,7 @@ class User < ActiveRecord::Base has_many :followers, through: :reverse_relationships, source: :follower before_save { self.email = email.downcase } before_save :create_remember_token - validates :name, presence: true, length: { maximum: 50 } + validates :name, presence: true, length: { maximum: 50 } VALID_EMAIL_REGEX = /\A[\w+\-.]+@[a-z\d\-]+(\.[a-z]+)*\.[a-z]+\z/i validates :email, presence: true, format: { with: VALID_EMAIL_REGEX }, uniqueness: { case_sensitive: false }