tramway-core 1.11.2 → 1.11.2.1

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
  SHA256:
3
- metadata.gz: '08d6ae73913d795796280bd95921fd183b9c5931ad108ead009b16b78989d5fe'
4
- data.tar.gz: 750b88db7c70b119c282a0f59d6f67f3b5cd82f1a8783eab48aff5223095d5f7
3
+ metadata.gz: 37e67486fa7b4d30a04458655b613d872ecd1c4e04281831d7196c1af7a66844
4
+ data.tar.gz: 4a45ed90f8a69a8c772ff1ac5c82cd139618b17e6417e9730cab89b67ab1b3f4
5
5
  SHA512:
6
- metadata.gz: 0b68b0b2247476b927ba050b4256926b9698453fbe38fb7eaa97d37c219da9f3307407c989c101746b254b7ccbf968599fb9446baf0c09472dc2464258dc70a5
7
- data.tar.gz: d49b32f30fb6e1c33c6890c3aa610b2a1f93d32e71207622fb2e8b0b486a7296c553908f6cccc099b0d58701ab70f2f0bdddcdc69f6d62899c5ddad0cf70e186
6
+ metadata.gz: e1d7d0bb96e4af2272de7df6b71ebda6a445a89b06c2d2b7a816b5697d62a88fd12f316893fb0b84dd7125db0dff125d8702a7f23a7a59ba0a6121af0ed10194
7
+ data.tar.gz: 13d6dd9a69f67cdff2f058bf376b38d3e93e4751ea49e127ab82585f41e983260b885a7a1301b4915f815f30252d4ce82fb8c42a4e09125514555dad31c4331e
@@ -62,14 +62,13 @@ class Tramway::Core::ApplicationDecorator
62
62
  association.options[:class_name]
63
63
  end
64
64
  decorator_class_name = decorator || "#{class_name.to_s.singularize}Decorator".constantize
65
- # FIXME rails has_many association don't have belongs_to? method... bullshit. Need PR to rails
66
- if association.try :has_many?
67
- object.send(association_name).active.map do |association_object|
65
+ if association.class == ActiveRecord::Reflection::HasManyReflection
66
+ return object.send(association_name).active.map do |association_object|
68
67
  decorator_class_name.decorate association_object
69
68
  end
70
69
  end
71
- if association.try :belongs_to?
72
- decorator_class_name.decorate object.send association_name
70
+ if association.class == ActiveRecord::Reflection::BelongsToReflection
71
+ return decorator_class_name.decorate object.send association_name
73
72
  end
74
73
  end
75
74
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Core
3
- VERSION = '1.11.2'
3
+ VERSION = '1.11.2.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-07-10 00:00:00.000000000 Z
11
+ date: 2019-07-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reform-rails