Sha256: 3b88599ee30a97a10bc7d8af8b71d10a3a98c878693d4b35cfdb35835215a60c
Contents?: true
Size: 730 Bytes
Versions: 10
Compression:
Stored size: 730 Bytes
Contents
module Clevic # Preliminary code for multi-valued fields. Not working yet. module ManyField # x_to_many fields are by definition collections of other entities def many( &block ) if block many_view( &block ) else many_view do |mb| # TODO should fetch this from one of the field definitions mb.plain related_attribute end end end def many_builder @many_view.builder end def many_fields many_builder.fields end # return an instance of Clevic::View that represents the many items # for this field def many_view( &block ) @many_view ||= View.new( :entity_class => related_class, &block ) end end end
Version data entries
10 entries across 10 versions & 1 rubygems