Sha256: 7fd0c91492fa5a5289cfdbb152bba5473585a3f931b7f972d8b11ca3ee1a04f0
Contents?: true
Size: 808 Bytes
Versions: 37
Compression:
Stored size: 808 Bytes
Contents
module Rubix module Associations module HasManyTemplates def templates= hs return unless hs @templates = hs @template_ids = hs.map(&:id) end def templates return @templates if @templates return unless @template_ids @templates = @template_ids.map { |tid| Template.find(:id => tid) } end def template_ids= tids return unless tids @template_ids = tids end def template_ids return @template_ids if @template_ids return unless @templates @template_ids = @templates.map(&:id) end def template_params return [] unless template_ids template_ids.map { |tid| { 'templateid' => tid } } end end end end
Version data entries
37 entries across 37 versions & 1 rubygems