Sha256: 2a56695c7755090da698ee351f86c194ae92f68711b7d2443d6948b23c29f150
Contents?: true
Size: 674 Bytes
Versions: 12
Compression:
Stored size: 674 Bytes
Contents
class Schema def initialize(resource) @schema = resource.get(:schema) end def type(t) @schema.select { |c| c['type'] == t }.map { |c| c['name'] }.uniq end end person_schema = Schema.new(Person) family_schema = Schema.new(Family) DATETIME_ATTRIBUTES = person_schema.type(:datetime) + family_schema.type(:datetime).map { |c| 'family_' + c } BOOLEAN_ATTRIBUTES = person_schema.type(:boolean) + family_schema.type(:boolean).map { |c| 'family_' + c } INTEGER_ATTRIBUTES = person_schema.type(:integer) + family_schema.type(:integer).map { |c| 'family_' + c } IGNORE_ATTRIBUTES = %w(updated_at created_at family_updated_at family_latitude family_longitude)
Version data entries
12 entries across 12 versions & 2 rubygems