lookup_by 0.10.8 → 0.10.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/lookup_by/association.rb +9 -4
- data/lib/lookup_by/version.rb +1 -1
- data/spec/association_spec.rb +7 -1
- data/spec/dummy/db/structure.sql +150 -81
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 355a248ab95bea93cf3a8699d345152225be7c4f
|
4
|
+
data.tar.gz: ce156dc5c175049034b04de0e4cee2ba4a080aea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30288404d1e8b43cb885caaeb83a71ac6cb8d557fecce56cb54ee76cc5c2e9372cc1a525384032d411bf61b1c75b228cd1f1cd41cb11f6c3c7d8422be3378cdc
|
7
|
+
data.tar.gz: 7186d2cfa8894e8f20ebd299eaf3f558f52efb5590b161859160fd8601e6f8381abfb3521f8cb39bc7c3243afed8f65922bcc1d06c0b5c3a12afebed2da9cbea
|
@@ -67,10 +67,18 @@ module LookupBy
|
|
67
67
|
class_name = options[:class_name] || field
|
68
68
|
class_name = class_name.to_s.camelize
|
69
69
|
|
70
|
+
begin
|
71
|
+
klass = class_name.constantize
|
72
|
+
rescue NameError
|
73
|
+
raise Error, "uninitialized constant #{class_name}, call lookup_for with `class_name` option if it doesn't match the foreign key"
|
74
|
+
end
|
75
|
+
|
76
|
+
raise Error, "class #{class_name} does not use lookup_by" unless klass.respond_to?(:lookup)
|
77
|
+
|
70
78
|
foreign_key = options[:foreign_key] || "#{field}_id"
|
71
79
|
foreign_key = foreign_key.to_sym
|
72
80
|
|
73
|
-
|
81
|
+
Rails.logger.error "foreign key `#{foreign_key}` is required on #{self}" unless attribute_names.include?(foreign_key.to_s)
|
74
82
|
|
75
83
|
strict = options[:strict]
|
76
84
|
strict = true if strict.nil?
|
@@ -91,9 +99,6 @@ module LookupBy
|
|
91
99
|
|
92
100
|
cast = options[:symbolize] ? ".to_sym" : ""
|
93
101
|
|
94
|
-
klass = class_name.constantize
|
95
|
-
raise Error, "class #{class_name} does not use lookup_by" unless klass.respond_to?(:lookup)
|
96
|
-
|
97
102
|
lookup_field = klass.lookup.field
|
98
103
|
lookup_object = "#{class_name}[#{foreign_key}]"
|
99
104
|
|
data/lib/lookup_by/version.rb
CHANGED
data/spec/association_spec.rb
CHANGED
@@ -34,7 +34,13 @@ describe ::ActiveRecord::Base do
|
|
34
34
|
end
|
35
35
|
|
36
36
|
it "requires a foreign key" do
|
37
|
-
expect
|
37
|
+
expect(Rails.logger).to receive(:error)
|
38
|
+
|
39
|
+
subject.lookup_for :missing, class_name: 'city'
|
40
|
+
end
|
41
|
+
|
42
|
+
it 'requires a class' do
|
43
|
+
expect { subject.lookup_for :uninitialized }.to raise_error LookupBy::Error, /uninitialized constant/
|
38
44
|
end
|
39
45
|
|
40
46
|
it "rejects unsaved lookup values" do
|
data/spec/dummy/db/structure.sql
CHANGED
@@ -2,12 +2,17 @@
|
|
2
2
|
-- PostgreSQL database dump
|
3
3
|
--
|
4
4
|
|
5
|
+
-- Dumped from database version 9.6.1
|
6
|
+
-- Dumped by pg_dump version 9.6.1
|
7
|
+
|
5
8
|
SET statement_timeout = 0;
|
6
9
|
SET lock_timeout = 0;
|
10
|
+
SET idle_in_transaction_session_timeout = 0;
|
7
11
|
SET client_encoding = 'UTF8';
|
8
12
|
SET standard_conforming_strings = on;
|
9
13
|
SET check_function_bodies = false;
|
10
14
|
SET client_min_messages = warning;
|
15
|
+
SET row_security = off;
|
11
16
|
|
12
17
|
--
|
13
18
|
-- Name: traffic; Type: SCHEMA; Schema: -; Owner: -
|
@@ -51,7 +56,7 @@ SET default_tablespace = '';
|
|
51
56
|
SET default_with_oids = false;
|
52
57
|
|
53
58
|
--
|
54
|
-
-- Name: accounts; Type: TABLE; Schema: public; Owner:
|
59
|
+
-- Name: accounts; Type: TABLE; Schema: public; Owner: -
|
55
60
|
--
|
56
61
|
|
57
62
|
CREATE TABLE accounts (
|
@@ -81,7 +86,7 @@ ALTER SEQUENCE accounts_account_id_seq OWNED BY accounts.account_id;
|
|
81
86
|
|
82
87
|
|
83
88
|
--
|
84
|
-
-- Name: addresses; Type: TABLE; Schema: public; Owner:
|
89
|
+
-- Name: addresses; Type: TABLE; Schema: public; Owner: -
|
85
90
|
--
|
86
91
|
|
87
92
|
CREATE TABLE addresses (
|
@@ -115,7 +120,19 @@ ALTER SEQUENCE addresses_address_id_seq OWNED BY addresses.address_id;
|
|
115
120
|
|
116
121
|
|
117
122
|
--
|
118
|
-
-- Name:
|
123
|
+
-- Name: ar_internal_metadata; Type: TABLE; Schema: public; Owner: -
|
124
|
+
--
|
125
|
+
|
126
|
+
CREATE TABLE ar_internal_metadata (
|
127
|
+
key character varying NOT NULL,
|
128
|
+
value character varying,
|
129
|
+
created_at timestamp without time zone NOT NULL,
|
130
|
+
updated_at timestamp without time zone NOT NULL
|
131
|
+
);
|
132
|
+
|
133
|
+
|
134
|
+
--
|
135
|
+
-- Name: cities; Type: TABLE; Schema: public; Owner: -
|
119
136
|
--
|
120
137
|
|
121
138
|
CREATE TABLE cities (
|
@@ -144,7 +161,7 @@ ALTER SEQUENCE cities_city_id_seq OWNED BY cities.city_id;
|
|
144
161
|
|
145
162
|
|
146
163
|
--
|
147
|
-
-- Name: countries; Type: TABLE; Schema: public; Owner:
|
164
|
+
-- Name: countries; Type: TABLE; Schema: public; Owner: -
|
148
165
|
--
|
149
166
|
|
150
167
|
CREATE TABLE countries (
|
@@ -173,7 +190,7 @@ ALTER SEQUENCE countries_country_id_seq OWNED BY countries.country_id;
|
|
173
190
|
|
174
191
|
|
175
192
|
--
|
176
|
-
-- Name: email_addresses; Type: TABLE; Schema: public; Owner:
|
193
|
+
-- Name: email_addresses; Type: TABLE; Schema: public; Owner: -
|
177
194
|
--
|
178
195
|
|
179
196
|
CREATE TABLE email_addresses (
|
@@ -202,7 +219,7 @@ ALTER SEQUENCE email_addresses_email_address_id_seq OWNED BY email_addresses.ema
|
|
202
219
|
|
203
220
|
|
204
221
|
--
|
205
|
-
-- Name: ip_addresses; Type: TABLE; Schema: public; Owner:
|
222
|
+
-- Name: ip_addresses; Type: TABLE; Schema: public; Owner: -
|
206
223
|
--
|
207
224
|
|
208
225
|
CREATE TABLE ip_addresses (
|
@@ -231,7 +248,7 @@ ALTER SEQUENCE ip_addresses_ip_address_id_seq OWNED BY ip_addresses.ip_address_i
|
|
231
248
|
|
232
249
|
|
233
250
|
--
|
234
|
-
-- Name: phone_numbers; Type: TABLE; Schema: public; Owner:
|
251
|
+
-- Name: phone_numbers; Type: TABLE; Schema: public; Owner: -
|
235
252
|
--
|
236
253
|
|
237
254
|
CREATE TABLE phone_numbers (
|
@@ -260,7 +277,7 @@ ALTER SEQUENCE phone_numbers_phone_number_id_seq OWNED BY phone_numbers.phone_nu
|
|
260
277
|
|
261
278
|
|
262
279
|
--
|
263
|
-
-- Name: postal_codes; Type: TABLE; Schema: public; Owner:
|
280
|
+
-- Name: postal_codes; Type: TABLE; Schema: public; Owner: -
|
264
281
|
--
|
265
282
|
|
266
283
|
CREATE TABLE postal_codes (
|
@@ -289,7 +306,7 @@ ALTER SEQUENCE postal_codes_postal_code_id_seq OWNED BY postal_codes.postal_code
|
|
289
306
|
|
290
307
|
|
291
308
|
--
|
292
|
-
-- Name: raisins; Type: TABLE; Schema: public; Owner:
|
309
|
+
-- Name: raisins; Type: TABLE; Schema: public; Owner: -
|
293
310
|
--
|
294
311
|
|
295
312
|
CREATE TABLE raisins (
|
@@ -318,7 +335,7 @@ ALTER SEQUENCE raisins_raisin_id_seq OWNED BY raisins.raisin_id;
|
|
318
335
|
|
319
336
|
|
320
337
|
--
|
321
|
-
-- Name: read_through_raisins; Type: TABLE; Schema: public; Owner:
|
338
|
+
-- Name: read_through_raisins; Type: TABLE; Schema: public; Owner: -
|
322
339
|
--
|
323
340
|
|
324
341
|
CREATE TABLE read_through_raisins (
|
@@ -347,16 +364,16 @@ ALTER SEQUENCE read_through_raisins_read_through_raisin_id_seq OWNED BY read_thr
|
|
347
364
|
|
348
365
|
|
349
366
|
--
|
350
|
-
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner:
|
367
|
+
-- Name: schema_migrations; Type: TABLE; Schema: public; Owner: -
|
351
368
|
--
|
352
369
|
|
353
370
|
CREATE TABLE schema_migrations (
|
354
|
-
version character varying
|
371
|
+
version character varying NOT NULL
|
355
372
|
);
|
356
373
|
|
357
374
|
|
358
375
|
--
|
359
|
-
-- Name: states; Type: TABLE; Schema: public; Owner:
|
376
|
+
-- Name: states; Type: TABLE; Schema: public; Owner: -
|
360
377
|
--
|
361
378
|
|
362
379
|
CREATE TABLE states (
|
@@ -385,7 +402,7 @@ ALTER SEQUENCE states_state_id_seq OWNED BY states.state_id;
|
|
385
402
|
|
386
403
|
|
387
404
|
--
|
388
|
-
-- Name: statuses; Type: TABLE; Schema: public; Owner:
|
405
|
+
-- Name: statuses; Type: TABLE; Schema: public; Owner: -
|
389
406
|
--
|
390
407
|
|
391
408
|
CREATE TABLE statuses (
|
@@ -414,7 +431,7 @@ ALTER SEQUENCE statuses_status_id_seq OWNED BY statuses.status_id;
|
|
414
431
|
|
415
432
|
|
416
433
|
--
|
417
|
-
-- Name: streets; Type: TABLE; Schema: public; Owner:
|
434
|
+
-- Name: streets; Type: TABLE; Schema: public; Owner: -
|
418
435
|
--
|
419
436
|
|
420
437
|
CREATE TABLE streets (
|
@@ -443,7 +460,7 @@ ALTER SEQUENCE streets_street_id_seq OWNED BY streets.street_id;
|
|
443
460
|
|
444
461
|
|
445
462
|
--
|
446
|
-
-- Name: uncacheables; Type: TABLE; Schema: public; Owner:
|
463
|
+
-- Name: uncacheables; Type: TABLE; Schema: public; Owner: -
|
447
464
|
--
|
448
465
|
|
449
466
|
CREATE TABLE uncacheables (
|
@@ -472,7 +489,7 @@ ALTER SEQUENCE uncacheables_uncacheable_id_seq OWNED BY uncacheables.uncacheable
|
|
472
489
|
|
473
490
|
|
474
491
|
--
|
475
|
-
-- Name: unfindables; Type: TABLE; Schema: public; Owner:
|
492
|
+
-- Name: unfindables; Type: TABLE; Schema: public; Owner: -
|
476
493
|
--
|
477
494
|
|
478
495
|
CREATE TABLE unfindables (
|
@@ -501,7 +518,7 @@ ALTER SEQUENCE unfindables_unfindable_id_seq OWNED BY unfindables.unfindable_id;
|
|
501
518
|
|
502
519
|
|
503
520
|
--
|
504
|
-
-- Name: unsynchronizables; Type: TABLE; Schema: public; Owner:
|
521
|
+
-- Name: unsynchronizables; Type: TABLE; Schema: public; Owner: -
|
505
522
|
--
|
506
523
|
|
507
524
|
CREATE TABLE unsynchronizables (
|
@@ -530,7 +547,7 @@ ALTER SEQUENCE unsynchronizables_unsynchronizable_id_seq OWNED BY unsynchronizab
|
|
530
547
|
|
531
548
|
|
532
549
|
--
|
533
|
-
-- Name: user_agents; Type: TABLE; Schema: public; Owner:
|
550
|
+
-- Name: user_agents; Type: TABLE; Schema: public; Owner: -
|
534
551
|
--
|
535
552
|
|
536
553
|
CREATE TABLE user_agents (
|
@@ -561,7 +578,7 @@ ALTER SEQUENCE user_agents_user_agent_id_seq OWNED BY user_agents.user_agent_id;
|
|
561
578
|
SET search_path = traffic, pg_catalog;
|
562
579
|
|
563
580
|
--
|
564
|
-
-- Name: paths; Type: TABLE; Schema: traffic; Owner:
|
581
|
+
-- Name: paths; Type: TABLE; Schema: traffic; Owner: -
|
565
582
|
--
|
566
583
|
|
567
584
|
CREATE TABLE paths (
|
@@ -573,126 +590,126 @@ CREATE TABLE paths (
|
|
573
590
|
SET search_path = public, pg_catalog;
|
574
591
|
|
575
592
|
--
|
576
|
-
-- Name: account_id; Type: DEFAULT; Schema: public; Owner: -
|
593
|
+
-- Name: accounts account_id; Type: DEFAULT; Schema: public; Owner: -
|
577
594
|
--
|
578
595
|
|
579
596
|
ALTER TABLE ONLY accounts ALTER COLUMN account_id SET DEFAULT nextval('accounts_account_id_seq'::regclass);
|
580
597
|
|
581
598
|
|
582
599
|
--
|
583
|
-
-- Name: address_id; Type: DEFAULT; Schema: public; Owner: -
|
600
|
+
-- Name: addresses address_id; Type: DEFAULT; Schema: public; Owner: -
|
584
601
|
--
|
585
602
|
|
586
603
|
ALTER TABLE ONLY addresses ALTER COLUMN address_id SET DEFAULT nextval('addresses_address_id_seq'::regclass);
|
587
604
|
|
588
605
|
|
589
606
|
--
|
590
|
-
-- Name: city_id; Type: DEFAULT; Schema: public; Owner: -
|
607
|
+
-- Name: cities city_id; Type: DEFAULT; Schema: public; Owner: -
|
591
608
|
--
|
592
609
|
|
593
610
|
ALTER TABLE ONLY cities ALTER COLUMN city_id SET DEFAULT nextval('cities_city_id_seq'::regclass);
|
594
611
|
|
595
612
|
|
596
613
|
--
|
597
|
-
-- Name: country_id; Type: DEFAULT; Schema: public; Owner: -
|
614
|
+
-- Name: countries country_id; Type: DEFAULT; Schema: public; Owner: -
|
598
615
|
--
|
599
616
|
|
600
617
|
ALTER TABLE ONLY countries ALTER COLUMN country_id SET DEFAULT nextval('countries_country_id_seq'::regclass);
|
601
618
|
|
602
619
|
|
603
620
|
--
|
604
|
-
-- Name: email_address_id; Type: DEFAULT; Schema: public; Owner: -
|
621
|
+
-- Name: email_addresses email_address_id; Type: DEFAULT; Schema: public; Owner: -
|
605
622
|
--
|
606
623
|
|
607
624
|
ALTER TABLE ONLY email_addresses ALTER COLUMN email_address_id SET DEFAULT nextval('email_addresses_email_address_id_seq'::regclass);
|
608
625
|
|
609
626
|
|
610
627
|
--
|
611
|
-
-- Name: ip_address_id; Type: DEFAULT; Schema: public; Owner: -
|
628
|
+
-- Name: ip_addresses ip_address_id; Type: DEFAULT; Schema: public; Owner: -
|
612
629
|
--
|
613
630
|
|
614
631
|
ALTER TABLE ONLY ip_addresses ALTER COLUMN ip_address_id SET DEFAULT nextval('ip_addresses_ip_address_id_seq'::regclass);
|
615
632
|
|
616
633
|
|
617
634
|
--
|
618
|
-
-- Name: phone_number_id; Type: DEFAULT; Schema: public; Owner: -
|
635
|
+
-- Name: phone_numbers phone_number_id; Type: DEFAULT; Schema: public; Owner: -
|
619
636
|
--
|
620
637
|
|
621
638
|
ALTER TABLE ONLY phone_numbers ALTER COLUMN phone_number_id SET DEFAULT nextval('phone_numbers_phone_number_id_seq'::regclass);
|
622
639
|
|
623
640
|
|
624
641
|
--
|
625
|
-
-- Name: postal_code_id; Type: DEFAULT; Schema: public; Owner: -
|
642
|
+
-- Name: postal_codes postal_code_id; Type: DEFAULT; Schema: public; Owner: -
|
626
643
|
--
|
627
644
|
|
628
645
|
ALTER TABLE ONLY postal_codes ALTER COLUMN postal_code_id SET DEFAULT nextval('postal_codes_postal_code_id_seq'::regclass);
|
629
646
|
|
630
647
|
|
631
648
|
--
|
632
|
-
-- Name: raisin_id; Type: DEFAULT; Schema: public; Owner: -
|
649
|
+
-- Name: raisins raisin_id; Type: DEFAULT; Schema: public; Owner: -
|
633
650
|
--
|
634
651
|
|
635
652
|
ALTER TABLE ONLY raisins ALTER COLUMN raisin_id SET DEFAULT nextval('raisins_raisin_id_seq'::regclass);
|
636
653
|
|
637
654
|
|
638
655
|
--
|
639
|
-
-- Name: read_through_raisin_id; Type: DEFAULT; Schema: public; Owner: -
|
656
|
+
-- Name: read_through_raisins read_through_raisin_id; Type: DEFAULT; Schema: public; Owner: -
|
640
657
|
--
|
641
658
|
|
642
659
|
ALTER TABLE ONLY read_through_raisins ALTER COLUMN read_through_raisin_id SET DEFAULT nextval('read_through_raisins_read_through_raisin_id_seq'::regclass);
|
643
660
|
|
644
661
|
|
645
662
|
--
|
646
|
-
-- Name: state_id; Type: DEFAULT; Schema: public; Owner: -
|
663
|
+
-- Name: states state_id; Type: DEFAULT; Schema: public; Owner: -
|
647
664
|
--
|
648
665
|
|
649
666
|
ALTER TABLE ONLY states ALTER COLUMN state_id SET DEFAULT nextval('states_state_id_seq'::regclass);
|
650
667
|
|
651
668
|
|
652
669
|
--
|
653
|
-
-- Name: status_id; Type: DEFAULT; Schema: public; Owner: -
|
670
|
+
-- Name: statuses status_id; Type: DEFAULT; Schema: public; Owner: -
|
654
671
|
--
|
655
672
|
|
656
673
|
ALTER TABLE ONLY statuses ALTER COLUMN status_id SET DEFAULT nextval('statuses_status_id_seq'::regclass);
|
657
674
|
|
658
675
|
|
659
676
|
--
|
660
|
-
-- Name: street_id; Type: DEFAULT; Schema: public; Owner: -
|
677
|
+
-- Name: streets street_id; Type: DEFAULT; Schema: public; Owner: -
|
661
678
|
--
|
662
679
|
|
663
680
|
ALTER TABLE ONLY streets ALTER COLUMN street_id SET DEFAULT nextval('streets_street_id_seq'::regclass);
|
664
681
|
|
665
682
|
|
666
683
|
--
|
667
|
-
-- Name: uncacheable_id; Type: DEFAULT; Schema: public; Owner: -
|
684
|
+
-- Name: uncacheables uncacheable_id; Type: DEFAULT; Schema: public; Owner: -
|
668
685
|
--
|
669
686
|
|
670
687
|
ALTER TABLE ONLY uncacheables ALTER COLUMN uncacheable_id SET DEFAULT nextval('uncacheables_uncacheable_id_seq'::regclass);
|
671
688
|
|
672
689
|
|
673
690
|
--
|
674
|
-
-- Name: unfindable_id; Type: DEFAULT; Schema: public; Owner: -
|
691
|
+
-- Name: unfindables unfindable_id; Type: DEFAULT; Schema: public; Owner: -
|
675
692
|
--
|
676
693
|
|
677
694
|
ALTER TABLE ONLY unfindables ALTER COLUMN unfindable_id SET DEFAULT nextval('unfindables_unfindable_id_seq'::regclass);
|
678
695
|
|
679
696
|
|
680
697
|
--
|
681
|
-
-- Name: unsynchronizable_id; Type: DEFAULT; Schema: public; Owner: -
|
698
|
+
-- Name: unsynchronizables unsynchronizable_id; Type: DEFAULT; Schema: public; Owner: -
|
682
699
|
--
|
683
700
|
|
684
701
|
ALTER TABLE ONLY unsynchronizables ALTER COLUMN unsynchronizable_id SET DEFAULT nextval('unsynchronizables_unsynchronizable_id_seq'::regclass);
|
685
702
|
|
686
703
|
|
687
704
|
--
|
688
|
-
-- Name: user_agent_id; Type: DEFAULT; Schema: public; Owner: -
|
705
|
+
-- Name: user_agents user_agent_id; Type: DEFAULT; Schema: public; Owner: -
|
689
706
|
--
|
690
707
|
|
691
708
|
ALTER TABLE ONLY user_agents ALTER COLUMN user_agent_id SET DEFAULT nextval('user_agents_user_agent_id_seq'::regclass);
|
692
709
|
|
693
710
|
|
694
711
|
--
|
695
|
-
-- Name: accounts_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
712
|
+
-- Name: accounts accounts_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
696
713
|
--
|
697
714
|
|
698
715
|
ALTER TABLE ONLY accounts
|
@@ -700,7 +717,7 @@ ALTER TABLE ONLY accounts
|
|
700
717
|
|
701
718
|
|
702
719
|
--
|
703
|
-
-- Name: addresses_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
720
|
+
-- Name: addresses addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
704
721
|
--
|
705
722
|
|
706
723
|
ALTER TABLE ONLY addresses
|
@@ -708,7 +725,15 @@ ALTER TABLE ONLY addresses
|
|
708
725
|
|
709
726
|
|
710
727
|
--
|
711
|
-
-- Name:
|
728
|
+
-- Name: ar_internal_metadata ar_internal_metadata_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
729
|
+
--
|
730
|
+
|
731
|
+
ALTER TABLE ONLY ar_internal_metadata
|
732
|
+
ADD CONSTRAINT ar_internal_metadata_pkey PRIMARY KEY (key);
|
733
|
+
|
734
|
+
|
735
|
+
--
|
736
|
+
-- Name: cities cities_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
712
737
|
--
|
713
738
|
|
714
739
|
ALTER TABLE ONLY cities
|
@@ -716,7 +741,7 @@ ALTER TABLE ONLY cities
|
|
716
741
|
|
717
742
|
|
718
743
|
--
|
719
|
-
-- Name: countries_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
744
|
+
-- Name: countries countries_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
720
745
|
--
|
721
746
|
|
722
747
|
ALTER TABLE ONLY countries
|
@@ -724,7 +749,7 @@ ALTER TABLE ONLY countries
|
|
724
749
|
|
725
750
|
|
726
751
|
--
|
727
|
-
-- Name: email_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
752
|
+
-- Name: email_addresses email_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
728
753
|
--
|
729
754
|
|
730
755
|
ALTER TABLE ONLY email_addresses
|
@@ -732,7 +757,7 @@ ALTER TABLE ONLY email_addresses
|
|
732
757
|
|
733
758
|
|
734
759
|
--
|
735
|
-
-- Name: ip_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
760
|
+
-- Name: ip_addresses ip_addresses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
736
761
|
--
|
737
762
|
|
738
763
|
ALTER TABLE ONLY ip_addresses
|
@@ -740,7 +765,7 @@ ALTER TABLE ONLY ip_addresses
|
|
740
765
|
|
741
766
|
|
742
767
|
--
|
743
|
-
-- Name: phone_numbers_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
768
|
+
-- Name: phone_numbers phone_numbers_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
744
769
|
--
|
745
770
|
|
746
771
|
ALTER TABLE ONLY phone_numbers
|
@@ -748,7 +773,7 @@ ALTER TABLE ONLY phone_numbers
|
|
748
773
|
|
749
774
|
|
750
775
|
--
|
751
|
-
-- Name: postal_codes_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
776
|
+
-- Name: postal_codes postal_codes_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
752
777
|
--
|
753
778
|
|
754
779
|
ALTER TABLE ONLY postal_codes
|
@@ -756,7 +781,7 @@ ALTER TABLE ONLY postal_codes
|
|
756
781
|
|
757
782
|
|
758
783
|
--
|
759
|
-
-- Name: raisins_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
784
|
+
-- Name: raisins raisins_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
760
785
|
--
|
761
786
|
|
762
787
|
ALTER TABLE ONLY raisins
|
@@ -764,7 +789,7 @@ ALTER TABLE ONLY raisins
|
|
764
789
|
|
765
790
|
|
766
791
|
--
|
767
|
-
-- Name: read_through_raisins_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
792
|
+
-- Name: read_through_raisins read_through_raisins_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
768
793
|
--
|
769
794
|
|
770
795
|
ALTER TABLE ONLY read_through_raisins
|
@@ -772,7 +797,15 @@ ALTER TABLE ONLY read_through_raisins
|
|
772
797
|
|
773
798
|
|
774
799
|
--
|
775
|
-
-- Name:
|
800
|
+
-- Name: schema_migrations schema_migrations_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
801
|
+
--
|
802
|
+
|
803
|
+
ALTER TABLE ONLY schema_migrations
|
804
|
+
ADD CONSTRAINT schema_migrations_pkey PRIMARY KEY (version);
|
805
|
+
|
806
|
+
|
807
|
+
--
|
808
|
+
-- Name: states states_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
776
809
|
--
|
777
810
|
|
778
811
|
ALTER TABLE ONLY states
|
@@ -780,7 +813,7 @@ ALTER TABLE ONLY states
|
|
780
813
|
|
781
814
|
|
782
815
|
--
|
783
|
-
-- Name: statuses_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
816
|
+
-- Name: statuses statuses_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
784
817
|
--
|
785
818
|
|
786
819
|
ALTER TABLE ONLY statuses
|
@@ -788,7 +821,7 @@ ALTER TABLE ONLY statuses
|
|
788
821
|
|
789
822
|
|
790
823
|
--
|
791
|
-
-- Name: streets_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
824
|
+
-- Name: streets streets_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
792
825
|
--
|
793
826
|
|
794
827
|
ALTER TABLE ONLY streets
|
@@ -796,7 +829,7 @@ ALTER TABLE ONLY streets
|
|
796
829
|
|
797
830
|
|
798
831
|
--
|
799
|
-
-- Name: uncacheables_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
832
|
+
-- Name: uncacheables uncacheables_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
800
833
|
--
|
801
834
|
|
802
835
|
ALTER TABLE ONLY uncacheables
|
@@ -804,7 +837,7 @@ ALTER TABLE ONLY uncacheables
|
|
804
837
|
|
805
838
|
|
806
839
|
--
|
807
|
-
-- Name: unfindables_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
840
|
+
-- Name: unfindables unfindables_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
808
841
|
--
|
809
842
|
|
810
843
|
ALTER TABLE ONLY unfindables
|
@@ -812,7 +845,7 @@ ALTER TABLE ONLY unfindables
|
|
812
845
|
|
813
846
|
|
814
847
|
--
|
815
|
-
-- Name: unsynchronizables_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
848
|
+
-- Name: unsynchronizables unsynchronizables_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
816
849
|
--
|
817
850
|
|
818
851
|
ALTER TABLE ONLY unsynchronizables
|
@@ -820,7 +853,7 @@ ALTER TABLE ONLY unsynchronizables
|
|
820
853
|
|
821
854
|
|
822
855
|
--
|
823
|
-
-- Name: user_agents_pkey; Type: CONSTRAINT; Schema: public; Owner:
|
856
|
+
-- Name: user_agents user_agents_pkey; Type: CONSTRAINT; Schema: public; Owner: -
|
824
857
|
--
|
825
858
|
|
826
859
|
ALTER TABLE ONLY user_agents
|
@@ -830,7 +863,7 @@ ALTER TABLE ONLY user_agents
|
|
830
863
|
SET search_path = traffic, pg_catalog;
|
831
864
|
|
832
865
|
--
|
833
|
-
-- Name: paths_pkey; Type: CONSTRAINT; Schema: traffic; Owner:
|
866
|
+
-- Name: paths paths_pkey; Type: CONSTRAINT; Schema: traffic; Owner: -
|
834
867
|
--
|
835
868
|
|
836
869
|
ALTER TABLE ONLY paths
|
@@ -840,126 +873,161 @@ ALTER TABLE ONLY paths
|
|
840
873
|
SET search_path = public, pg_catalog;
|
841
874
|
|
842
875
|
--
|
843
|
-
-- Name: accounts__u_account; Type: INDEX; Schema: public; Owner:
|
876
|
+
-- Name: accounts__u_account; Type: INDEX; Schema: public; Owner: -
|
844
877
|
--
|
845
878
|
|
846
879
|
CREATE UNIQUE INDEX accounts__u_account ON accounts USING btree (account);
|
847
880
|
|
848
881
|
|
849
882
|
--
|
850
|
-
-- Name: addresses__u_address; Type: INDEX; Schema: public; Owner:
|
883
|
+
-- Name: addresses__u_address; Type: INDEX; Schema: public; Owner: -
|
851
884
|
--
|
852
885
|
|
853
886
|
CREATE UNIQUE INDEX addresses__u_address ON addresses USING btree (address);
|
854
887
|
|
855
888
|
|
856
889
|
--
|
857
|
-
-- Name: cities__u_city; Type: INDEX; Schema: public; Owner:
|
890
|
+
-- Name: cities__u_city; Type: INDEX; Schema: public; Owner: -
|
858
891
|
--
|
859
892
|
|
860
893
|
CREATE UNIQUE INDEX cities__u_city ON cities USING btree (city);
|
861
894
|
|
862
895
|
|
863
896
|
--
|
864
|
-
-- Name: countries__u_country; Type: INDEX; Schema: public; Owner:
|
897
|
+
-- Name: countries__u_country; Type: INDEX; Schema: public; Owner: -
|
865
898
|
--
|
866
899
|
|
867
900
|
CREATE UNIQUE INDEX countries__u_country ON countries USING btree (country);
|
868
901
|
|
869
902
|
|
870
903
|
--
|
871
|
-
-- Name: email_addresses__u_email_address; Type: INDEX; Schema: public; Owner:
|
904
|
+
-- Name: email_addresses__u_email_address; Type: INDEX; Schema: public; Owner: -
|
872
905
|
--
|
873
906
|
|
874
907
|
CREATE UNIQUE INDEX email_addresses__u_email_address ON email_addresses USING btree (email_address);
|
875
908
|
|
876
909
|
|
877
910
|
--
|
878
|
-
-- Name:
|
911
|
+
-- Name: index_accounts_on_phone_number_id; Type: INDEX; Schema: public; Owner: -
|
912
|
+
--
|
913
|
+
|
914
|
+
CREATE INDEX index_accounts_on_phone_number_id ON accounts USING btree (phone_number_id);
|
915
|
+
|
916
|
+
|
917
|
+
--
|
918
|
+
-- Name: index_addresses_on_city_id; Type: INDEX; Schema: public; Owner: -
|
919
|
+
--
|
920
|
+
|
921
|
+
CREATE INDEX index_addresses_on_city_id ON addresses USING btree (city_id);
|
922
|
+
|
923
|
+
|
924
|
+
--
|
925
|
+
-- Name: index_addresses_on_country_id; Type: INDEX; Schema: public; Owner: -
|
926
|
+
--
|
927
|
+
|
928
|
+
CREATE INDEX index_addresses_on_country_id ON addresses USING btree (country_id);
|
929
|
+
|
930
|
+
|
931
|
+
--
|
932
|
+
-- Name: index_addresses_on_postal_code_id; Type: INDEX; Schema: public; Owner: -
|
933
|
+
--
|
934
|
+
|
935
|
+
CREATE INDEX index_addresses_on_postal_code_id ON addresses USING btree (postal_code_id);
|
936
|
+
|
937
|
+
|
938
|
+
--
|
939
|
+
-- Name: index_addresses_on_state_id; Type: INDEX; Schema: public; Owner: -
|
940
|
+
--
|
941
|
+
|
942
|
+
CREATE INDEX index_addresses_on_state_id ON addresses USING btree (state_id);
|
943
|
+
|
944
|
+
|
945
|
+
--
|
946
|
+
-- Name: index_addresses_on_street_id; Type: INDEX; Schema: public; Owner: -
|
947
|
+
--
|
948
|
+
|
949
|
+
CREATE INDEX index_addresses_on_street_id ON addresses USING btree (street_id);
|
950
|
+
|
951
|
+
|
952
|
+
--
|
953
|
+
-- Name: ip_addresses__u_ip_address; Type: INDEX; Schema: public; Owner: -
|
879
954
|
--
|
880
955
|
|
881
956
|
CREATE UNIQUE INDEX ip_addresses__u_ip_address ON ip_addresses USING btree (ip_address);
|
882
957
|
|
883
958
|
|
884
959
|
--
|
885
|
-
-- Name: phone_numbers__u_phone_number; Type: INDEX; Schema: public; Owner:
|
960
|
+
-- Name: phone_numbers__u_phone_number; Type: INDEX; Schema: public; Owner: -
|
886
961
|
--
|
887
962
|
|
888
963
|
CREATE UNIQUE INDEX phone_numbers__u_phone_number ON phone_numbers USING btree (phone_number);
|
889
964
|
|
890
965
|
|
891
966
|
--
|
892
|
-
-- Name: postal_codes__u_postal_code; Type: INDEX; Schema: public; Owner:
|
967
|
+
-- Name: postal_codes__u_postal_code; Type: INDEX; Schema: public; Owner: -
|
893
968
|
--
|
894
969
|
|
895
970
|
CREATE UNIQUE INDEX postal_codes__u_postal_code ON postal_codes USING btree (postal_code);
|
896
971
|
|
897
972
|
|
898
973
|
--
|
899
|
-
-- Name: raisins__u_raisin; Type: INDEX; Schema: public; Owner:
|
974
|
+
-- Name: raisins__u_raisin; Type: INDEX; Schema: public; Owner: -
|
900
975
|
--
|
901
976
|
|
902
977
|
CREATE UNIQUE INDEX raisins__u_raisin ON raisins USING btree (raisin);
|
903
978
|
|
904
979
|
|
905
980
|
--
|
906
|
-
-- Name: read_through_raisins__u_read_through_raisin; Type: INDEX; Schema: public; Owner:
|
981
|
+
-- Name: read_through_raisins__u_read_through_raisin; Type: INDEX; Schema: public; Owner: -
|
907
982
|
--
|
908
983
|
|
909
984
|
CREATE UNIQUE INDEX read_through_raisins__u_read_through_raisin ON read_through_raisins USING btree (read_through_raisin);
|
910
985
|
|
911
986
|
|
912
987
|
--
|
913
|
-
-- Name: states__u_state; Type: INDEX; Schema: public; Owner:
|
988
|
+
-- Name: states__u_state; Type: INDEX; Schema: public; Owner: -
|
914
989
|
--
|
915
990
|
|
916
991
|
CREATE UNIQUE INDEX states__u_state ON states USING btree (state);
|
917
992
|
|
918
993
|
|
919
994
|
--
|
920
|
-
-- Name: statuses__u_status; Type: INDEX; Schema: public; Owner:
|
995
|
+
-- Name: statuses__u_status; Type: INDEX; Schema: public; Owner: -
|
921
996
|
--
|
922
997
|
|
923
998
|
CREATE UNIQUE INDEX statuses__u_status ON statuses USING btree (status);
|
924
999
|
|
925
1000
|
|
926
1001
|
--
|
927
|
-
-- Name: streets__u_street; Type: INDEX; Schema: public; Owner:
|
1002
|
+
-- Name: streets__u_street; Type: INDEX; Schema: public; Owner: -
|
928
1003
|
--
|
929
1004
|
|
930
1005
|
CREATE UNIQUE INDEX streets__u_street ON streets USING btree (street);
|
931
1006
|
|
932
1007
|
|
933
1008
|
--
|
934
|
-
-- Name: uncacheables__u_uncacheable; Type: INDEX; Schema: public; Owner:
|
1009
|
+
-- Name: uncacheables__u_uncacheable; Type: INDEX; Schema: public; Owner: -
|
935
1010
|
--
|
936
1011
|
|
937
1012
|
CREATE UNIQUE INDEX uncacheables__u_uncacheable ON uncacheables USING btree (uncacheable);
|
938
1013
|
|
939
1014
|
|
940
1015
|
--
|
941
|
-
-- Name: unfindables__u_unfindable; Type: INDEX; Schema: public; Owner:
|
1016
|
+
-- Name: unfindables__u_unfindable; Type: INDEX; Schema: public; Owner: -
|
942
1017
|
--
|
943
1018
|
|
944
1019
|
CREATE UNIQUE INDEX unfindables__u_unfindable ON unfindables USING btree (unfindable);
|
945
1020
|
|
946
1021
|
|
947
1022
|
--
|
948
|
-
-- Name:
|
949
|
-
--
|
950
|
-
|
951
|
-
CREATE UNIQUE INDEX unique_schema_migrations ON schema_migrations USING btree (version);
|
952
|
-
|
953
|
-
|
954
|
-
--
|
955
|
-
-- Name: unsynchronizables__u_unsynchronizable; Type: INDEX; Schema: public; Owner: -; Tablespace:
|
1023
|
+
-- Name: unsynchronizables__u_unsynchronizable; Type: INDEX; Schema: public; Owner: -
|
956
1024
|
--
|
957
1025
|
|
958
1026
|
CREATE UNIQUE INDEX unsynchronizables__u_unsynchronizable ON unsynchronizables USING btree (unsynchronizable);
|
959
1027
|
|
960
1028
|
|
961
1029
|
--
|
962
|
-
-- Name: user_agents__u_user_agent; Type: INDEX; Schema: public; Owner:
|
1030
|
+
-- Name: user_agents__u_user_agent; Type: INDEX; Schema: public; Owner: -
|
963
1031
|
--
|
964
1032
|
|
965
1033
|
CREATE UNIQUE INDEX user_agents__u_user_agent ON user_agents USING btree (user_agent);
|
@@ -968,7 +1036,7 @@ CREATE UNIQUE INDEX user_agents__u_user_agent ON user_agents USING btree (user_a
|
|
968
1036
|
SET search_path = traffic, pg_catalog;
|
969
1037
|
|
970
1038
|
--
|
971
|
-
-- Name: paths__u_path; Type: INDEX; Schema: traffic; Owner:
|
1039
|
+
-- Name: paths__u_path; Type: INDEX; Schema: traffic; Owner: -
|
972
1040
|
--
|
973
1041
|
|
974
1042
|
CREATE UNIQUE INDEX paths__u_path ON paths USING btree (path);
|
@@ -978,7 +1046,8 @@ CREATE UNIQUE INDEX paths__u_path ON paths USING btree (path);
|
|
978
1046
|
-- PostgreSQL database dump complete
|
979
1047
|
--
|
980
1048
|
|
981
|
-
SET search_path TO "$user",public;
|
1049
|
+
SET search_path TO "$user", public;
|
982
1050
|
|
983
1051
|
INSERT INTO schema_migrations (version) VALUES ('20121019040009');
|
984
1052
|
|
1053
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lookup_by
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Erik Peterson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -155,7 +155,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
155
155
|
version: '0'
|
156
156
|
requirements: []
|
157
157
|
rubyforge_project:
|
158
|
-
rubygems_version: 2.
|
158
|
+
rubygems_version: 2.5.2
|
159
159
|
signing_key:
|
160
160
|
specification_version: 4
|
161
161
|
summary: A thread-safe lookup table cache for ActiveRecord
|