Created
February 6, 2017 16:05
-
-
Save koss-lebedev/9189224ee099745bbd94fa314278ccf9 to your computer and use it in GitHub Desktop.
Code samples for Medium article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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