portable_model 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +15 -0
- data/lib/portable_model.rb +7 -1
- data/lib/portable_model/version.rb +1 -1
- metadata +33 -58
checksums.yaml
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
---
|
2
|
+
!binary "U0hBMQ==":
|
3
|
+
metadata.gz: !binary |-
|
4
|
+
ZGMxOWY3ZjVjMmRlY2NiOWY3ZTBkOTA2Nzg0M2JlZTIzMjgxYjIxZQ==
|
5
|
+
data.tar.gz: !binary |-
|
6
|
+
YTk4MTcxMzEwYzNlZGM0ZWZkMjdkZmRkNDA2MmExMzMzZWNkN2IxNQ==
|
7
|
+
SHA512:
|
8
|
+
metadata.gz: !binary |-
|
9
|
+
NTYwYjFkMjYxYThjNTMyYjE1OTUyZmVmN2EwOGNjYmI1ZTBlZDc2ZGM5NjRm
|
10
|
+
MzQyODk0MjhhNGYyNDljOWEwYmVjNDUyYTMwMjY3MTQ2NGYyZDc4YmI3Nzcz
|
11
|
+
NTg5N2VhOGM4NzRjMjc1ZTc1ODQyZmRlZWViNWI0OTQxNGU0MGU=
|
12
|
+
data.tar.gz: !binary |-
|
13
|
+
Mjc5MzI3M2I1YjY3ZGQwZTkwYmE2NDk2MTk1MTkzNjI4NTgyZTc1OWFlMzFm
|
14
|
+
OWUzZjVkZDJmM2M3NzVkZWU5MTA0ZTUwZTIzNzg0NzE3ODk0YzZmNGE1ODQx
|
15
|
+
YzNhMTQ5ZWM4MmY0YjUxZDJjNWIzNDI4ZmM2NTQ1NWI5M2Q3YWU=
|
data/lib/portable_model.rb
CHANGED
@@ -10,6 +10,12 @@ module PortableModel
|
|
10
10
|
base.extend(ClassMethods)
|
11
11
|
end
|
12
12
|
|
13
|
+
# Introduce a virtual attribute that is used to indicate whether the record
|
14
|
+
# is currently being imported. It can be read to skip callbacks and
|
15
|
+
# validations that shouldn't be run when a record is being imported.
|
16
|
+
#
|
17
|
+
attr_accessor :importing_record
|
18
|
+
|
13
19
|
# Export the record to a hash.
|
14
20
|
#
|
15
21
|
def export_to_hash
|
@@ -107,7 +113,7 @@ module PortableModel
|
|
107
113
|
end
|
108
114
|
|
109
115
|
# Create a new record.
|
110
|
-
record = create!(record_hash)
|
116
|
+
record = create!(record_hash.merge(:importing_record => true))
|
111
117
|
|
112
118
|
# Import each of the record's associations into the record.
|
113
119
|
assoc_attrs.each do |assoc_name, assoc_value|
|
metadata
CHANGED
@@ -1,49 +1,36 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: portable_model
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 1
|
8
|
-
- 0
|
9
|
-
- 0
|
10
|
-
version: 1.0.0
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.0
|
11
5
|
platform: ruby
|
12
|
-
authors:
|
6
|
+
authors:
|
13
7
|
- Clyde Law
|
14
8
|
autorequire:
|
15
9
|
bindir: bin
|
16
10
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
11
|
+
date: 2014-01-09 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
22
14
|
name: activerecord
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
- - ">="
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 19
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 3
|
33
|
-
- 8
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - ! '>='
|
18
|
+
- !ruby/object:Gem::Version
|
34
19
|
version: 2.3.8
|
35
20
|
type: :runtime
|
36
|
-
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ! '>='
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: 2.3.8
|
37
27
|
description: Enables exporting and importing an ActiveRecord model's records.
|
38
|
-
email:
|
28
|
+
email:
|
39
29
|
- claw@alum.mit.edu
|
40
30
|
executables: []
|
41
|
-
|
42
31
|
extensions: []
|
43
|
-
|
44
32
|
extra_rdoc_files: []
|
45
|
-
|
46
|
-
files:
|
33
|
+
files:
|
47
34
|
- .gitignore
|
48
35
|
- Gemfile
|
49
36
|
- README.rdoc
|
@@ -52,39 +39,27 @@ files:
|
|
52
39
|
- lib/portable_model/active_record.rb
|
53
40
|
- lib/portable_model/version.rb
|
54
41
|
- portable_model.gemspec
|
55
|
-
has_rdoc: true
|
56
42
|
homepage: http://github.com/Umofomia/portable_model
|
57
43
|
licenses: []
|
58
|
-
|
44
|
+
metadata: {}
|
59
45
|
post_install_message:
|
60
46
|
rdoc_options: []
|
61
|
-
|
62
|
-
require_paths:
|
47
|
+
require_paths:
|
63
48
|
- lib
|
64
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
none: false
|
75
|
-
requirements:
|
76
|
-
- - ">="
|
77
|
-
- !ruby/object:Gem::Version
|
78
|
-
hash: 3
|
79
|
-
segments:
|
80
|
-
- 0
|
81
|
-
version: "0"
|
49
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
50
|
+
requirements:
|
51
|
+
- - ! '>='
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
version: '0'
|
54
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
55
|
+
requirements:
|
56
|
+
- - ! '>='
|
57
|
+
- !ruby/object:Gem::Version
|
58
|
+
version: '0'
|
82
59
|
requirements: []
|
83
|
-
|
84
60
|
rubyforge_project: portable_model
|
85
|
-
rubygems_version: 1.
|
61
|
+
rubygems_version: 2.1.11
|
86
62
|
signing_key:
|
87
|
-
specification_version:
|
63
|
+
specification_version: 4
|
88
64
|
summary: Enables exporting and importing an ActiveRecord model's records.
|
89
65
|
test_files: []
|
90
|
-
|