Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also .

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also .
Choose a Base Repository
solnic/virtus
11factory/virtus
Bartuz/virtus
Carolyn-Ann/virtus
ChasManRors/virtus
DamirSvrtan/virtus
Domon/virtus
GeorgeErickson/virtus
Gibheer/virtus
JanDintel/virtus
JanaVPetrova/virtus
JuanitoFatas/virtus
JulianDevilleSmith/virtus
JuniorJoanis/virtus
JustMikey/virtus
PseudoCorps/virtus
RKushnir/virtus
RichGuk/virtus
aarondcohen/virtus
adriagalin/virtus
akatz/virtus
alexggordon/virtus
alhafoudh/virtus
alvargaya/virtus
amarshall/virtus
andreev/virtus
andrewmacgregor/virtus
annemnichols/virtus
ansarbek/virtus
apotonick/virtus
artemeff/virtus
ashish173/virtus
ashmoran/virtus
atteeela/virtus
baojjeu/virtus
baweaver/virtus
bcobb/virtus
benlangfeld/virtus
betamatt/virtus
blashca/virtus
bmorton/virtus
bolpin/virtus
booch/virtus
bradrobertson/virtus
brutuscat/virtus
burmajam/virtus
byronanderson/virtus
canadaduane/virtus
cfcosta/virtus
cflipse/virtus
chanbobby1/virtus
chastell/virtus
cheesecow/virtus
chromamatic/virtus
ck3g/virtus
classicist/virtus
codesnik/virtus
cored/virtus
craiglittle/virtus
davekaro/virtus
davwards/virtus
dblock/virtus
dfmonaco/virtus
din982/virtus
dredozubov/virtus
dslh/virtus
dwbutler/virtus
edgibbs/virtus
edipofederle/virtus
ef37/virtus
elskwid/virtus
emmanuel/virtus
eregon/virtus
erich/virtus
errinlarsen/virtus
evandrodp/virtus
evilexp/virtus
faucct/virtus
femto/virtus
fgrehm/virtus
fredwu/virtus
geshi0820/virtus
gildo/virtus
giorgil2/virtus
gmanley/virtus
gowrinaidu/virtus
greyblake/virtus
gullitmiranda/virtus
hampei/virtus
hapiben/virtus
hendricius/virtus
hookercookerman/virtus
jamesalmond/virtus
jamiepg1/virtus
janjiss/virtus
jessethegame/virtus
jgaskins/virtus
jjmason/virtus
jkeiser/virtus
jmgarnier/virtus
joevandyk/virtus
johnbintz/virtus
jpmoral/virtus
jreinert/virtus
jrmhaig/virtus
junk16/virtus
jurinco/virtus
justfalter/virtus
jvalentini/virtus
ka8725/virtus
kawamanza/virtus
kbarber/virtus
kevinzhoucn/virtus
khacluan/virtus
klreierson/virtus
kreba/virtus
krisleech/virtus
kristianmandrup/virtus
ktimothy/virtus
kumarvvr/virtus
kunkaiHuang/virtus
kurko/virtus
lanrion/virtus
leemhenson/virtus
lfender6445/virtus
lgierth/virtus
lime/virtus
loganhasson/virtus
lovehandle/virtus
lwoodson/virtus
lylejohnson/virtus
macressler/virtus
mallikarjunayaddala/virtus
managr/virtus
marchyoung/virtus
marten/virtus
mattgillooly/virtus
mattwynne/virtus
mbj/virtus
mduvall/virtus
melhotiby/virtus
michaelachrisco/virtus
michaelvu812/virtus
mirasrael/virtus
mleadbeater/virtus
mlydka/virtus
mraaroncruz/virtus
mrorbita/virtus
muthhus/virtus
netconstructor/virtus
ngpestelos/virtus
nicholasray/virtus
nicolasblanco/virtus
novikserg/virtus
nuclearsandwich/virtus
nunommc/virtus
oddlyzen/virtus
offslinker/virtus
osondoar/virtus
pb-pravin/virtus
pewniak747/virtus
pmrowczynski/virtus
postmodern/virtus
prasadsurase/virtus
pvdb/virtus
rajeev-khangar/virtus
renato-zannon/virtus
rewritten/virtus
rgrinberg/virtus
righi/virtus
robb-broome/virtus
rodolfoliviero/virtus
rodrigovirgilio/virtus
rrrene/virtus
rshell/virtus
schmurfy/virtus
senny/virtus
shingara/virtus
sickill/virtus
sineed/virtus
skippy/virtus
smanolloff/virtus
solenko/virtus
sqrrrl/virtus
steven-zhou/virtus
syguer/virtus
tjarratt/virtus
tjstankus/virtus
tom025/virtus
tracyloisel/virtus
trptcolin/virtus
vinbarnes/virtus
willmurphyscode/virtus
xescugc/virtus
xor3/virtus
xueming-yi/virtus
yayajacky/virtus
yzhanginwa/virtus
zacholauson/virtus
zirni/virtus
Nothing to show
Choose a base branch
Nothing to show
...
Choose a Head Repository
solnic/virtus
11factory/virtus
Bartuz/virtus
Carolyn-Ann/virtus
ChasManRors/virtus
DamirSvrtan/virtus
Domon/virtus
GeorgeErickson/virtus
Gibheer/virtus
JanDintel/virtus
JanaVPetrova/virtus
JuanitoFatas/virtus
JulianDevilleSmith/virtus
JuniorJoanis/virtus
JustMikey/virtus
PseudoCorps/virtus
RKushnir/virtus
RichGuk/virtus
aarondcohen/virtus
adriagalin/virtus
akatz/virtus
alexggordon/virtus
alhafoudh/virtus
alvargaya/virtus
amarshall/virtus
andreev/virtus
andrewmacgregor/virtus
annemnichols/virtus
ansarbek/virtus
apotonick/virtus
artemeff/virtus
ashish173/virtus
ashmoran/virtus
atteeela/virtus
baojjeu/virtus
baweaver/virtus
bcobb/virtus
benlangfeld/virtus
betamatt/virtus
blashca/virtus
bmorton/virtus
bolpin/virtus
booch/virtus
bradrobertson/virtus
brutuscat/virtus
burmajam/virtus
byronanderson/virtus
canadaduane/virtus
cfcosta/virtus
cflipse/virtus
chanbobby1/virtus
chastell/virtus
cheesecow/virtus
chromamatic/virtus
ck3g/virtus
classicist/virtus
codesnik/virtus
cored/virtus
craiglittle/virtus
davekaro/virtus
davwards/virtus
dblock/virtus
dfmonaco/virtus
din982/virtus
dredozubov/virtus
dslh/virtus
dwbutler/virtus
edgibbs/virtus
edipofederle/virtus
ef37/virtus
elskwid/virtus
emmanuel/virtus
eregon/virtus
erich/virtus
errinlarsen/virtus
evandrodp/virtus
evilexp/virtus
faucct/virtus
femto/virtus
fgrehm/virtus
fredwu/virtus
geshi0820/virtus
gildo/virtus
giorgil2/virtus
gmanley/virtus
gowrinaidu/virtus
greyblake/virtus
gullitmiranda/virtus
hampei/virtus
hapiben/virtus
hendricius/virtus
hookercookerman/virtus
jamesalmond/virtus
jamiepg1/virtus
janjiss/virtus
jessethegame/virtus
jgaskins/virtus
jjmason/virtus
jkeiser/virtus
jmgarnier/virtus
joevandyk/virtus
johnbintz/virtus
jpmoral/virtus
jreinert/virtus
jrmhaig/virtus
junk16/virtus
jurinco/virtus
justfalter/virtus
jvalentini/virtus
ka8725/virtus
kawamanza/virtus
kbarber/virtus
kevinzhoucn/virtus
khacluan/virtus
klreierson/virtus
kreba/virtus
krisleech/virtus
kristianmandrup/virtus
ktimothy/virtus
kumarvvr/virtus
kunkaiHuang/virtus
kurko/virtus
lanrion/virtus
leemhenson/virtus
lfender6445/virtus
lgierth/virtus
lime/virtus
loganhasson/virtus
lovehandle/virtus
lwoodson/virtus
lylejohnson/virtus
macressler/virtus
mallikarjunayaddala/virtus
managr/virtus
marchyoung/virtus
marten/virtus
mattgillooly/virtus
mattwynne/virtus
mbj/virtus
mduvall/virtus
melhotiby/virtus
michaelachrisco/virtus
michaelvu812/virtus
mirasrael/virtus
mleadbeater/virtus
mlydka/virtus
mraaroncruz/virtus
mrorbita/virtus
muthhus/virtus
netconstructor/virtus
ngpestelos/virtus
nicholasray/virtus
nicolasblanco/virtus
novikserg/virtus
nuclearsandwich/virtus
nunommc/virtus
oddlyzen/virtus
offslinker/virtus
osondoar/virtus
pb-pravin/virtus
pewniak747/virtus
pmrowczynski/virtus
postmodern/virtus
prasadsurase/virtus
pvdb/virtus
rajeev-khangar/virtus
renato-zannon/virtus
rewritten/virtus
rgrinberg/virtus
righi/virtus
robb-broome/virtus
rodolfoliviero/virtus
rodrigovirgilio/virtus
rrrene/virtus
rshell/virtus
schmurfy/virtus
senny/virtus
shingara/virtus
sickill/virtus
sineed/virtus
skippy/virtus
smanolloff/virtus
solenko/virtus
sqrrrl/virtus
steven-zhou/virtus
syguer/virtus
tjarratt/virtus
tjstankus/virtus
tom025/virtus
tracyloisel/virtus
trptcolin/virtus
vinbarnes/virtus
willmurphyscode/virtus
xescugc/virtus
xor3/virtus
xueming-yi/virtus
yayajacky/virtus
yzhanginwa/virtus
zacholauson/virtus
zirni/virtus
Nothing to show
Choose a head branch
Nothing to show
  • 7 commits
  • 8 files changed
  • 0 commit comments
  • 2 contributors
View
@@ -1,3 +1,9 @@
+# v0.5.1 2012-06-11
+
+* [fixed] EV properly handle nil as the value (solnic)
+
+[Compare v0.5.0..v0.5.1](https://github.com/solnic/virtus/compare/v0.5.0...v0.5.1)
+
# v0.5.0 2012-06-08
* [feature] Support for extending objects (solnic)
@@ -6,7 +12,7 @@
* [changed] Allow any input for EmbeddedValue and ValueObject constructors (solnic)
* [changed] ValueObject instances cannot be duped or cloned (senny)
-[Compare v0.4.2..master](https://github.com/solnic/virtus/compare/v0.4.2...master)
+[Compare v0.4.2..v0.5.0](https://github.com/solnic/virtus/compare/v0.4.2...v0.5.0)
# v0.4.2 2012-05-08
View
@@ -1,4 +1,4 @@
-Copyright (c) 2011 Piotr Solnica
+Copyright (c) 2011-2012 Piotr Solnica
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
View
@@ -30,6 +30,9 @@ gem 'virtus'
Examples
--------
+### Using Virtus with Classes
+
+You can create classes extended with virtus and define attributes:
``` ruby
class User
@@ -41,7 +44,7 @@ class User
end
user = User.new(:name => 'Piotr', :age => 28)
-user.attribute_set # => { :name => "Piotr", :age => 28 }
+user.attributes # => { :name => "Piotr", :age => 28 }
user.name # => "Piotr"
@@ -51,7 +54,7 @@ user.age.class # => Fixnum
user.birthday = 'November 18th, 1983' # => #<DateTime: 1983-11-18T00:00:00+00:00 (4891313/2,0/1,2299161)>
```
-### Using Virtus With Modules
+### Using Virtus with Modules
You can create modules extended with virtus and define attributes for later
inclusion in your classes:
@@ -330,7 +333,7 @@ Contributing
License
-------
-Copyright (c) 2011 Piotr Solnica
+Copyright (c) 2011-2012 Piotr Solnica
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
@@ -8,7 +8,9 @@ class FromOpenStruct < EmbeddedValue
# @api private
def coerce(attributes)
- super or @primitive.new(attributes)
+ unless attributes.nil?
+ super or @primitive.new(attributes)
+ end
end
end # class FromOpenStruct
@@ -8,7 +8,9 @@ class FromStruct < EmbeddedValue
# @api private
def coerce(attributes)
- super or @primitive.new(*attributes)
+ unless attributes.nil?
+ super or @primitive.new(*attributes)
+ end
end
end # class FromStruct
View
@@ -1,3 +1,3 @@
module Virtus
- VERSION = '0.5.0'
+ VERSION = '0.5.1'
end
@@ -9,6 +9,12 @@
described_class.new(:name, :primitive => primitive)
end
+ context 'when the value is nil' do
+ let(:value) { nil }
+
+ it { should be_nil }
+ end
+
context 'when the value is a primitive instance' do
let(:value) { primitive.new }
@@ -9,6 +9,12 @@
described_class.new(:name, :primitive => primitive)
end
+ context 'when the value is nil' do
+ let(:value) { nil }
+
+ it { should be_nil }
+ end
+
context 'when the value is a primitive instance' do
let(:value) { primitive.new }

No commit comments for this range