Skip to content

Supporting serializing ruby objects #2042

@KevinColemanInc

Description

@KevinColemanInc

Expected behavior vs actual behavior

Expected behavior can be found in the documentation:
https://github.com/rails-api/active_model_serializers/blob/master/README.md#what-does-a-serializable-resource-look-like

Actual Behavior:
NoMethodError: undefined method `attributes' for MyModel:Class

Steps to reproduce

You can paste the code in the documentation into irb.

https://github.com/rails-api/active_model_serializers/blob/master/README.md#what-does-a-serializable-resource-look-like

[1] pry(main)> class MyModel < ActiveModelSerializers::Model
[1] pry(main)*   attributes :id, :name, :level
[1] pry(main)* end
NoMethodError: undefined method `attributes' for MyModel:Class

Environment

ActiveModelSerializers Version (commit ref if not on tag): 0.10.2

Output of ruby -e "puts RUBY_DESCRIPTION": ruby 2.3.3p222 (2016-11-21 revision 56859) [x86_64-darwin16]

OS Type & Version: OSX 10.12.2

Integrated application and version (e.g., Rails, Grape, etc):
rails 4.2.7

Backtrace

(e.g., provide any applicable backtraces from your application)
see above

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions