Skip to content

Instantly share code, notes, and snippets.

@koss-lebedev
Created February 6, 2017 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koss-lebedev/9189224ee099745bbd94fa314278ccf9 to your computer and use it in GitHub Desktop.
Save koss-lebedev/9189224ee099745bbd94fa314278ccf9 to your computer and use it in GitHub Desktop.
Code samples for Medium article
class ProfileAttributeProvider
def initialize(model)
@model = model
end
def call
ProfileField.all.map do |field|
ActiveDynamic::AttributeDefinition.new(field.name, field.datatype)
end
end
private
attr_reader :model
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment