repositor 0.7.2 → 0.7.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/repositor.rb +0 -2
- data/lib/repositor/active_record.rb +4 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7f9c1108e2bdec1ae51f438910da16941d2b83e7
|
4
|
+
data.tar.gz: 8e32532a6cb587b1892c0bb88b3907de1b1ea74a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 651aa3e9546ab6be9f3869a8ac649582c794c4571a7c1eb3815c34c8aa7028d9a5b3fe6ecc55c15dcd186933efcab6698260b3c177973be8aab75881c6026feb
|
7
|
+
data.tar.gz: 46651337361ec0a03192d87fa122c7fb2ded620e0b98d5d1c8758b2757a8357c44e68862134d4aabd02b2da695aa2d34c8047f413804a32b0cc8788bd5fc68f6
|
data/lib/repositor.rb
CHANGED
@@ -1,3 +1,6 @@
|
|
1
|
+
require 'active_support/core_ext/module/delegation'
|
2
|
+
require 'active_support/inflector'
|
3
|
+
|
1
4
|
module Repositor
|
2
5
|
module ActiveRecord
|
3
6
|
attr_reader :model
|
@@ -14,7 +17,7 @@ module Repositor
|
|
14
17
|
|
15
18
|
def find_or_initialize(id, friendly: false)
|
16
19
|
friendly ? friendly_find(id) : model.find(id)
|
17
|
-
rescue ActiveRecord::RecordNotFound
|
20
|
+
rescue ::ActiveRecord::RecordNotFound
|
18
21
|
model.new
|
19
22
|
end
|
20
23
|
|