mattly-exegesis 0.2.5 → 0.2.6
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/VERSION.yml +1 -1
- data/lib/exegesis/document.rb +6 -2
- data/test/document_test.rb +12 -1
- data/test/model_test.rb +1 -1
- metadata +2 -2
data/VERSION.yml
CHANGED
data/lib/exegesis/document.rb
CHANGED
|
@@ -19,8 +19,8 @@ module Exegesis
|
|
|
19
19
|
@attributes['updated_at'] = Time.now
|
|
20
20
|
@attributes['created_at'] ||= Time.now
|
|
21
21
|
end
|
|
22
|
-
expose 'updated_at', :as => Time
|
|
23
|
-
expose 'created_at', :as => Time
|
|
22
|
+
expose 'updated_at', :as => Time
|
|
23
|
+
expose 'created_at', :as => Time
|
|
24
24
|
end
|
|
25
25
|
|
|
26
26
|
def unique_id meth=nil, &block
|
|
@@ -86,6 +86,10 @@ module Exegesis
|
|
|
86
86
|
@attachments ||= Exegesis::Document::Attachments.new(self)
|
|
87
87
|
end
|
|
88
88
|
|
|
89
|
+
def _attachments= val
|
|
90
|
+
@attributes['_attachments'] = val
|
|
91
|
+
end
|
|
92
|
+
|
|
89
93
|
def to_json
|
|
90
94
|
@attributes.merge({'_attachments' => @attachments}).to_json
|
|
91
95
|
end
|
data/test/document_test.rb
CHANGED
|
@@ -122,7 +122,7 @@ describe Exegesis::Document do
|
|
|
122
122
|
end
|
|
123
123
|
|
|
124
124
|
describe "updating attributes" do
|
|
125
|
-
|
|
125
|
+
|
|
126
126
|
describe "an existing doc" do
|
|
127
127
|
before do
|
|
128
128
|
@doc = TestDocument.new({'foo' => 'bar'}, @db)
|
|
@@ -171,6 +171,17 @@ describe Exegesis::Document do
|
|
|
171
171
|
end
|
|
172
172
|
end
|
|
173
173
|
|
|
174
|
+
describe "with attachments" do
|
|
175
|
+
before do
|
|
176
|
+
@doc = TestDocument.new({}, @db)
|
|
177
|
+
@doc.update_attributes({'_attachments' =>
|
|
178
|
+
{'file.txt' => {'content_type' => 'text/plain', 'stub' => true}}
|
|
179
|
+
})
|
|
180
|
+
end
|
|
181
|
+
|
|
182
|
+
expect {@doc.attachments['file.txt'].must_be_instance_of(Exegesis::Document::Attachment) }
|
|
183
|
+
end
|
|
184
|
+
|
|
174
185
|
end
|
|
175
186
|
end
|
|
176
187
|
|
data/test/model_test.rb
CHANGED
|
@@ -308,7 +308,7 @@ describe Exegesis::Model do
|
|
|
308
308
|
expect { lambda{@obj.update_attributes({:read_only => 'bee'})}.must_raise NoMethodError }
|
|
309
309
|
end
|
|
310
310
|
|
|
311
|
-
describe "
|
|
311
|
+
describe "filtering reserved keys" do
|
|
312
312
|
before do
|
|
313
313
|
@obj.update_attributes('class' => 'Foo')
|
|
314
314
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: mattly-exegesis
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.2.
|
|
4
|
+
version: 0.2.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matt Lyon
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-05-
|
|
12
|
+
date: 2009-05-12 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|