rails_optimizer 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/rails_optimizer.rb +2 -1
- data/lib/rails_optimizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4dbcf811feb6eb7b70788be32435558802e7a318
|
4
|
+
data.tar.gz: 11a915e895561996d898497b4de9cb0ff98b89e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aee3b50dfd806091de19ce996854a7a05029f97f4e6fc72d0ed54f322a3f77ed07284f652a9576fdc8ef5fc6ce237f2172080e1729ae17223340b2830a8d1afc
|
7
|
+
data.tar.gz: 4fc5b1d865a4dbb59987dd6b36c9c8f900a3c5c7e856643f8bb1fbccf45f6efe5c514a1a50adc29531658d8e87219d3db36695fc293e311e63a0f0f8dceca6f7
|
data/Gemfile.lock
CHANGED
data/lib/rails_optimizer.rb
CHANGED
@@ -30,11 +30,12 @@ module RailsOptimizer
|
|
30
30
|
def self.belongs_to(name, scope = nil, **options)
|
31
31
|
super
|
32
32
|
define_method name.to_s do |*args|
|
33
|
+
super if args.empty?
|
33
34
|
if options[:polymorphic]
|
34
35
|
read_attribute("#{name}_type".to_sym).classify
|
35
36
|
else
|
36
37
|
name.to_s.classify
|
37
|
-
end.constantize.select(
|
38
|
+
end.constantize.select(*args).scoped(scope).finded(self, name)
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|