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