lib/trailblazer/loader.rb in trailblazer-loader-0.1.0 vs lib/trailblazer/loader.rb in trailblazer-loader-0.1.1
- old
+ new
@@ -61,10 +61,10 @@
Dir.glob("#{options[:concepts_root]}#{options[:name]}/*/*.rb"). # .rb in :concept/operation/*.rb
find_all { |file| (file.split(File::SEPARATOR) & options[:concept_dirs]).any? } # but only those, no sub-concepts!
end
# operation files should be loaded after callbacks, policies, and the like: [callback.rb, contract.rb, policy.rb, operation.rb]
- SortOperationLast = ->(input, options) { input.sort { |a, b| a =~ /operation/ && b !~ /operation/ ? 1 : a !~ /operation/ && b =~ /operation/ ? 0 : a <=> b } }
+ SortOperationLast = ->(input, options) { input.sort { |a, b| a =~ /operation/ && b !~ /operation/ ? 1 : a !~ /operation/ && b =~ /operation/ ? -1 : a <=> b } }
SortCreateFirst = ->(input, options) { input.sort }
AddConceptFiles = ->(input, options) { input }
# FindRbFiles = ->(input, options) { input + Dir.glob("#{options[:concepts_root]}#{options[:name]}/*.rb") }