Add Model#attributes helper; make test attributes explicit

This commit is contained in:
Benjamin Fleischer
2017-01-07 17:21:33 -06:00
parent 85dfef9072
commit d5babdd060
30 changed files with 524 additions and 308 deletions

View File

@@ -116,7 +116,7 @@ class SomeResource < ActiveRecord::Base
end
# or
class SomeResource < ActiveModelSerializers::Model
attr_accessor :title, :body
attributes :title, :body
end
```
@@ -279,7 +279,7 @@ which is a simple serializable PORO (Plain-Old Ruby Object).
```ruby
class MyModel < ActiveModelSerializers::Model
attr_accessor :id, :name, :level
attributes :id, :name, :level
end
```