Skip to content

Commit 7e64e88

Browse files
committed
fix Model#update_attributes and add Model#update_attributes!
1 parent d30a144 commit 7e64e88

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

docs/tutorials/mongoid-persistence.txt

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,15 +108,27 @@ examples.
108108

109109
* - ``Model#update_attributes``
110110

111-
*Update the provided attributes (and any other dirty fields).*
111+
*Update the document attributes in the database. Will return true if validation passed,
112+
false if not.*
112113
-
113114
.. code-block:: ruby
114115

115-
person.update_attributes!(
116+
person.update_attributes(
116117
first_name: "Jean",
117118
last_name: "Zorg"
118119
)
119120

121+
* - ``Model#update_attributes!``
122+
123+
*Update the document attributes in the database and raise an error if validation failed.*
124+
-
125+
.. code-block:: ruby
126+
127+
person.update_attributes!(
128+
first_name: "Leo",
129+
last_name: "Tolstoy"
130+
)
131+
120132
* - ``Model#update_attribute``
121133

122134
*Update a single attribute, bypassing validations.*
@@ -440,4 +452,4 @@ To create a collection with a default collation from the Mongo console:
440452

441453
.. code-block:: javascript
442454

443-
db.createCollection("name", { collation: { locale: 'fr' } });
455+
db.createCollection("name", { collation: { locale: 'fr' } });

0 commit comments

Comments
 (0)