Моя проблема проста, но в то же время я очень потерян.
В консоли рельсов я делаю:
Sensor.all и он возвращает это:
#<ActiveRecord::Relation [#<Sensor id: 273, name: "pisote", parent_id: 272, ip: nil, latitude: nil, longitude: nil, is_deleted: false, applied_at: nil, type: 1, real_parent_id: nil, group_id: nil, binding_id: nil, need_apply: false, created_at: "2019-09-19 13:39:25", updated_at: "2019-09-19 13:39:25", applying: false, property: {"floor_level"=>0, "path"=>"serviceProvider / namespace / org"}, domain_type: 101, unassigned: false, lft: 5, rgt: 6, depth: 3, children_count: nil, uuid: "2070fb52-97b4-4029-a50d-014ed203282c", unclaimed: false, license_id: nil, policy_id: nil, reputation_policy_id: nil, need_reputation_apply: false, zone: "[{\"id\":null,\"name\":\"z1\",\"sensor_id\":273,\"descripti...">, #<Sensor id: 271, name: "namespace", parent_id: 270, ip: nil, latitude: nil, longitude: nil, is_deleted: false, applied_at: nil, type: 1, real_parent_id: nil, group_id: nil, binding_id: nil, need_apply: false, created_at: "2019-09-19 13:39:23", updated_at: "2019-09-19 13:39:25", applying: false, property: {"domain_zones"=>"", "path"=>"serviceProvider"}, domain_type: 8, unassigned: false, lft: 3, rgt: 8, depth: 1, children_count: nil, uuid: "41ed2688-5fcf-474f-8829-26fde5ef9d6b", unclaimed: false, license_id: nil, policy_id: nil, reputation_policy_id: nil, need_reputation_apply: false, zone: nil>, #<Sensor id: 270, name: "serviceProvider", parent_id: 1, ip: nil, latitude: nil, longitude: nil, is_deleted: false, applied_at: nil, type: 1, real_parent_id: nil, group_id: nil, binding_id: nil, need_apply: false, created_at: "2019-09-19 13:39:23", updated_at: "2019-09-19 13:39:25", applying: false, property: {"domain_zones"=>"", "path"=>""}, domain_type: 6, unassigned: false, lft: 2, rgt: 9, depth: 0, children_count: nil, uuid: "9b401f72-52e0-4bd9-b980-d63f237a7d3f", unclaimed: false, license_id: nil, policy_id: nil, reputation_policy_id: nil, need_reputation_apply: false, zone: nil>, #<Sensor id: 272, name: "org", parent_id: 271, ip: nil, latitude: nil, longitude: nil, is_deleted: false, applied_at: nil, type: 1, real_parent_id: nil, group_id: nil, binding_id: nil, need_apply: false, created_at: "2019-09-19 13:39:24", updated_at: "2019-09-19 13:39:25", applying: false, property: {"domain_zones"=>"", "active_modules"=>"ap_state,flow,ips,location,monitor,social,vault", "path"=>"serviceProvider / namespace"}, domain_type: 2, unassigned: false, lft: 4, rgt: 7, depth: 2, children_count: nil, uuid: "dfb4e073-7f47-4fc0-958e-9a9e0585e50e", unclaimed: false, license_id: nil, policy_id: nil, reputation_policy_id: nil, need_reputation_apply: false, zone: nil>, #<Sensor id: 1, name: "root", parent_id: nil, ip: nil, latitude: nil, longitude: nil, is_deleted: false, applied_at: nil, type: 1, real_parent_id: nil, group_id: nil, binding_id: nil, need_apply: false, created_at: "2019-08-22 11:42:51", updated_at: "2019-09-19 13:39:25", applying: false, property: {"path"=>""}, domain_type: 0, unassigned: false, lft: 1, rgt: 10, depth: 0, children_count: nil, uuid: "4162235707361582818", unclaimed: false, license_id: nil, policy_id: nil, reputation_policy_id: nil, need_reputation_apply: false, zone: nil>]>
Но когда я делаю этот точный запрос в моих рельсах, он не возвращаетпервый объект с 273, но остальное, как два одинаковых запроса могут возвращать разные результаты?
Sensor.all на рельсах:
[{"id":271,"name":"namespace","parent_id":270,"ip":null,"latitude":null,"longitude":null,"is_deleted":false,"applied_at":null,"type":1,"real_parent_id":null,"group_id":null,"binding_id":null,"need_apply":false,"applying":false,"property":{"domain_zones":"","path":"serviceProvider"},"domain_type":8,"unassigned":false,"uuid":"41ed2688-5fcf-474f-8829-26fde5ef9d6b","unclaimed":false,"license_id":null,"policy_id":null,"reputation_policy_id":null,"need_reputation_apply":false,"zone":null,"access_points":[]},{"id":270,"name":"serviceProvider","parent_id":1,"ip":null,"latitude":null,"longitude":null,"is_deleted":false,"applied_at":null,"type":1,"real_parent_id":null,"group_id":null,"binding_id":null,"need_apply":false,"applying":false,"property":{"domain_zones":"","path":""},"domain_type":6,"unassigned":false,"uuid":"9b401f72-52e0-4bd9-b980-d63f237a7d3f","unclaimed":false,"license_id":null,"policy_id":null,"reputation_policy_id":null,"need_reputation_apply":false,"zone":null,"access_points":[]},{"id":272,"name":"org","parent_id":271,"ip":null,"latitude":null,"longitude":null,"is_deleted":false,"applied_at":null,"type":1,"real_parent_id":null,"group_id":null,"binding_id":null,"need_apply":false,"applying":false,"property":{"domain_zones":"","active_modules":"ap_state,flow,ips,location,monitor,social,vault","path":"serviceProvider / namespace"},"domain_type":2,"unassigned":false,"uuid":"dfb4e073-7f47-4fc0-958e-9a9e0585e50e","unclaimed":false,"license_id":null,"policy_id":null,"reputation_policy_id":null,"need_reputation_apply":false,"zone":null,"access_points":[]},{"id":1,"name":"root","parent_id":null,"ip":null,"latitude":null,"longitude":null,"is_deleted":false,"applied_at":null,"type":1,"real_parent_id":null,"group_id":null,"binding_id":null,"need_apply":false,"applying":false,"property":{"path":""},"domain_type":0,"unassigned":false,"uuid":"4162235707361582818","unclaimed":false,"license_id":null,"policy_id":null,"reputation_policy_id":null,"need_reputation_apply":false,"zone":null,"access_points":[]}
Как?Почему?Какая?Это та же база данных, я не знаю, что происходит.Даже формат вывода отличается.