temping 3.5.0 → 3.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/temping.rb +9 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3c776b555a0619329b67d0b0f2f9ab69b3da9c2a
|
4
|
+
data.tar.gz: 4131bbfd5438cba4e5be09aead3b6b0a5433d807
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 794a60b86450c0a221654efb828aff3277be52d0db8038f8c37cd6aa4da1cf51dac57e890858d732743d9e1223e4ec804c8259037424cbde741e338d318b93b5
|
7
|
+
data.tar.gz: 86c94528287fec51235f6557dc59c209cd8a5ea0393f7cdaa21e116764dc164078fb5de089552c967f3a425d476057e505d14b7ff6e5b94276bda4e292e48c10
|
data/lib/temping.rb
CHANGED
@@ -44,7 +44,7 @@ class Temping
|
|
44
44
|
private
|
45
45
|
|
46
46
|
def build
|
47
|
-
Class.new(
|
47
|
+
Class.new(model_parent_class).tap do |klass|
|
48
48
|
Object.const_set(@model_name, klass)
|
49
49
|
|
50
50
|
klass.primary_key = :id
|
@@ -53,6 +53,14 @@ class Temping
|
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
56
|
+
def model_parent_class
|
57
|
+
if ActiveRecord::VERSION::MAJOR > 4 && defined?(ApplicationRecord)
|
58
|
+
ApplicationRecord
|
59
|
+
else
|
60
|
+
ActiveRecord::Base
|
61
|
+
end
|
62
|
+
end
|
63
|
+
|
56
64
|
DEFAULT_OPTIONS = { :temporary => true }
|
57
65
|
def create_table(options = {})
|
58
66
|
connection.create_table(table_name, DEFAULT_OPTIONS.merge(options))
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: temping
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Pignata
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|