rails_optimizer 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: db7b90fbb9525326b32fbd31cf0a6e441e358ab6
4
- data.tar.gz: 59e7600fd887d47e4ed0f26c469c7fcc6a0a56d4
3
+ metadata.gz: 13f77501d80e64390517d2db18dfc1a3fb81616e
4
+ data.tar.gz: 997d8440d4c375a378d48275bdcc63f683e3fa39
5
5
  SHA512:
6
- metadata.gz: 19c63413174c06fbb9e8687e0fcf449fe03e95b29a2d6bbeaccde376f0c84d55ffb4d3041dfd68448151a8444e242d1018032a447fafd82f6de1e3301d5aaf56
7
- data.tar.gz: 4db6afa31f33630649aea0db69dbae324ed0bbf03531e2d52e923a9585a6f7235ae244c7baabf321826e1e078644e13107971f04447cb69a6cae00bd3d2f6746
6
+ metadata.gz: 2380df7b3ed1dd6c38ce960b16f05212b41ec64d5a9f9de3aa24de8e6eeb97d7c71198a0fe1a13c59b2a3fb09404599e9fe560a289e4db51d9142a31624dc4bf
7
+ data.tar.gz: '08656e5c75acf0e1cf2a6acfd631ae245fce975681e69a23dc1ea36209c8c3c5c586d97f9ada4c4a160743b0a7a4d79aa96860028d47ec185e049745d962e991'
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- rails_optimizer (0.1.3)
4
+ rails_optimizer (0.1.4)
5
5
  activerecord
6
6
  activesupport
7
7
 
@@ -30,16 +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 arsg.empty?
33
34
  klass = if options[:polymorphic]
34
- read_attribute("#{name}_type".to_sym).classify
35
+ read_attribute("#{name}_type".to_sym)
35
36
  else
36
- name.to_s.classify
37
- end
38
- if args.empty?
39
- klass.select('*').scoped(scope).finded(self, name)
40
- else
41
- klass.constantize.select(*args).scoped(scope).finded(self, name)
42
- end
37
+ name.to_s
38
+ end.classify.constantize.select(*args).scoped(scope).finded(self, name)
43
39
  end
44
40
  end
45
41
 
@@ -1,3 +1,3 @@
1
1
  module RailsOptimizer
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_optimizer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Facundo A. Díaz Martínez