record_collection 0.7.3 → 0.7.4

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: caaa7c7dfd1edddf70122ae473db11829f38b0af
4
- data.tar.gz: e57cfdef72a6bcc00ad905a1a2de46abeb4ebba3
3
+ metadata.gz: 1a18dd599ddae39a9097d25b2aff3489b383ad91
4
+ data.tar.gz: 52835347a7fa4e3b8185e8c5595f00d14339fbd4
5
5
  SHA512:
6
- metadata.gz: 352c866f3a1bda5fddf1f8218d2e82ba1c9e5a005accb864b98bcba924b192fcce2256b3858718e00edfafcc06fca39b337c54a25449bd7c60f6bed58ff55ec2
7
- data.tar.gz: 2319bf29dce876cfca1cf037b62709a84e08748d8d3c87f9e73d9063c40189bab289c53f2671de025d98509c4aad4d7426fb8ef6af5afbbf9feece0dc6922ae1
6
+ metadata.gz: b1c6b9cbc3bbb195eccd046bf7ef02a82fa68287b0046ef96fad14bad9886faa2689cb664afd8f424a3d5639362df2c5783e9146db7b3e948753fc3640bbbab2
7
+ data.tar.gz: 5df9fa42f9c1a695a1ed9691750f5cd3da7177b3ce1644707492904e263fac46a6754baae688c6e55b5b0497d2faf52bf951f23b64c5e0333dbbb8478e3c6de6
@@ -16,13 +16,15 @@ module RecordCollection
16
16
  record_class.human_attribute_name(*args)
17
17
  end
18
18
 
19
- def inherited(collection_class)
20
- super
21
- # Try to infer the baseclass from the collection inheritance and set it if possible
22
- collection_class.send :cattr_accessor, :record_class
23
- if base_class = collection_class.name.deconstantize.safe_constantize
24
- collection_class.record_class = base_class
25
- end
19
+ # GETTER
20
+ def record_class
21
+ return @record_class if defined?(@record_class)
22
+ @record_class = name.deconstantize.safe_constantize
23
+ end
24
+
25
+ # SETTER
26
+ def record_class=(klass)
27
+ @record_class = klass
26
28
  end
27
29
 
28
30
  def after_record_update(&blk)
@@ -1,3 +1,3 @@
1
1
  module RecordCollection
2
- VERSION = "0.7.3"
2
+ VERSION = "0.7.4"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: record_collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.3
4
+ version: 0.7.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Benjamin ter Kuile
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-19 00:00:00.000000000 Z
11
+ date: 2015-06-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler