Returns tfr_codes

Ruby code posted by BabyBird
created at 30 Sep 23:07

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
        # Returns tfr_codes
        #       for each node that listing has
        #               for each poly
        #                       if poly belongs to tfr_codes
        #                               then results include the poly-polyable
        def tfr_codes
                results = []
                nodes.each do |node|
                        node.polies.each do |poly|
                                if poly.polyable.class.to_s == "tfr_code".camelize
                                        results << poly.polyable
                                end
                        end
                end
                results.uniq!
                return results
        end
714 Bytes in 18 ms with coderay