How can I implement the self-joins in Batmanjs?
In rails, as found here, it goes like this:
class Employee < ActiveRecord::Base
has_many :subordinates, class_name: "Employee", foreign_key: "manager_id"
belongs_to :manager, class_name: "Employee"
end
My current Batmanjs equivalent model looks like this:
class Employee extends Batman.Model
@resourceName: 'employees'
@storageKey: 'employees'
@persist Batman.LocalStorage
@has_many 'subordinates', name: "Employees", foreignKey: "manager_id"
@belongs_to 'manager', name: "Employee"