lib/canard/find_abilities.rb in canard-0.3.4 vs lib/canard/find_abilities.rb in canard-0.3.5
- old
+ new
@@ -19,24 +19,28 @@
ability_definitions[role] = block
end
end
+ def self.load_paths
+ Abilities.definition_paths.map { |path| File.join(Rails.root, path) }
+ end
+
+ # TODO remove at version 0.4.0
def self.find_abilities #:nodoc:
absolute_abilities_path = File.expand_path(abilities_path)
if File.directory? absolute_abilities_path
Dir[File.join(absolute_abilities_path, '**', '*.rb')].sort.each do |file|
self.class_eval File.read(file)
end
end
- Abilities.definition_paths.each do |path|
- Dir[File.join(Rails.root, path, '**', '*.rb')].sort.each do |file|
+ load_paths.each do |path|
+ Dir[File.join(path, '**', '*.rb')].sort.each do |file|
load file
end
end
end
-
end
\ No newline at end of file