lib/wcc/contentful/model_api.rb in wcc-contentful-1.2.0 vs lib/wcc/contentful/model_api.rb in wcc-contentful-1.2.1
- old
+ new
@@ -49,12 +49,10 @@
def schema
return @schema if @schema
file = configuration.schema_file
schema_json = JSON.parse(File.read(file))['contentTypes']
- unless schema_json
- raise ArgumentError, 'Please give either a JSON array of content types or file to load from'
- end
+ raise ArgumentError, 'Please give either a JSON array of content types or file to load from' unless schema_json
@schema = WCC::Contentful::ContentTypeIndexer.from_json_schema(schema_json).types
end
# Finds an Entry or Asset by ID in the configured contentful space