paginative 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -2,6 +2,15 @@ require_relative '../../spec_helper'
2
2
 
3
3
  describe TestModel do
4
4
 
5
+ before :each do
6
+ TestModel.class_eval do
7
+ include Paginative::ModelExtension
8
+
9
+ reverse_geocoded_by :latitude, :longitude
10
+ after_validation :reverse_geocode # auto-fetch coordinates
11
+ end
12
+ end
13
+
5
14
  def create_models
6
15
  @model1 = FactoryGirl.create(:test_model, address: "Lorem", created_at: Time.now.ago(2.days))
7
16
  @model2 = FactoryGirl.create(:test_model, address: "Ipsum", created_at: Time.now.ago(1.days))
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: paginative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Isaac Norman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-01 00:00:00.000000000 Z
11
+ date: 2015-05-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -192,11 +192,9 @@ files:
192
192
  - spec/dummy/config/locales/en.yml
193
193
  - spec/dummy/config/routes.rb
194
194
  - spec/dummy/config/secrets.yml
195
- - spec/dummy/db/development.sqlite3
196
195
  - spec/dummy/db/migrate/20140416035443_create_test_models.rb
197
196
  - spec/dummy/db/schema.rb
198
197
  - spec/dummy/db/test.sqlite3
199
- - spec/dummy/log/development.log
200
198
  - spec/dummy/log/test.log
201
199
  - spec/dummy/public/404.html
202
200
  - spec/dummy/public/422.html
@@ -225,7 +223,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
225
223
  version: '0'
226
224
  requirements: []
227
225
  rubyforge_project:
228
- rubygems_version: 2.4.6
226
+ rubygems_version: 2.4.5
229
227
  signing_key:
230
228
  specification_version: 4
231
229
  summary: A new way to paginate your Rails API
@@ -257,11 +255,9 @@ test_files:
257
255
  - spec/dummy/config/routes.rb
258
256
  - spec/dummy/config/secrets.yml
259
257
  - spec/dummy/config.ru
260
- - spec/dummy/db/development.sqlite3
261
258
  - spec/dummy/db/migrate/20140416035443_create_test_models.rb
262
259
  - spec/dummy/db/schema.rb
263
260
  - spec/dummy/db/test.sqlite3
264
- - spec/dummy/log/development.log
265
261
  - spec/dummy/log/test.log
266
262
  - spec/dummy/public/404.html
267
263
  - spec/dummy/public/422.html
@@ -272,4 +268,3 @@ test_files:
272
268
  - spec/factories/paginative_test_models.rb
273
269
  - spec/models/paginative/test_model_spec.rb
274
270
  - spec/spec_helper.rb
