marnen / positron

Don't leak ActiveRecord details into your Rails models!
MIT License
0 stars 0 forks source link

Basic Positron instance method interface #5

Closed marnen closed 9 years ago

marnen commented 10 years ago

As a user When I perform an ActiveRecord query through a Positron host class I receive an instance of the host class So that ActiveRecord details don't leak into the host class

Interface idea:

class Model # not ActiveRecord
  include Positron

  def self.find(id)
    db.find id
  end
end

model = Model.find 3
model.class #=> Model
marnen commented 9 years ago

Reopening. I forgot to memoize the object, to say nothing of wrapping objects returned from DB queries!