Module: FixtureReplacement::ClassMethods
Instance Method Summary
collapse
#random_email, #random_first_name, #random_incrementing_number, #random_last_name, #random_name, #random_string
Instance Method Details
#attributes_for(fixture_name, options = {}, &block) ⇒ Object
#included(_other_mod) ⇒ Object
5
6
7
|
# File 'lib/fixture_replacement/class_methods.rb', line 5
def included(_other_mod)
FixtureReplacement.load!
end
|
#load! ⇒ Object
18
19
20
21
22
|
# File 'lib/fixture_replacement/class_methods.rb', line 18
def load!
load "#{rails_root}/db/example_data.rb"
rescue LoadError, NameError
end
|
#rails_root ⇒ Object
24
25
26
27
28
|
# File 'lib/fixture_replacement/class_methods.rb', line 24
def rails_root
::Rails.root
rescue NameError
"."
end
|
#reload! ⇒ Object
30
31
32
33
|
# File 'lib/fixture_replacement/class_methods.rb', line 30
def reload!
AttributeBuilder.clear_out_instances!
load File.expand_path(File.dirname(__FILE__) + "/../fixture_replacement.rb")
end
|