Permalink
Browse files

Look for Rails root when searching for Fabricators

  • Loading branch information...
1 parent 5e7c5ef commit c50e1c4d6ba1b5ec7acf60fb2e8b1e90fa7dcd7a Paul Elliott committed Sep 13, 2010
Showing with 7 additions and 1 deletion.
  1. +5 −0 Changelog.markdown
  2. +2 −1 lib/fabrication/support.rb
View
5 Changelog.markdown
@@ -1,3 +1,8 @@
+### 0.7.1 (09/12/2010) ###
+
+* Looks for Rails root when searching for Fabricators
+
+
### 0.7.0 (09/08/2010) ###
* Abbreviated association syntax
View
3 lib/fabrication/support.rb
@@ -23,8 +23,9 @@ def variable_name_to_class_name(name)
end
def find_definitions
+ base_path = defined?(Rails) ? Rails.root : "."
['test', 'spec'].map do |folder|
- path = File.expand_path(File.join(folder, 'fabricators'))
+ path = File.expand_path(File.join(base_path, folder, 'fabricators'))
load("#{path}.rb") if File.exists?("#{path}.rb")

0 comments on commit c50e1c4

Please sign in to comment.