Conditions | 3 |
Total Lines | 11 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | require 'multi_json' |
||
27 | def load_groups_cache(filepath = nil) |
||
28 | if !filepath.nil? && File.exist?(filepath) |
||
29 | groups_json = IO.read filepath |
||
30 | all_groups = MultiJson.decode groups_json |
||
31 | @groups_cache.load_groups all_groups |
||
32 | else |
||
33 | @groups_cache.load_groups @groups.all_groups |
||
34 | end |
||
35 | |||
36 | @posts.groups_cache = @groups_cache |
||
37 | end |
||
38 | end |
||
41 |