kentouzu 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa85713258a206beb46ed4132dc5a226c7d99565
4
- data.tar.gz: 828bdaf162a632ae6a42e6b0e81dc1632dd318ec
3
+ metadata.gz: b73eef9055fa6ce7db052eebb04b57717110e2c9
4
+ data.tar.gz: c9d8cfbf7a2453a15f6506af1a9c662b58c1ca96
5
5
  SHA512:
6
- metadata.gz: 69c54b8e8cf754e94e50af1243d242279af7b602e4d27da6d6a9a8f707210f256c44a372d12bfb0da58824da37d4c1f8fd9a3abb00633b7a94a1e370e6115eef
7
- data.tar.gz: 4c5b4be34ecec674ea639dab6b44c166ed0adec813f70b299d4bf753f9be940ab6046e274c0a5ad40a67bba3c37966d9cfb8e7f3200595e143133de924c097a3
6
+ metadata.gz: beacbda4ff7179b36c6b039f935b246d8826f10108dd4ffacae4f6350a8337a649553118910f5205df8bf2206300ce48e3c1e9a9dbef94294283c0ba520c13a4
7
+ data.tar.gz: 7a706e1304061cd246f14d76891cfe262d1323e4508d2ba71f140d47f52fa2153d5d74b46649848733d5f629b78721d38b1cbf96a8546ddfc46d5f94b5e98ac6
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## v0.2.3
2
+
3
+ * Ignore `has_many` associations if they have the `:through` option.
4
+
1
5
  ## v0.2.2
2
6
 
3
7
  * Turns out `save` can take arguments.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- kentouzu (0.2.2)
4
+ kentouzu (0.2.3)
5
5
  activerecord (>= 3.0)
6
6
  railties (>= 3.0)
7
7
 
@@ -89,7 +89,7 @@ class Draft < ActiveRecord::Base
89
89
  model = klass.new
90
90
  end
91
91
 
92
- has_many_associations = model.class.reflect_on_all_associations(:has_many).reject { |association| association.name == :drafts }.map { |association| association.name }
92
+ has_many_associations = model.class.reflect_on_all_associations(:has_many).reject { |association| association.name == :drafts || association.options.keys.include?(:through) }.map { |association| association.name }
93
93
 
94
94
  loaded_object.each do |key, value|
95
95
  if model.respond_to?("#{key}=")
@@ -229,7 +229,7 @@ module Kentouzu
229
229
  :event => draft_event.to_s,
230
230
  :source_type => Kentouzu.source.present? ? Kentouzu.source.class.to_s : nil,
231
231
  :source_id => Kentouzu.source.present? ? Kentouzu.source.id : nil,
232
- :object => self.as_json(include: self.class.reflect_on_all_associations(:has_many).map { |a| a.name }.reject { |a| a == :drafts }).to_yaml
232
+ :object => self.as_json(include: self.class.reflect_on_all_associations(:has_many).reject { |association| association.name == :drafts || association.options.keys.include?(:through) }.map { |association| association.name }).to_yaml
233
233
  }
234
234
 
235
235
  @draft = Draft.new(merge_metadata(data))
@@ -1,3 +1,3 @@
1
1
  module Kentouzu
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kentouzu
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sean Eshbaugh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-22 00:00:00.000000000 Z
11
+ date: 2014-10-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties