Sha256: c4691c386e85d3cc43b2fce5cb4e9efbc44487b8beec5d2b1838b838fb769ed8
Contents?: true
Size: 598 Bytes
Versions: 37
Compression:
Stored size: 598 Bytes
Contents
module Rubix module Associations module HasManyHosts def hosts= hs return unless hs @hosts = hs @host_ids = hs.map(&:id) end def hosts return @hosts if @hosts return unless @host_ids @hosts = @host_ids.map { |hid| Host.find(:id => hid) } end def host_ids= hids return unless hids @host_ids = hids end def host_ids return @host_ids if @host_ids return unless @hosts @host_ids = @hosts.map(&:id) end end end end
Version data entries
37 entries across 37 versions & 1 rubygems