Skip to content
This repository was archived by the owner on Jun 2, 2021. It is now read-only.

Conversation

@wwwwhiterabbit
Copy link

class User
  attribute :admin?, default: false
end

person = User.new

person.admin? # => false
person.admin # => false

person.admin! # => #<User:0x00007fb0d45bb0f8 @tainbox_admin=true>
person.admin? # => true
person.admin # => true

person.attributes # => {:admin=>true}
person.as_json # => {"admin"=>true}

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant