File tree Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Expand file tree Collapse file tree 1 file changed +2
-5
lines changed Original file line number Diff line number Diff line change @@ -364,19 +364,16 @@ def visible_models(bindings)
364
364
365
365
private
366
366
367
- def lchomp ( base , arg )
368
- base . to_s . reverse . chomp ( arg . to_s . reverse ) . reverse
369
- end
370
-
371
367
def viable_models
372
368
included_models . collect ( &:to_s ) . presence || begin
373
369
@@system_models ||= # memoization for tests
374
370
( [ Rails . application ] + Rails ::Engine . subclasses . collect ( &:instance ) ) . flat_map do |app |
375
371
( app . paths [ 'app/models' ] . to_a + app . config . eager_load_paths ) . collect do |load_path |
376
372
Dir . glob ( app . root . join ( load_path ) ) . collect do |load_dir |
373
+ path_prefix = "#{ app . root . join ( load_dir ) } /"
377
374
Dir . glob ( "#{ load_dir } /**/*.rb" ) . collect do |filename |
378
375
# app/models/module/class.rb => module/class.rb => module/class => Module::Class
379
- lchomp ( filename , " #{ app . root . join ( load_dir ) } /" ) . chomp ( '.rb' ) . camelize
376
+ filename . delete_prefix ( path_prefix ) . chomp ( '.rb' ) . camelize
380
377
end
381
378
end
382
379
end
You can’t perform that action at this time.
0 commit comments