Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dynamic attributes #37

Open
giallon opened this issue Aug 10, 2022 · 0 comments
Open

Dynamic attributes #37

giallon opened this issue Aug 10, 2022 · 0 comments

Comments

@giallon
Copy link
Collaborator

giallon commented Aug 10, 2022

By default, Couchbase-orm requires all attributes that may be set on a document to be explicitly defined using attribute declarations. Couchbase-orm should also supports creating attributes on the fly from an arbitrary hash or documents stored in the database.

class Person < CouchbaseOrm::Base
 
end

bob = Person.new(name: 'Bob', age: 42)
bob.name
# => "Bob"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant