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

Version Path
active_scaffold-3.4.43 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.42 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.41.1 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.41 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.40 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.39 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.38 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.37 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.36 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.35 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.34 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.33 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.32 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.31 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.30 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.29 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.28 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.27 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.26 lib/active_scaffold/bridges/semantic_attributes/column.rb
active_scaffold-3.4.25 lib/active_scaffold/bridges/semantic_attributes/column.rb