jaysus 0.1.2 → 0.1.3
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.
- data/CHANGELOG +1 -0
- data/VERSION +1 -1
- data/jaysus.gemspec +1 -1
- data/lib/jaysus/base.rb +12 -0
- metadata +3 -3
data/CHANGELOG
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/jaysus.gemspec
CHANGED
data/lib/jaysus/base.rb
CHANGED
@@ -170,6 +170,18 @@ module Jaysus
|
|
170
170
|
"#{send(self.class.model_base.primary_key)}"
|
171
171
|
end
|
172
172
|
|
173
|
+
def to_json
|
174
|
+
{}.tap do |outer_hash|
|
175
|
+
outer_hash[self.class.store_file_dir_name.singularize] = {}.tap do |inner_hash|
|
176
|
+
self.class.model_base.attributes.each do |attribute|
|
177
|
+
if self.send(attribute).present?
|
178
|
+
inner_hash[attribute] = self.send(attribute)
|
179
|
+
end
|
180
|
+
end
|
181
|
+
end
|
182
|
+
end.to_json
|
183
|
+
end
|
184
|
+
|
173
185
|
def persisted?
|
174
186
|
store_file.exist?
|
175
187
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jaysus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Campbell
|