-
Notifications
You must be signed in to change notification settings - Fork 8
Support for namespaced model names #3
Copy link
Copy link
Open
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request
Description
Currently when using has_portal and referencing a model in the same namespace you need to also pass :class_name and :portal_key manually as the gem can't figure out the Ruby namespaces. E.g.:
module App
class Family < FmRest::Spyke::Base
has_portal :member, class_name: "App::Member", portal_key: "Family_Member"
end
endLet's also look at how ActiveRecord's relations deal with this... maybe we don't want to default :class_name to same namespace after all 🤔
We probably do want to strip the namespace for the default :portal_key though.
A similar thing happens with the default layout, which currently defaults to the class name, but includes the namespace. E.g.:
module App
class Family < FmRest::Spyke::Base
end
end
App::Family.layout # => "App::Family"We probably want it to default to the class name with namespace removed, e.g. just "Family" in the above example.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingenhancementNew feature or requestNew feature or request