Sha256: b9b4c453eb1d1986ad877001db97a8ec744d533fb10b235c3b152811531868d7
Contents?: true
Size: 698 Bytes
Versions: 8
Compression:
Stored size: 698 Bytes
Contents
module DynamicScaffold module JSONObject module Attribute extend ActiveSupport::Concern included do @json_object_attribute_names ||= [] define_method :valid? do |context = nil| result = super(context) json_object_attribute_names = self.class.instance_variable_get(:@json_object_attribute_names) json_object_attribute_names.all? {|method| public_send(method).valid?(context) } && result end end module ClassMethods def json_object_attributte(attribute_name, model) @json_object_attribute_names << attribute_name serialize attribute_name, model end end end end end
Version data entries
8 entries across 8 versions & 1 rubygems