Sha256: acf9fa7f9d4f0bfd2c0a380c056dff83efd7aaa88dc802cab3b1630a0bffb48f
Contents?: true
Size: 833 Bytes
Versions: 29
Compression:
Stored size: 833 Bytes
Contents
class ActiveScaffold::Bridges::SemanticAttributes module Column def self.included(base) base.class_eval { alias_method_chain :initialize, :semantic_attributes } end def initialize_with_semantic_attributes(name, active_record_class) initialize_without_semantic_attributes(name, active_record_class) self.required = !active_record_class.semantic_attributes[self.name].predicates.find { |p| p.allow_empty? == false }.nil? active_record_class.semantic_attributes[self.name].predicates.find do |p| sem_type = p.class.to_s.split('::')[1].underscore.to_sym next if [:required, :association].include?(sem_type) @form_ui = sem_type end end end end ActiveScaffold::DataStructures::Column.class_eval do include ActiveScaffold::Bridges::SemanticAttributes::Column end
Version data entries
29 entries across 29 versions & 1 rubygems