CompanyBook / massive_record

HBase ruby client

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Extend proxies with module / give it a block with logic to include

thhermansen opened this issue · comments

It would be nice to have something like:

module CustomLogicForAddressProxy
  def find_by_street(street)
    # custom logic
  end
end



class Person < MassiveRecord::ORM::Table
  # Either..
  embeds_many :addresses, :extend => CustomLogicForAddressesProxy

  # ..or
  embeds_many :addresses do
    def find_by_street(street)
      # custom logic
    end
  end
end