Closed rriksma closed 8 years ago
Thanks for the PR!
This would be useful, but I think the PR has a few issues:
no_table.rb
, since that module is only intended to get rid of all database access. I'd like it better in its own module.attribute_for_inspect
method should at least be private, or better not be part of AT:Object
at all (maybe a static method in the module).Would the methods be a good fit for virtual_attributes.rb? if not, what would you name the new module?
You could put it into virtual_attributes.rb
, but then you need to change the code so it will also work for ActiveType::Record
and display "real" attributes as well as virtual attributes.
Otherwise, perhaps just put it directly into object.rb
.
I don't really understand your comment about "real" attributes. Do you mean attributes that wouldn't have been in the database? I have added a spec that shows it works for records as well. Maybe you could add a failing spec?
I meant actually persisted attributes. See https://github.com/makandra/active_type/commit/38e5669b3037c136fa142c7e52da9dca9532db4c. As it was only a minor change, I've fixed it already. Thanks for the PR.
Ok, thanks!
Released as 0.5.0.
When I'm debugging I find it convenient to use the inspect method on objects. Currently only the object name is returned for active_type objects. This code is based on ActiveRecord and it returns names and values of attributes.
I've only started using active_type recently so I might have put the code in the wrong place or something like that.
Thanks!