Permalink
Browse files

Fix wrong example code in RDoc for Model#{set,update}_fields

  • Loading branch information...
1 parent 4139dd9 commit 6e65d3b0530cad9d2006d1bd416dc8632fac65c0 @jeremyevans committed Apr 14, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/sequel/model/base.rb
View
8 lib/sequel/model/base.rb
@@ -1086,10 +1086,10 @@ def set_except(hash, *except)
# For each of the fields in the given array +fields+, call the setter
# method with the value of that +hash+ entry for the field. Returns self.
#
- # artist.set_fields({:name=>'Jim'}, :name)
+ # artist.set_fields({:name=>'Jim'}, [:name])
# artist.name # => 'Jim'
#
- # artist.set_fields({:hometown=>'LA'}, :name)
+ # artist.set_fields({:hometown=>'LA'}, [:name])
# artist.name # => nil
# artist.hometown # => 'Sac'
def set_fields(hash, fields)
@@ -1149,10 +1149,10 @@ def update_except(hash, *except)
# Update the instances values by calling +set_fields+ with the +hash+
# and +fields+, then save any changes to the record. Returns self.
#
- # artist.update_fields({:name=>'Jim'}, :name)
+ # artist.update_fields({:name=>'Jim'}, [:name])
# # UPDATE artists SET name = 'Jim' WHERE (id = 1)
#
- # artist.update_fields({:hometown=>'LA'}, :name)
+ # artist.update_fields({:hometown=>'LA'}, [:name])
# # UPDATE artists SET name = NULL WHERE (id = 1)
def update_fields(hash, fields)
set_fields(hash, fields)

0 comments on commit 6e65d3b

Please sign in to comment.