Created
August 4, 2011 05:24
-
-
Save rafaelp/1124551 to your computer and use it in GitHub Desktop.
Reset Sequences no Factory Girl 2.02
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module FactoryGirl | |
class Sequence | |
def reset | |
@value = 1 | |
end | |
end | |
module Syntax | |
module Vintage | |
module Factory | |
def self.reset_sequences | |
FactoryGirl.sequences.each do |sequence| | |
sequence.reset | |
end | |
end | |
def self.reset_sequence_by_name(name) | |
FactoryGirl.sequence_by_name(name).reset | |
end | |
end | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment