I imagine this has been brought up before, but I'd really like Rails core 
to add a library which allows plain old Ruby objects (POROs) to be treated 
as models, such as ActiveAttr (https://github.com/cgriego/active_attr) 
or Virtus (https://github.com/solnic/virtus).

ActiveModel comes close to doing this, but there are quite a few gaps such 
as the ability to define attributes on models, e.g.:

class Person
  include ActiveAttr::Attributes

  attribute :first_name, default: "Bob"
  attribute :last_name, type: String     # type-casting
end


The main advantage I see in doing this is that developers no longer need to 
rely on a third-party library which may diverge from Rails standards. 
Moreover, there may be opportunity to consolidate functionality common to 
Mongoid and ActiveRecord in this library.

Thoughts?

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/c8d644d4-d5cf-4b84-b3eb-db7e86df5811%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to