Skip to content

Commit 1b36fa4

Browse files
committed
add all method
1 parent c77a3fa commit 1b36fa4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

lib/tinyrails/file_model.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ def self.find(id)
2828
return nil
2929
end
3030
end
31+
32+
def self.all
33+
files = Dir["app/db/tweets/*.json"]
34+
files.map { |f| FileModel.new f }
35+
end
3136
end
3237
end
3338
end

0 commit comments

Comments
 (0)