Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Upgraded to Virtus 1.0.

commit 67d3f79bbf2cebcb3ca6b9ab91dc2f0d4e254208 1 parent 5d6a0a8
@dblock dblock authored
View
1  CHANGELOG.md
@@ -5,6 +5,7 @@ Next Release
* [#475](https://github.com/intridea/grape/pull/475): Added support for the `:jsonapi`, `application/vnd.api+json` media type registered at http://jsonapi.org - [@bcm](https://github.com/bcm).
* [#471](https://github.com/intridea/grape/issues/471): Added parameter validator for a list of allowed values - [@vickychijwani](https://github.com/vickychijwani).
+* [#488](https://github.com/intridea/grape/issues/488): Upgraded to Virtus 1.0 - [@dblock](https://github.com/dblock).
#### Fixes
View
2  grape.gemspec
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.add_runtime_dependency 'multi_json', '>= 1.3.2'
s.add_runtime_dependency 'multi_xml', '>= 0.5.2'
s.add_runtime_dependency 'hashie', '>= 1.2.0'
- s.add_runtime_dependency 'virtus'
+ s.add_runtime_dependency 'virtus', '>= 1.0.0'
s.add_runtime_dependency 'builder'
s.add_development_dependency 'grape-entity', '>= 0.2.0'
View
4 lib/grape/validations/coerce.rb
@@ -46,11 +46,11 @@ def valid_type?(val)
end
def coerce_value(type, val)
- converter = Virtus::Attribute.build(:a, type)
+ converter = Virtus::Attribute.build(type)
converter.coerce(val)
# not the prettiest but some invalid coercion can currently trigger
- # errors in Virtus (see coerce_spec.rb)
+ # errors in Virtus (see coerce_spec.rb:75)
rescue
InvalidValue.new
end
View
2  spec/grape/validations/coerce_spec.rb
@@ -66,7 +66,7 @@ def app; subject end
context 'complex objects' do
module CoerceValidatorSpec
class User
- include Virtus
+ include Virtus.model
attribute :id, Integer
attribute :name, String
end
Please sign in to comment.
Something went wrong with that request. Please try again.