call to_s on the configured class
This commit is contained in:
parent
a70e2861fa
commit
7cf8339b59
2 changed files with 7 additions and 2 deletions
|
|
@ -22,7 +22,7 @@ module DiasporaFederation
|
|||
# the class to use as +Person+
|
||||
#
|
||||
# @example
|
||||
# config.person_class = Person.to_s
|
||||
# config.person_class = Person
|
||||
#
|
||||
# This class must have the following class methods:::
|
||||
#
|
||||
|
|
@ -87,6 +87,11 @@ module DiasporaFederation
|
|||
# +last_name+: last name
|
||||
# "Name"
|
||||
attr_accessor :person_class
|
||||
|
||||
def person_class=(klass)
|
||||
@person_class = klass.to_s
|
||||
end
|
||||
|
||||
def person_class
|
||||
const_get(@person_class)
|
||||
end
|
||||
|
|
|
|||
|
|
@ -4,5 +4,5 @@ DiasporaFederation.configure do |config|
|
|||
config.server_uri = URI("http://localhost:3000/")
|
||||
|
||||
# the class to be used for a person
|
||||
config.person_class = Person.to_s
|
||||
config.person_class = Person
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue