app/helpers/trestle/url_helper.rb in trestle-0.9.5 vs app/helpers/trestle/url_helper.rb in trestle-0.9.6
- old
+ new
@@ -71,19 +71,9 @@
admin.path(options[:action] || :show, id: admin.to_param(instance))
end
end
def admin_for(instance)
- klass = instance.class
-
- while klass
- admin = Trestle.admins[klass.name.underscore.pluralize]
- return admin if admin
-
- klass = klass.superclass
- end
-
- # No admin found
- nil
+ Trestle.lookup_model(instance.class)
end
end
end