cequel 1.4.0 → 1.4.1

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: 94c47d58ecd94cbaf5eb664962dc94aad6fcdfc7
4
- data.tar.gz: 7a88e130ad1aec7083a9acf7efcd3d71a736472e
3
+ metadata.gz: 3fe85356836d10e62c3efee7ccaaa6ed0f2f38a4
4
+ data.tar.gz: 77e489f1612b22a165ac4724db174fd901fc7631
5
5
  SHA512:
6
- metadata.gz: 098e9d6b6e4aafb27140892e5911a65b718c9e869fa975a6d81d690720015c65462e0f59ef1190ea34c30dfca7747a9dac41ea8473edfa8c82666ab39b1a0f7a
7
- data.tar.gz: ca9f78e81f43253dcf48215320e7743211e260b179d85a3df92280d886cf12a5d1277364374eb45f7739467f7498953b4dea6c28c809c8fd68a887113c5e4c78
6
+ metadata.gz: 3ec55765ffbc090cfba486673f3bcc1755b5cd59f360da4dc1e9902bc84bcea33452ddf38c1f5839cf12390d20bcb8c3a46539dbda82d32271ab53fa52ebe54c
7
+ data.tar.gz: c57c6e55f5b2d20cbdcf4878531b4d8c13d7c69e3a75e4ebc45ded534880a7bc8c296c645ef6d4864e059b98835bbd470144e181af55fa481ca0d29ee7dd5879
@@ -1,3 +1,7 @@
1
+ ## 1.4.1
2
+
3
+ * Cequel::Record::descendants doesn't return weakrefs
4
+
1
5
  ## 1.4.0
2
6
 
3
7
  * Support TTL and timestamp options to record persistence methods
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- cequel (1.4.0)
4
+ cequel (1.4.1)
5
5
  activemodel (>= 3.1, < 5.0)
6
6
  cql-rb (>= 1.2, < 3.0)
7
7
 
@@ -122,12 +122,24 @@ module Cequel
122
122
  # @return [Array<Class>] All the record classes that are
123
123
  # currently defined.
124
124
  def descendants
125
- (@descendants ||= []).select(&:weakref_alive?)
125
+ weak_descendants.map do |clazz|
126
+ begin
127
+ clazz.__getobj__ if clazz.weakref_alive?
128
+ rescue WeakRef::RefError
129
+ nil
130
+ end
131
+ end.compact
126
132
  end
127
133
 
128
134
  # Hook called when new record classes are created.
129
135
  def included(base)
130
- @descendants = descendants + [WeakRef.new(base)]
136
+ weak_descendants << WeakRef.new(base)
137
+ end
138
+
139
+ private
140
+
141
+ def weak_descendants
142
+ @weak_descendants ||= []
131
143
  end
132
144
  end
133
145
  end
@@ -88,7 +88,6 @@ module Cequel
88
88
  unless options[:quiet]
89
89
  puts "Synchronized schema for #{record_class.name}"
90
90
  end
91
-
92
91
  rescue Record::MissingTableNameError
93
92
  # It is obviously not a real record class if it doesn't have a
94
93
  # table name.
@@ -1,5 +1,5 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Cequel
3
3
  # The current version of the library
4
- VERSION = '1.4.0'
4
+ VERSION = '1.4.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cequel
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mat Brown