aboutsummaryrefslogtreecommitdiffstats
path: root/guides/source/active_model_basics.md
diff options
context:
space:
mode:
Diffstat (limited to 'guides/source/active_model_basics.md')
-rw-r--r--guides/source/active_model_basics.md12
1 files changed, 6 insertions, 6 deletions
diff --git a/guides/source/active_model_basics.md b/guides/source/active_model_basics.md
index 68ac26c681..0019d08328 100644
--- a/guides/source/active_model_basics.md
+++ b/guides/source/active_model_basics.md
@@ -14,7 +14,7 @@ Active Model is a library containing various modules used in developing framewor
### AttributeMethods
-The AttributeMethods module can add custom prefixes and suffixes on methods of a class. It is used by defining the prefixes and suffixes, which methods on the object will use them.
+The AttributeMethods module can add custom prefixes and suffixes on methods of a class. It is used by defining the prefixes and suffixes and which methods on the object will use them.
```ruby
class Person
@@ -45,7 +45,7 @@ person.age_highest? # false
### Callbacks
-Callbacks gives Active Record style callbacks. This provides the ability to define the callbacks and those will run at appropriate time. After defining a callbacks you can wrap with before, after and around custom methods.
+Callbacks gives Active Record style callbacks. This provides an ability to define callbacks which run at appropriate times. After defining callbacks, you can wrap them with before, after and around custom methods.
```ruby
class Person
@@ -57,19 +57,19 @@ class Person
def update
run_callbacks(:update) do
- # This will call when we are trying to call update on object.
+ # This method is called when update is called on an object.
end
end
def reset_me
- # This method will call when you are calling update on object as a before_update callback as defined.
+ # This method is called when update is called on an object as a before_update callback is defined.
end
end
```
### Conversion
-If a class defines `persisted?` and `id` methods then you can include `Conversion` module in that class and you can able to call Rails conversion methods to objects of that class.
+If a class defines `persisted?` and `id` methods, then you can include the `Conversion` module in that class and call the Rails conversion methods on objects of that class.
```ruby
class Person
@@ -120,8 +120,8 @@ class Person
end
def save
- @previously_changed = changes
# do save work...
+ changes_applied
end
end
```