275
- has_rdoc:
Binary file
@@ -1,136 +0,0 @@
1
-  (2.0ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
2
-  (0.4ms) select sqlite_version(*)
3
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
4
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
5
- Migrating to CreatePaginativeTestModels (20140415060518)
6
-  (0.1ms) begin transaction
7
-  (0.6ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime)
8
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140415060518"]]
9
-  (0.8ms) commit transaction
10
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
11
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
12
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
13
-  (1.1ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
14
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
15
-  (0.4ms) select sqlite_version(*)
16
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
17
-  (0.1ms) SELECT version FROM "schema_migrations"
18
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
19
-  (1.2ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
20
-  (2.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
21
-  (0.2ms) select sqlite_version(*)
22
-  (1.3ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
23
-  (0.2ms) SELECT version FROM "schema_migrations"
24
-  (2.1ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
25
-  (1.0ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
26
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
27
-  (0.4ms) select sqlite_version(*)
28
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
29
-  (0.1ms) SELECT version FROM "schema_migrations"
30
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
31
- ActiveRecord::SchemaMigration Load (1.9ms) SELECT "schema_migrations".* FROM "schema_migrations"
32
- Migrating to AddAddressToTestModels (20140416020706)
33
-  (0.1ms) begin transaction
34
-  (0.2ms) ALTER TABLE "test_models" ADD "address" varchar(255)
35
- SQLite3::SQLException: no such table: test_models: ALTER TABLE "test_models" ADD "address" varchar(255)
36
-  (0.1ms) rollback transaction
37
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
38
- Migrating to AddAddressToTestModels (20140416020706)
39
-  (0.1ms) begin transaction
40
-  (3.0ms) ALTER TABLE "paginative_test_models" ADD "address" varchar(255)
41
- SQL (0.3ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416020706"]]
42
-  (0.5ms) commit transaction
43
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
44
-  (1.3ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255)) 
45
-  (1.1ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255)) 
46
-  (0.7ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
47
-  (0.3ms) select sqlite_version(*)
48
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
49
-  (0.1ms) SELECT version FROM "schema_migrations"
50
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416020706')
51
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
52
- ActiveRecord::SchemaMigration Load (0.3ms) SELECT "schema_migrations".* FROM "schema_migrations"
53
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
54
-  (0.9ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255)) 
55
-  (0.9ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
56
-  (0.1ms) select sqlite_version(*)
57
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
58
-  (0.1ms) SELECT version FROM "schema_migrations"
59
-  (0.7ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416020706')
60
-  (0.6ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
61
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
62
- Migrating to CreateTestModels (20140416035443)
63
-  (0.1ms) begin transaction
64
-  (1.0ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
65
- SQL (0.2ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20140416035443"]]
66
-  (1.1ms) commit transaction
67
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
68
-  (1.2ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255)) 
69
-  (0.9ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime)
70
-  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
71
-  (0.1ms) select sqlite_version(*)
72
-  (0.7ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
73
-  (0.1ms) SELECT version FROM "schema_migrations"
74
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416035443')
75
-  (1.6ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255)) 
76
-  (0.9ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime)
77
-  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL) 
78
-  (0.1ms) select sqlite_version(*)
79
-  (0.8ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
80
-  (0.1ms) SELECT version FROM "schema_migrations"
81
-  (0.9ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416035443')
82
- ActiveRecord::SchemaMigration Load (0.4ms) SELECT "schema_migrations".* FROM "schema_migrations"
83
- ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
84
- Connecting to database specified by database.yml
85
-  (0.3ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
86
- Migrating to CreatePaginativeTestModels (20140415060518)
87
- Migrating to AddAddressToTestModels (20140416020706)
88
- Migrating to CreateTestModels (20140416035443)
89
-  (0.1ms) select sqlite_version(*)
90
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
91
- Connecting to database specified by database.yml
92
-  (0.4ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
93
- Migrating to CreatePaginativeTestModels (20140415060518)
94
- Migrating to AddAddressToTestModels (20140416020706)
95
- Migrating to CreateTestModels (20140416035443)
96
-  (0.1ms) select sqlite_version(*)
97
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
98
- Connecting to database specified by database.yml
99
-  (1.6ms) select sqlite_version(*)
100
-  (3.6ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255))
101
-  (1.1ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
102
-  (1.2ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
103
-  (1.0ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
104
-  (0.3ms) SELECT version FROM "schema_migrations"
105
-  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416035443')
106
-  (1.2ms) INSERT INTO "schema_migrations" (version) VALUES ('20140415060518')
107
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416020706')
108
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
109
- Connecting to database specified by database.yml
110
-  (1.4ms) select sqlite_version(*)
111
-  (1.1ms) CREATE TABLE "paginative_test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime, "address" varchar(255))
112
-  (1.6ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime, "updated_at" datetime) 
113
-  (1.3ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
114
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
115
-  (0.2ms) SELECT version FROM "schema_migrations"
116
-  (2.0ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416035443')
117
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
118
- Connecting to database specified by database.yml
119
-  (0.1ms) select sqlite_version(*)
120
-  (1.4ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
121
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
122
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
123
- Migrating to CreateTestModels (20140416035443)
124
-  (0.0ms) begin transaction
125
-  (0.6ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL)
126
-  (0.1ms) INSERT INTO "schema_migrations" ("version") VALUES ('20140416035443')
127
-  (0.8ms) commit transaction
128
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
129
-  (0.2ms) SELECT "schema_migrations"."version" FROM "schema_migrations"
130
-  (0.1ms) SELECT "schema_migrations"."version" FROM "schema_migrations" 
131
-  (0.2ms) select sqlite_version(*)
132
-  (1.0ms) CREATE TABLE "test_models" ("id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, "name" varchar(255), "address" varchar(255), "latitude" float, "longitude" float, "created_at" datetime NOT NULL, "updated_at" datetime NOT NULL) 
133
-  (0.8ms) CREATE TABLE "schema_migrations" ("version" varchar(255) NOT NULL)
134
-  (0.9ms) CREATE UNIQUE INDEX "unique_schema_migrations" ON "schema_migrations" ("version")
135
-  (0.1ms) SELECT version FROM "schema_migrations"
136
-  (0.8ms) INSERT INTO "schema_migrations" (version) VALUES ('20140416035443')