Previous implementation was not really compatible with active record models. It fixes it with scope instead of methods.
|
|
||
1 |
|
1 |
|
2 |
|
2 |
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
3 |
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
|
8 |
|
|
|
9 |
|
|
|
10 |
|
|
12 |
|
11 |
|
13 |
|
12 |
|
|
|
||
1 |
|
1 |
|
2 |
|
2 |
|
3 |
|
3 |
|
|
4 |
|
|
4 |
|
5 |
|
5 |
|
|
|
6 |
|
6 |
|
7 |
|
7 |
|
8 |
|
8 |
|
9 |
|
|
|
|
9 |
|
|
|
10 |
|
|
|
11 |
|
|
10 |
|
12 |
|
11 |
|
13 |
|
12 |
|
|
|
13 |
|
|
|
|
14 |
|
|
|
15 |
|
|
14 |
|
16 |
|
15 |
|
17 |
|
16 |
|
18 |
|
17 |
|
|
|
18 |
|
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
19 |
|
26 |
|
20 |
|
27 |
|
21 |
|
28 |
|
22 |
|
29 |
|
23 |
|
|
|
24 |
|
|
|
|
30 |
|
|
|
31 |
|
|
25 |
|
32 |
|
26 |
|
33 |
|
27 |
|
34 |
|
28 |
|
|
|
|
35 |
|
|
29 |
|
36 |
|
30 |
|
37 |
|
|
38 |
|
|
|
39 |
|
|
31 |
|
40 |
|
32 |
|
41 |
|
33 |
|
42 |
|
|
|
||
36 |
|
45 |
|
37 |
|
46 |
|
38 |
|
47 |
|
39 |
|
|
|
40 |
|
|
|
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
41 |
|
51 |
|
42 |
|
52 |
|
43 |
|
|
|
44 |
|
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
45 |
|
56 |
|
46 |
|
|
|
47 |
|
|
|
|
57 |
|
|
|
58 |
|
|
|
59 |
|
|
48 |
|
60 |
|
49 |
|
61 |
|
50 |
|
|
|
51 |
|
|
|
|
62 |
|
|
|
63 |
|
|
|
64 |
|
|
52 |
|
65 |
|
53 |
|
66 |
|
54 |
|
67 |
|