geokit-rails 1.1.4 → 2.0.0.rc1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of geokit-rails might be problematic. Click here for more details.

@@ -1,25 +1,32 @@
1
- require 'active_support'
2
- require 'active_support/test_case'
1
+ require 'pathname'
3
2
 
4
3
  require 'test/unit'
5
- require 'test/unit/testcase'
6
- require 'active_support/testing/setup_and_teardown'
4
+ require 'active_support/test_case'
7
5
 
8
6
  require 'active_record'
7
+ require 'active_record/test_case'
9
8
  require 'active_record/fixtures'
10
9
 
11
10
  require 'action_controller'
12
- require 'action_controller/test_process'
11
+ # require 'action_dispatch'
12
+ # require 'action_dispatch/testing/test_process'
13
+
14
+ pwd = Pathname.new(File.dirname(__FILE__)).expand_path
15
+
16
+ PLUGIN_ROOT = pwd + '..'
17
+ ADAPTER = ENV['DB'] || 'sqlite'
13
18
 
14
- PLUGIN_ROOT = File.join(File.dirname(__FILE__), '..')
15
- ADAPTER = ENV['DB'] || 'mysql'
19
+ $LOAD_PATH << (PLUGIN_ROOT + 'lib')
20
+ $LOAD_PATH << (PLUGIN_ROOT + 'test/models')
16
21
 
17
- $LOAD_PATH << File.join(PLUGIN_ROOT, 'lib') << File.join(PLUGIN_ROOT, 'test', 'models')
22
+ config_file = PLUGIN_ROOT + 'test/database.yml'
23
+ db_config = YAML::load(IO.read(config_file))
24
+ logger_file = PLUGIN_ROOT + "test/#{ADAPTER}-debug.log"
25
+ schema_file = PLUGIN_ROOT + 'test/schema.rb'
18
26
 
19
- FIXTURES_PATH = File.join(PLUGIN_ROOT, 'test', 'fixtures')
20
- ActiveRecord::Base.configurations = config = YAML::load(IO.read(File.join(PLUGIN_ROOT, 'test', 'database.yml')))
21
- ActiveRecord::Base.logger = Logger.new(File.join(PLUGIN_ROOT, 'test', "#{ADAPTER}-debug.log"))
22
- ActiveRecord::Base.establish_connection(config[ADAPTER])
27
+ ActiveRecord::Base.configurations = db_config
28
+ ActiveRecord::Base.logger = Logger.new(logger_file)
29
+ ActiveRecord::Base.establish_connection(db_config[ADAPTER])
23
30
 
24
31
  ActiveRecord::Migration.verbose = false
25
- load File.join(PLUGIN_ROOT, 'test', 'schema.rb')
32
+ load schema_file
@@ -1,20 +1,24 @@
1
- baes: &base
1
+ base: &base
2
2
  host: localhost
3
- username: root
3
+ username: tests
4
4
  password:
5
5
 
6
6
  mysql:
7
7
  adapter: mysql
8
- database: geokit_plugin_test
8
+ database: geokit_rails_tests
9
9
  <<: *base
10
10
 
11
11
  postgresql:
12
12
  adapter: postgresql
13
- database: geokit_plugin_test
13
+ database: geokit_rails_tests
14
14
  <<: *base
15
15
 
16
16
  sqlserver:
17
17
  adapter: sqlserver
18
18
  mode: ODBC
19
- dsn: geokit_tests
20
- username: ruby
19
+ dsn: geokit_rails_tests
20
+ username: tests
21
+
22
+ sqlite:
23
+ adapter: sqlite3
24
+ database: test/test.sqlite3
@@ -1,7 +1,12 @@
1
1
  require 'test_helper'
2
2
 
3
- ActionController::Routing::Routes.draw do |map|
4
- map.connect ':controller/:action/:id'
3
+ module TestApp
4
+ class Application < Rails::Application
5
+ end
6
+ end
7
+
8
+ TestApp::Application.routes.draw do
9
+ match ':controller(/:action(/:id(.:format)))'
5
10
  end
6
11
 
7
12
  class LocationAwareController < ActionController::Base #:nodoc: all
@@ -1,3 +1,5 @@
1
+ require 'models/mock_house'
2
+
1
3
  class MockFamily < ActiveRecord::Base
2
4
  belongs_to :mock_house
3
5
  end
@@ -1,3 +1,5 @@
1
+ require 'models/mock_address'
2
+
1
3
  class MockOrganization < ActiveRecord::Base
2
4
  has_one :mock_address, :as => :addressable
3
5
  acts_as_mappable :through => :mock_address
@@ -1,3 +1,6 @@
1
+ require 'models/mock_family'
2
+ require 'models/mock_house'
3
+
1
4
  class MockPerson < ActiveRecord::Base
2
5
  belongs_to :mock_family
3
6
  acts_as_mappable :through => { :mock_family => :mock_house }
