middleman-dato 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato/field_type/file.rb +1 -1
- data/lib/dato/field_type/image.rb +1 -1
- data/lib/dato/record.rb +5 -3
- data/lib/middleman-dato.rb +2 -2
- data/middleman-dato.gemspec +1 -1
- data/spec/dato/record_spec.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: 7ff8e25ba2b42d4c9257c781ac93dfd2958a87a2
|
4
|
+
data.tar.gz: 01e264b94982172f60542ac2572efe9721796a4f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e233bbab2ea96ba8bc9b6bb5365d7353415ae35997586128665a7d9eba04e45b5f518dbc6c31a048f0bc678e053b3f2f1ead7ed9002c364822479741cf212db8
|
7
|
+
data.tar.gz: 537ff8cc6c89d485e907d92250748c6dde59eab1fca2a6983af334ab586b744b26580991eb701cc6f7ba2bff065b771422ad55f01f0c3718566218ae0fde016b
|
data/lib/dato/field_type/file.rb
CHANGED
data/lib/dato/record.rb
CHANGED
@@ -38,15 +38,17 @@ module Dato
|
|
38
38
|
end
|
39
39
|
|
40
40
|
def content_type
|
41
|
-
entity.content_type
|
41
|
+
@content_type ||= entity.content_type
|
42
42
|
end
|
43
43
|
|
44
44
|
def fields
|
45
|
-
content_type.fields.sort_by(&:position)
|
45
|
+
@fields ||= content_type.fields.sort_by(&:position)
|
46
46
|
end
|
47
47
|
|
48
48
|
def attributes
|
49
|
-
fields.each_with_object(
|
49
|
+
@attributes ||= fields.each_with_object(
|
50
|
+
ActiveSupport::HashWithIndifferentAccess.new
|
51
|
+
) do |field, acc|
|
50
52
|
acc[field.api_key.to_sym] = send(field.api_key)
|
51
53
|
end
|
52
54
|
end
|
data/lib/middleman-dato.rb
CHANGED
data/middleman-dato.gemspec
CHANGED
@@ -3,7 +3,7 @@ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
|
|
3
3
|
|
4
4
|
Gem::Specification.new do |s|
|
5
5
|
s.name = 'middleman-dato'
|
6
|
-
s.version = '0.5.
|
6
|
+
s.version = '0.5.5'
|
7
7
|
s.platform = Gem::Platform::RUBY
|
8
8
|
s.authors = ['Stefano Verna']
|
9
9
|
s.email = ['s.verna@cantierecreativo.net']
|
data/spec/dato/record_spec.rb
CHANGED
@@ -71,7 +71,10 @@ module Dato
|
|
71
71
|
|
72
72
|
describe '#attributes' do
|
73
73
|
it 'returns an hash of the field values' do
|
74
|
-
expected_attributes = {
|
74
|
+
expected_attributes = {
|
75
|
+
'title' => "My titlè with àccents",
|
76
|
+
'body' => 'Hi there'
|
77
|
+
}
|
75
78
|
expect(record.attributes).to eq expected_attributes
|
76
79
|
end
|
77
80
|
end
|