@@ -0,0 +1,1293 @@
1
+ # Logfile created on 2013-06-19 21:13:08 +0930 by logger.rb/31641
2
+  (1.4ms) select sqlite_version(*)
3
+  (45.6ms) CREATE TABLE "companies" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
4
+  (44.1ms) CREATE TABLE "locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "company_id" integer DEFAULT 0 NOT NULL, "street" varchar(60), "city" varchar(60), "state" varchar(2), "postal_code" varchar(16), "lat" decimal(15,10), "lng" decimal(15,10)) 
5
+  (41.5ms) CREATE TABLE "custom_locations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "company_id" integer DEFAULT 0 NOT NULL, "street" varchar(60), "city" varchar(60), "state" varchar(2), "postal_code" varchar(16), "latitude" decimal(15,10), "longitude" decimal(15,10))
6
+  (42.0ms) CREATE TABLE "stores" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar(255), "lat" decimal(15,10), "lng" decimal(15,10)) 
7
+  (39.0ms) CREATE TABLE "mock_organizations" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255))
8
+  (41.9ms) CREATE TABLE "mock_addresses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "addressable_id" integer NOT NULL, "addressable_type" varchar(255) NOT NULL, "street" varchar(60), "city" varchar(60), "state" varchar(2), "postal_code" varchar(16), "lat" decimal(15,10), "lng" decimal(15,10)) 
9
+  (31.2ms) CREATE TABLE "mock_houses" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "address" varchar(255), "lat" decimal(15,10), "lng" decimal(15,10))
10
+  (35.3ms) CREATE TABLE "mock_families" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mock_house_id" integer) 
11
+  (40.4ms) CREATE TABLE "mock_people" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "mock_family_id" integer)
12
+  (39.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
13
+  (38.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
14
+  (0.2ms) SELECT version FROM "schema_migrations"
15
+  (35.9ms) INSERT INTO "schema_migrations" (version) VALUES ('0')
16
+  (0.1ms) begin transaction
17
+ Fixture Delete (0.2ms) DELETE FROM "mock_families"
18
+ Fixture Insert (0.1ms) INSERT INTO "mock_families" ("id", "mock_house_id") VALUES (964944192, 185830233)
19
+ Fixture Delete (0.1ms) DELETE FROM "companies"
20
+ Fixture Insert (0.0ms) INSERT INTO "companies" ("id", "name") VALUES (1, 'Starbucks')
21
+ Fixture Insert (0.0ms) INSERT INTO "companies" ("id", "name") VALUES (2, 'Barnes & Noble')
22
+ Fixture Delete (0.2ms) DELETE FROM "stores"
23
+ Fixture Delete (0.1ms) DELETE FROM "mock_addresses"
24
+ Fixture Insert (0.1ms) INSERT INTO "mock_addresses" ("street", "city", "state", "postal_code", "lat", "lng", "id", "addressable_type", "addressable_id") VALUES ('106 N Denton Tap Rd', 'Coppell', 'TX', 75019, 32.969527, -96.990159, 214970392, 'MockOrganization', 378604642)
25
+ Fixture Insert (0.1ms) INSERT INTO "mock_addresses" ("street", "city", "state", "postal_code", "lat", "lng", "id", "addressable_type", "addressable_id") VALUES ('5904 N Macarthur Blvd', 'Irving', 'TX', 75039, 32.895155, -96.958444, 206296981, 'MockOrganization', 1064917858)
26
+ Fixture Delete (0.1ms) DELETE FROM "mock_people"
27
+ Fixture Insert (0.0ms) INSERT INTO "mock_people" ("id", "mock_family_id") VALUES (254095803, 964944192)
28
+ Fixture Insert (0.0ms) INSERT INTO "mock_people" ("id", "mock_family_id") VALUES (450002714, 964944192)
29
+ Fixture Delete (0.1ms) DELETE FROM "custom_locations"
30
+ Fixture Insert (0.1ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (1, 1, '7979 N MacArthur Blvd', 'Irving', 'TX', 75063, 32.918593, -96.958444)
31
+ Fixture Insert (0.1ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (2, 1, '7750 N Macarthur Blvd', 'Irving', 'TX', 75063, 32.914144, -96.958444)
32
+ Fixture Insert (0.0ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (3, 1, '5904 N Macarthur Blvd', 'Irving', 'TX', 75039, 32.895155, -96.958444)
33
+ Fixture Insert (0.0ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (4, 1, '817 S Macarthur Blvd', 'Coppell', 'TX', 75019, 32.951613, -96.958444)
34
+ Fixture Insert (0.0ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (5, 1, '106 N Denton Tap Rd', 'Coppell', 'TX', 75019, 32.969527, -96.990159)
35
+ Fixture Insert (0.0ms) INSERT INTO "custom_locations" ("id", "company_id", "street", "city", "state", "postal_code", "latitude", "longitude") VALUES (6, 2, '5904 N Macarthur Blvd', 'Irving', 'TX', 75039, 32.895155, -96.958444)
36
+ Fixture Delete (0.2ms) DELETE FROM "mock_houses"
37
+ Fixture Insert (0.0ms) INSERT INTO "mock_houses" ("address", "lat", "lng", "id") VALUES ('106 N Denton Tap Rd', 32.969527, -96.990159, 966034833)
38
+ Fixture Insert (0.0ms) INSERT INTO "mock_houses" ("address", "lat", "lng", "id") VALUES ('5904 N Macarthur Blvd', 32.895155, -96.958444, 185830233)
39
+ Fixture Delete (0.1ms) DELETE FROM "locations"
40
+ Fixture Insert (0.1ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (1, 1, '7979 N MacArthur Blvd', 'Irving', 'TX', 75063, 32.918593, -96.958444)
41
+ Fixture Insert (0.0ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (2, 1, '7750 N Macarthur Blvd', 'Irving', 'TX', 75063, 32.914144, -96.958444)
42
+ Fixture Insert (0.0ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (3, 1, '5904 N Macarthur Blvd', 'Irving', 'TX', 75039, 32.895155, -96.958444)
43
+ Fixture Insert (0.0ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (4, 1, '817 S Macarthur Blvd', 'Coppell', 'TX', 75019, 32.951613, -96.958444)
44
+ Fixture Insert (0.1ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (5, 1, '106 N Denton Tap Rd', 'Coppell', 'TX', 75019, 32.969527, -96.990159)
45
+ Fixture Insert (0.1ms) INSERT INTO "locations" ("id", "company_id", "street", "city", "state", "postal_code", "lat", "lng") VALUES (6, 2, '5904 N Macarthur Blvd', 'Irving', 'TX', 75039, 32.895155, -96.958444)
46
+ Fixture Delete (0.1ms) DELETE FROM "mock_organizations"
47
+ Fixture Insert (0.1ms) INSERT INTO "mock_organizations" ("name", "id") VALUES ('Starbucks', 378604642)
48
+ Fixture Insert (0.0ms) INSERT INTO "mock_organizations" ("name", "id") VALUES ('Barnes & Noble', 1064917858)
49
+  (22.2ms) commit transaction
50
+  (0.1ms) begin transaction
51
+ Company Load (4.6ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
52
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
53
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
54
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
55
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
56
+ MockOrganization Load (0.1ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
57
+ MockAddress Load (0.1ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
58
+ Location Load (0.5ms) SELECT "locations".* FROM "locations" WHERE (
59
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
60
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
61
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
62
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
63
+ END)
64
+ < 5 and city = 'Coppell')
65
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
66
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
67
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
68
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
69
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
70
+ END)
71
+ < 5 and city = 'Coppell')
72
+  (0.0ms) rollback transaction
73
+  (0.0ms) begin transaction
74
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
75
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
76
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
77
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
78
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
79
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
80
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
81
+  (0.0ms) SAVEPOINT active_record_1
82
+ SQL (0.4ms) INSERT INTO "stores" ("address", "lat", "lng") VALUES (?, ?, ?) [["address", "Irving, TX"], ["lat", #<BigDecimal:42346d8,'0.32918593E2',18(45)>], ["lng", #<BigDecimal:42344d0,'-0.96958444E2',18(45)>]]
83
+  (0.0ms) RELEASE SAVEPOINT active_record_1
84
+  (0.1ms) rollback transaction
85
+  (0.0ms) begin transaction
86
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
87
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
88
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
89
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
90
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
91
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
92
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
93
+  (0.1ms) SAVEPOINT active_record_1
94
+  (0.0ms) ROLLBACK TO SAVEPOINT active_record_1
95
+  (0.0ms) rollback transaction
96
+  (0.0ms) begin transaction
97
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
98
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
99
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
100
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
101
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
102
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
103
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
104
+  (0.0ms) rollback transaction
105
+  (0.0ms) begin transaction
106
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
107
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
108
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
109
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
110
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
111
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
112
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
113
+  (0.0ms) rollback transaction
114
+  (0.0ms) begin transaction
115
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
116
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
117
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
118
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
119
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
120
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
121
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
122
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
123
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
124
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
125
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
126
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
127
+ END)
128
+ ASC
129
+  (0.0ms) rollback transaction
130
+  (0.0ms) begin transaction
131
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
132
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
133
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
134
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
135
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
136
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
137
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
138
+  (0.0ms) rollback transaction
139
+  (0.0ms) begin transaction
140
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
141
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
142
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
143
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
144
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
145
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
146
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
147
+  (0.0ms) rollback transaction
148
+  (0.0ms) begin transaction
149
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
150
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
151
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
152
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
153
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
154
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
155
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
156
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((
157
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
158
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
159
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
160
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
161
+ END)
162
+ > 3.95))
163
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((
164
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
165
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
166
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
167
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
168
+ END)
169
+ > 3.95))
170
+  (0.0ms) rollback transaction
171
+  (0.0ms) begin transaction
172
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
173
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
174
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
175
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
176
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
177
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
178
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
179
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((
180
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
181
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
182
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
183
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
184
+ END)
185
+ > 3.95))
186
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((
187
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
188
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
189
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
190
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
191
+ END)
192
+ > 3.95))
193
+  (0.0ms) rollback transaction
194
+  (0.0ms) begin transaction
195
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
196
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
197
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
198
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
199
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
200
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
201
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
202
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE ((
203
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
204
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
205
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
206
+ END)
207
+ > 3.95))
208
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE ((
209
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
210
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
211
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
212
+ END)
213
+ > 3.95))
214
+  (0.0ms) rollback transaction
215
+  (0.0ms) begin transaction
216
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
217
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
218
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
219
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
220
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
221
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
222
+ MockAddress Load (0.1ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
223
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE ((
224
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
225
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
226
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
227
+ END)
228
+ > 3.95))
229
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE ((
230
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
231
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
232
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
233
+ END)
234
+ > 3.95))
235
+  (0.0ms) rollback transaction
236
+  (0.0ms) begin transaction
237
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
238
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
239
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
240
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
241
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
242
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
243
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
244
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((
245
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
246
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
247
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
248
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
249
+ END)
250
+ > 3.95))
251
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((
252
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
253
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
254
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
255
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
256
+ END)
257
+ > 3.95))
258
+  (0.0ms) rollback transaction
259
+  (0.0ms) begin transaction
260
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
261
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
262
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
263
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
264
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
265
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
266
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
267
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
268
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
269
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
270
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
271
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
272
+ END)
273
+ asc
274
+  (0.0ms) rollback transaction
275
+  (0.0ms) begin transaction
276
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
277
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
278
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
279
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
280
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
281
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
282
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
283
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
284
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
285
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
286
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
287
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
288
+ END)
289
+ asc
290
+  (0.0ms) rollback transaction
291
+  (0.0ms) begin transaction
292
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
293
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
294
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
295
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
296
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
297
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
298
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
299
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" ORDER BY
300
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
301
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
302
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
303
+ END)
304
+ asc
305
+  (0.0ms) rollback transaction
306
+  (0.0ms) begin transaction
307
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
308
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
309
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
310
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
311
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
312
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
313
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
314
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" ORDER BY
315
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
316
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
317
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
318
+ END)
319
+ asc
320
+  (0.0ms) rollback transaction
321
+  (0.0ms) begin transaction
322
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
323
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
324
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
325
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
326
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
327
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
328
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
329
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
330
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
331
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
332
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
333
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
334
+ END)
335
+ asc LIMIT 1
336
+  (0.0ms) rollback transaction
337
+  (0.0ms) begin transaction
338
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
339
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
340
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
341
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
342
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
343
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
344
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
345
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
346
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
347
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
348
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
349
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
350
+ END)
351
+ asc LIMIT 1
352
+  (0.0ms) rollback transaction
353
+  (0.0ms) begin transaction
354
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
355
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
356
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
357
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
358
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
359
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
360
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
361
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" ORDER BY
362
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
363
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
364
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
365
+ END)
366
+ asc LIMIT 1
367
+  (0.0ms) rollback transaction
368
+  (0.0ms) begin transaction
369
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
370
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
371
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
372
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
373
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
374
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
375
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
376
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" ORDER BY
377
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
378
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
379
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
380
+ END)
381
+ asc LIMIT 1
382
+  (0.0ms) rollback transaction
383
+  (0.0ms) begin transaction
384
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
385
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
386
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
387
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
388
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
389
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
390
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
391
+ Location Load (0.5ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
392
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
393
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
394
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
395
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
396
+ END)
397
+ >= 0 AND
398
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
399
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
400
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
401
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
402
+ END)
403
+ <= 10))
404
+  (0.5ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
405
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
406
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
407
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
408
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
409
+ END)
410
+ >= 0 AND
411
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
412
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
413
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
414
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
415
+ END)
416
+ <= 10))
417
+  (0.0ms) rollback transaction
418
+  (0.0ms) begin transaction
419
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
420
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
421
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
422
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
423
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
424
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
425
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
426
+ Location Load (0.5ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.788480132431765 AND locations.lat<33.048705867568216 AND locations.lng>-97.11344283584512 AND locations.lng<-96.80344516415488)) AND ((
427
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
428
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
429
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
430
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
431
+ END)
432
+ >= 0 AND
433
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
434
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
435
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
436
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
437
+ END)
438
+ < 10))
439
+  (0.5ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.788480132431765 AND locations.lat<33.048705867568216 AND locations.lng>-97.11344283584512 AND locations.lng<-96.80344516415488)) AND ((
440
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
441
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
442
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
443
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
444
+ END)
445
+ >= 0 AND
446
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
447
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
448
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
449
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
450
+ END)
451
+ < 10))
452
+  (0.0ms) rollback transaction
453
+  (0.0ms) begin transaction
454
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
455
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
456
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
457
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
458
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
459
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
460
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
461
+ Location Load (0.5ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
462
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
463
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
464
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
465
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
466
+ END)
467
+ >= 0 AND
468
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
469
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
470
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
471
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
472
+ END)
473
+ <= 10)) AND (city = 'Coppell')
474
+  (0.5ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
475
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
476
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
477
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
478
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
479
+ END)
480
+ >= 0 AND
481
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
482
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
483
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
484
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
485
+ END)
486
+ <= 10)) AND (city = 'Coppell')
487
+  (0.0ms) rollback transaction
488
+  (0.0ms) begin transaction
489
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
490
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
491
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
492
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
493
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
494
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
495
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
496
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE "locations"."city" = 'Coppell' AND ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
497
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
498
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
499
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
500
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
501
+ END)
502
+ >= 0 AND
503
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
504
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
505
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
506
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
507
+ END)
508
+ <= 10))
509
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE "locations"."city" = 'Coppell' AND ((locations.lat>32.77402314714641 AND locations.lat<33.063162852853594 AND locations.lng>-97.13066489961247 AND locations.lng<-96.78622310038755)) AND ((
510
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
511
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
512
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
513
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
514
+ END)
515
+ >= 0 AND
516
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
517
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
518
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
519
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
520
+ END)
521
+ <= 10))
522
+  (0.0ms) rollback transaction
523
+  (0.0ms) begin transaction
524
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
525
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
526
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
527
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
528
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
529
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
530
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
531
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE (
532
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
533
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
534
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
535
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
536
+ END)
537
+ < 3.97)
538
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
539
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
540
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
541
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
542
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
543
+ END)
544
+ < 3.97)
545
+  (0.0ms) rollback transaction
546
+  (0.0ms) begin transaction
547
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
548
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
549
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
550
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
551
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
552
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
553
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
554
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE (
555
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
556
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
557
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
558
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
559
+ END)
560
+ < 5 and city = 'Coppell')
561
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
562
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
563
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
564
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
565
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
566
+ END)
567
+ < 5 and city = 'Coppell')
568
+  (0.0ms) rollback transaction
569
+  (0.0ms) begin transaction
570
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
571
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
572
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
573
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
574
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
575
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
576
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
577
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE (
578
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
579
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
580
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
581
+ END)
582
+ < 5 and city = 'Coppell')
583
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE (
584
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
585
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
586
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
587
+ END)
588
+ < 5 and city = 'Coppell')
589
+  (0.0ms) rollback transaction
590
+  (0.0ms) begin transaction
591
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
592
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
593
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
594
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
595
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
596
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
597
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
598
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" WHERE (
599
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
600
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
601
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
602
+ END)
603
+ < 3.97)
604
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE (
605
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
606
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
607
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
608
+ END)
609
+ < 3.97)
610
+  (0.0ms) rollback transaction
611
+  (0.0ms) begin transaction
612
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
613
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
614
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
615
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
616
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
617
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
618
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
619
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" WHERE (
620
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
621
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
622
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
623
+ END)
624
+ < 3.97)
625
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE (
626
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
627
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
628
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
629
+ END)
630
+ < 3.97)
631
+  (0.0ms) rollback transaction
632
+  (0.0ms) begin transaction
633
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
634
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
635
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
636
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
637
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
638
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
639
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
640
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
641
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
642
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
643
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
644
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
645
+ END)
646
+ <= 3.97))
647
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
648
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
649
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
650
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
651
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
652
+ END)
653
+ <= 3.97))
654
+  (0.0ms) rollback transaction
655
+  (0.0ms) begin transaction
656
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
657
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
658
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
659
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
660
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
661
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
662
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
663
+ Location Load (0.2ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.8262562349824 AND locations.lat<33.01092976501758 AND locations.lng>-97.06844154650788 AND locations.lng<-96.84844645349213)) AND ((
664
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
665
+ SQRT(POW(69.1*(32.918593-locations.lat),2)+
666
+ POW(48.20039936816744*(-96.958444-locations.lng),2))
667
+ END)
668
+ <= 6.387))
669
+  (0.1ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.8262562349824 AND locations.lat<33.01092976501758 AND locations.lng>-97.06844154650788 AND locations.lng<-96.84844645349213)) AND ((
670
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
671
+ SQRT(POW(69.1*(32.918593-locations.lat),2)+
672
+ POW(48.20039936816744*(-96.958444-locations.lng),2))
673
+ END)
674
+ <= 6.387))
675
+  (0.0ms) rollback transaction
676
+  (0.0ms) begin transaction
677
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
678
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
679
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
680
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
681
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
682
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
683
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
684
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.861205327521695 AND locations.lat<32.9759806724783 AND locations.lng>-97.0268079347438 AND locations.lng<-96.8900800652562)) AND ((
685
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
686
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
687
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
688
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*6376.77271)
689
+ END)
690
+ <= 6.387))
691
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.861205327521695 AND locations.lat<32.9759806724783 AND locations.lng>-97.0268079347438 AND locations.lng<-96.8900800652562)) AND ((
692
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
693
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
694
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
695
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*6376.77271)
696
+ END)
697
+ <= 6.387))
698
+  (0.0ms) rollback transaction
699
+  (0.0ms) begin transaction
700
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
701
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
702
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
703
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
704
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
705
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
706
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
707
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE (
708
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
709
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
710
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
711
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
712
+ END)
713
+ < 5 and city = 'Coppell')
714
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
715
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
716
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
717
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
718
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
719
+ END)
720
+ < 5 and city = 'Coppell')
721
+  (0.0ms) rollback transaction
722
+  (0.0ms) begin transaction
723
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
724
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
725
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
726
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
727
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
728
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
729
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
730
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE (
731
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
732
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
733
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
734
+ END)
735
+ < 5 and city = 'Coppell')
736
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE (
737
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
738
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
739
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
740
+ END)
741
+ < 5 and city = 'Coppell')
742
+  (0.0ms) rollback transaction
743
+  (0.0ms) begin transaction
744
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
745
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
746
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
747
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
748
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
749
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
750
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
751
+ SQL (1.2ms) SELECT "mock_organizations"."id" AS t0_r0, "mock_organizations"."name" AS t0_r1, "mock_addresses"."id" AS t1_r0, "mock_addresses"."addressable_id" AS t1_r1, "mock_addresses"."addressable_type" AS t1_r2, "mock_addresses"."street" AS t1_r3, "mock_addresses"."city" AS t1_r4, "mock_addresses"."state" AS t1_r5, "mock_addresses"."postal_code" AS t1_r6, "mock_addresses"."lat" AS t1_r7, "mock_addresses"."lng" AS t1_r8 FROM "mock_organizations" LEFT OUTER JOIN "mock_addresses" ON "mock_addresses"."addressable_id" = "mock_organizations"."id" AND "mock_addresses"."addressable_type" = 'MockOrganization' ORDER BY
752
+ (CASE WHEN mock_addresses.lat IS NULL OR mock_addresses.lng IS NULL THEN NULL ELSE
753
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(mock_addresses.lat))*COS(RADIANS(mock_addresses.lng))+
754
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(mock_addresses.lat))*SIN(RADIANS(mock_addresses.lng))+
755
+ SIN(0.5745378329739577)*SIN(RADIANS(mock_addresses.lat))))*3963.19)
756
+ END)
757
+ ASC
758
+  (0.3ms) SELECT COUNT(DISTINCT "mock_organizations"."id") FROM "mock_organizations" LEFT OUTER JOIN "mock_addresses" ON "mock_addresses"."addressable_id" = "mock_organizations"."id" AND "mock_addresses"."addressable_type" = 'MockOrganization' WHERE (
759
+ (CASE WHEN mock_addresses.lat IS NULL OR mock_addresses.lng IS NULL THEN NULL ELSE
760
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(mock_addresses.lat))*COS(RADIANS(mock_addresses.lng))+
761
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(mock_addresses.lat))*SIN(RADIANS(mock_addresses.lng))+
762
+ SIN(0.5745378329739577)*SIN(RADIANS(mock_addresses.lat))))*3963.19)
763
+ END)
764
+ < 3.97)
765
+  (0.0ms) rollback transaction
766
+  (0.0ms) begin transaction
767
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
768
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
769
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
770
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
771
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
772
+ MockOrganization Load (0.1ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
773
+ MockAddress Load (0.1ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
774
+  (0.1ms) SELECT COUNT(DISTINCT "mock_people"."id") FROM "mock_people" LEFT OUTER JOIN "mock_families" ON "mock_families"."id" = "mock_people"."mock_family_id" LEFT OUTER JOIN "mock_houses" ON "mock_houses"."id" = "mock_families"."mock_house_id"
775
+  (0.1ms) SELECT COUNT(DISTINCT "mock_people"."id") FROM "mock_people" LEFT OUTER JOIN "mock_families" ON "mock_families"."id" = "mock_people"."mock_family_id" LEFT OUTER JOIN "mock_houses" ON "mock_houses"."id" = "mock_families"."mock_house_id"
776
+  (0.0ms) rollback transaction
777
+  (0.0ms) begin transaction
778
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
779
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
780
+ CustomLocation Load (0.1ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
781
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
782
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
783
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
784
+ MockAddress Load (0.1ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
785
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
786
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
787
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
788
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
789
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
790
+ END)
791
+ <= 3.97))
792
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
793
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
794
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
795
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
796
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
797
+ END)
798
+ <= 3.97))
799
+  (0.0ms) rollback transaction
800
+  (0.0ms) begin transaction
801
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
802
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
803
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
804
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
805
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
806
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
807
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
808
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495))
809
+  (0.1ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495))
810
+  (0.0ms) rollback transaction
811
+  (0.0ms) begin transaction
812
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
813
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
814
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
815
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
816
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
817
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
818
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
819
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495)) ORDER BY
820
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
821
+ (ACOS(least(1,COS(0.5749084012807412)*COS(-1.6921170952541658)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
822
+ COS(0.5749084012807412)*SIN(-1.6921170952541658)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
823
+ SIN(0.5749084012807412)*SIN(RADIANS(locations.lat))))*3963.19)
824
+ END)
825
+ asc
826
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 4]]
827
+  (0.0ms) rollback transaction
828
+  (0.0ms) begin transaction
829
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
830
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
831
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
832
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
833
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
834
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
835
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
836
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495)) AND (id != 1)
837
+  (0.0ms) rollback transaction
838
+  (0.0ms) begin transaction
839
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
840
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
841
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
842
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
843
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
844
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
845
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
846
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = 1 AND ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495))
847
+  (0.0ms) rollback transaction
848
+  (0.0ms) begin transaction
849
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
850
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
851
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
852
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
853
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
854
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
855
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
856
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495)) AND (id !=1)
857
+  (0.0ms) rollback transaction
858
+  (0.0ms) begin transaction
859
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
860
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
861
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
862
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
863
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
864
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
865
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
866
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495))
867
+  (0.1ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.91663 AND locations.lat<32.96302 AND locations.lng>-96.982841 AND locations.lng<-96.919495))
868
+  (0.0ms) rollback transaction
869
+  (0.0ms) begin transaction
870
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
871
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
872
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
873
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
874
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
875
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
876
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
877
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
878
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
879
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
880
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
881
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
882
+ END)
883
+ <= 3.97))
884
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
885
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
886
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
887
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
888
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
889
+ END)
890
+ <= 3.97))
891
+  (0.0ms) rollback transaction
892
+  (0.0ms) begin transaction
893
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
894
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
895
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
896
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
897
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
898
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
899
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
900
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" WHERE ((custom_locations.latitude>32.882922253211376 AND custom_locations.latitude<32.954263746788605 AND custom_locations.longitude>-97.00093732147718 AND custom_locations.longitude<-96.91595067852282)) AND ((
901
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
902
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
903
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
904
+ END)
905
+ <= 3.97))
906
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE ((custom_locations.latitude>32.882922253211376 AND custom_locations.latitude<32.954263746788605 AND custom_locations.longitude>-97.00093732147718 AND custom_locations.longitude<-96.91595067852282)) AND ((
907
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
908
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
909
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
910
+ END)
911
+ <= 3.97))
912
+  (0.0ms) rollback transaction
913
+  (0.0ms) begin transaction
914
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
915
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
916
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
917
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
918
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
919
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
920
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
921
+ CustomLocation Load (0.2ms) SELECT "custom_locations".* FROM "custom_locations" WHERE ((custom_locations.latitude>32.882922253211376 AND custom_locations.latitude<32.954263746788605 AND custom_locations.longitude>-97.00093732147718 AND custom_locations.longitude<-96.91595067852282)) AND ((
922
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
923
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
924
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
925
+ END)
926
+ <= 3.97))
927
+  (0.1ms) SELECT COUNT(*) FROM "custom_locations" WHERE ((custom_locations.latitude>32.882922253211376 AND custom_locations.latitude<32.954263746788605 AND custom_locations.longitude>-97.00093732147718 AND custom_locations.longitude<-96.91595067852282)) AND ((
928
+ (CASE WHEN custom_locations.latitude IS NULL OR custom_locations.longitude IS NULL THEN NULL ELSE
929
+ SQRT(POW(111.18189999999998*(32.918593-custom_locations.latitude),2)+
930
+ POW(77.5544425833814*(-96.958444-custom_locations.longitude),2))
931
+ END)
932
+ <= 3.97))
933
+  (0.0ms) rollback transaction
934
+  (0.0ms) begin transaction
935
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
936
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
937
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
938
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
939
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
940
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
941
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
942
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" WHERE (company_id = 1)
943
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" IN (1)
944
+  (0.0ms) rollback transaction
945
+  (0.0ms) begin transaction
946
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
947
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
948
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
949
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
950
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
951
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
952
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
953
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" ORDER BY
954
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
955
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
956
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
957
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
958
+ END)
959
+ ASC
960
+  (0.0ms) rollback transaction
961
+  (0.0ms) begin transaction
962
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
963
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
964
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
965
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
966
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
967
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
968
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
969
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE ((
970
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
971
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
972
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
973
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
974
+ END)
975
+ > 3.95))
976
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((
977
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
978
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
979
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
980
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
981
+ END)
982
+ > 3.95))
983
+  (0.0ms) rollback transaction
984
+  (0.0ms) begin transaction
985
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
986
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
987
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
988
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
989
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
990
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
991
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
992
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" ORDER BY
993
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
994
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
995
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
996
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
997
+ END)
998
+ asc
999
+  (0.0ms) rollback transaction
1000
+  (0.0ms) begin transaction
1001
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1002
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1003
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1004
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1005
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1006
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1007
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1008
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" ORDER BY
1009
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1010
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1011
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1012
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1013
+ END)
1014
+ asc LIMIT 1
1015
+  (0.0ms) rollback transaction
1016
+  (0.0ms) begin transaction
1017
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1018
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1019
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1020
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1021
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1022
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1023
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1024
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE (
1025
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1026
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1027
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1028
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1029
+ END)
1030
+ < 5 and city = 'Coppell')
1031
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
1032
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1033
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1034
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1035
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1036
+ END)
1037
+ < 5 and city = 'Coppell')
1038
+  (0.0ms) rollback transaction
1039
+  (0.0ms) begin transaction
1040
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1041
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1042
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1043
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1044
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1045
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1046
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1047
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE (
1048
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1049
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1050
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1051
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1052
+ END)
1053
+ < 3.97)
1054
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
1055
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1056
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1057
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1058
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1059
+ END)
1060
+ < 3.97)
1061
+  (0.0ms) rollback transaction
1062
+  (0.0ms) begin transaction
1063
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1064
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1065
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1066
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1067
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1068
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1069
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1070
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE (
1071
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1072
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1073
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1074
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1075
+ END)
1076
+ < 5 and city = 'Coppell')
1077
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
1078
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1079
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1080
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1081
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1082
+ END)
1083
+ < 5 and city = 'Coppell')
1084
+  (0.0ms) rollback transaction
1085
+  (0.0ms) begin transaction
1086
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1087
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1088
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1089
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1090
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1091
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1092
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1093
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
1094
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1095
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1096
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1097
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1098
+ END)
1099
+ <= 3.97))
1100
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
1101
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1102
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1103
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1104
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1105
+ END)
1106
+ <= 3.97))
1107
+  (0.0ms) rollback transaction
1108
+  (0.0ms) begin transaction
1109
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1110
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1111
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1112
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1113
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1114
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1115
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1116
+  (0.0ms) rollback transaction
1117
+  (0.0ms) begin transaction
1118
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1119
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1120
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1121
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1122
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1123
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1124
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1125
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE (
1126
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1127
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1128
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1129
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*6376.77271)
1130
+ END)
1131
+ < 3.97)
1132
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE (
1133
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1134
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1135
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1136
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*6376.77271)
1137
+ END)
1138
+ < 3.97)
1139
+  (0.0ms) rollback transaction
1140
+  (0.0ms) begin transaction
1141
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1142
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1143
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1144
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1145
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1146
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1147
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1148
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 ORDER BY
1149
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1150
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1151
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1152
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1153
+ END)
1154
+ ASC
1155
+  (0.0ms) rollback transaction
1156
+  (0.0ms) begin transaction
1157
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1158
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1159
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1160
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1161
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1162
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1163
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1164
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 AND ((
1165
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1166
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1167
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1168
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1169
+ END)
1170
+ > 3.95))
1171
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE "locations"."company_id" = 1 AND ((
1172
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1173
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1174
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1175
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1176
+ END)
1177
+ > 3.95))
1178
+  (0.0ms) rollback transaction
1179
+  (0.0ms) begin transaction
1180
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1181
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1182
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1183
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1184
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1185
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1186
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1187
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 ORDER BY
1188
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1189
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1190
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1191
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1192
+ END)
1193
+ asc
1194
+  (0.0ms) rollback transaction
1195
+  (0.0ms) begin transaction
1196
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1197
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1198
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1199
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1200
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1201
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1202
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1203
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 ORDER BY
1204
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1205
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1206
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1207
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1208
+ END)
1209
+ asc LIMIT 1
1210
+  (0.0ms) rollback transaction
1211
+  (0.0ms) begin transaction
1212
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1213
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1214
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1215
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1216
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1217
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1218
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1219
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 AND (
1220
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1221
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1222
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1223
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1224
+ END)
1225
+ < 5 and city = 'Coppell')
1226
+  (0.2ms) SELECT COUNT(*) FROM "locations" WHERE "locations"."company_id" = 1 AND (
1227
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1228
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1229
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1230
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1231
+ END)
1232
+ < 5 and city = 'Coppell')
1233
+  (0.0ms) rollback transaction
1234
+  (0.0ms) begin transaction
1235
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1236
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1237
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1238
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1239
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1240
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1241
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1242
+ Location Load (0.3ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 AND (
1243
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1244
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1245
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1246
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1247
+ END)
1248
+ < 3.97)
1249
+  (0.2ms) SELECT COUNT(*) FROM "locations" WHERE "locations"."company_id" = 1 AND (
1250
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1251
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1252
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1253
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1254
+ END)
1255
+ < 3.97)
1256
+  (0.0ms) rollback transaction
1257
+  (0.0ms) begin transaction
1258
+ Company Load (0.0ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1259
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1260
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1261
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1262
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1263
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1264
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1265
+ Location Load (0.4ms) SELECT "locations".* FROM "locations" WHERE "locations"."company_id" = 1 AND ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
1266
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1267
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1268
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1269
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1270
+ END)
1271
+ <= 3.97))
1272
+  (0.3ms) SELECT COUNT(*) FROM "locations" WHERE "locations"."company_id" = 1 AND ((locations.lat>32.86119876841712 AND locations.lat<32.97598723158287 AND locations.lng>-97.02681574837437 AND locations.lng<-96.89007225162564)) AND ((
1273
+ (CASE WHEN locations.lat IS NULL OR locations.lng IS NULL THEN NULL ELSE
1274
+ (ACOS(least(1,COS(0.5745378329739577)*COS(-1.692244085410541)*COS(RADIANS(locations.lat))*COS(RADIANS(locations.lng))+
1275
+ COS(0.5745378329739577)*SIN(-1.692244085410541)*COS(RADIANS(locations.lat))*SIN(RADIANS(locations.lng))+
1276
+ SIN(0.5745378329739577)*SIN(RADIANS(locations.lat))))*3963.19)
1277
+ END)
1278
+ <= 3.97))
1279
+  (0.0ms) rollback transaction
1280
+  (0.0ms) begin transaction
1281
+ Company Load (0.1ms) SELECT "companies".* FROM "companies" WHERE "companies"."id" = ? LIMIT 1 [["id", 1]]
1282
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 1]]
1283
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 1]]
1284
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 5]]
1285
+ CustomLocation Load (0.0ms) SELECT "custom_locations".* FROM "custom_locations" WHERE "custom_locations"."id" = ? LIMIT 1 [["id", 5]]
1286
+ MockOrganization Load (0.0ms) SELECT "mock_organizations".* FROM "mock_organizations" WHERE "mock_organizations"."id" = ? LIMIT 1 [["id", 1064917858]]
1287
+ MockAddress Load (0.0ms) SELECT "mock_addresses".* FROM "mock_addresses" WHERE "mock_addresses"."id" = ? LIMIT 1 [["id", 206296981]]
1288
+ Location Load (0.1ms) SELECT "locations".* FROM "locations" 
1289
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 2]]
1290
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 3]]
1291
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 4]]
1292
+ Location Load (0.0ms) SELECT "locations".* FROM "locations" WHERE "locations"."id" = ? LIMIT 1 [["id", 6]]
1293
+  (0.0ms) rollback transaction