poly_belongs_to 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -8,8 +8,7 @@ class MajorVersionChangesTest < ActiveSupport::TestCase
8
8
 
9
9
  let(:contact) { contacts(:bob_contact) }
10
10
 
11
- case PolyBelongsTo::VERSION.split('.').take(3).join.to_i
12
- when ->v{ v < 100 }
11
+ if Gem::Dependency.new('', "< 1.0.0").match?('', PolyBelongsTo::VERSION)
13
12
  it "pre 1.0.0 first parent relation" do
14
13
  contact.pbt.must_be_same_as :user
15
14
  Contact.pbt.must_be_same_as :user
@@ -35,7 +34,7 @@ class MajorVersionChangesTest < ActiveSupport::TestCase
35
34
  it "pre 1.0.0 :pbt_parent returns first parent" do
36
35
  contact.pbt_parent.id.must_be_same_as users(:bob).id
37
36
  end
38
- when ->v { v >= 100 }
37
+ else
39
38
  it "post 1.0.0 first polymorphic parent relation" do
40
39
  contact.pbt.must_be_same_as :contactable
41
40
  Contact.pbt.must_be_same_as :contactable
@@ -54,8 +53,8 @@ class MajorVersionChangesTest < ActiveSupport::TestCase
54
53
  end
55
54
 
56
55
  it "pre 1.0.0 :pbt_type_sym on dual ownership with non-polymorphic first" do
57
- contact.pbt_id_sym.must_be_same_as :addressable_id
58
- Contact.pbt_id_sym.must_be_same_as :addressable_id
56
+ contact.pbt_id_sym.must_be_same_as :contactable_id
57
+ Contact.pbt_id_sym.must_be_same_as :contactable_id
59
58
  end
60
59
 
61
60
  it "post 1.0.0 :pbt_parent gives polymorphic parent precedence" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poly_belongs_to
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel P. Clark
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-10 00:00:00.000000000 Z
11
+ date: 2017-02-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -101,8 +101,8 @@ files:
101
101
  - lib/poly_belongs_to/faked_collection.rb
102
102
  - lib/poly_belongs_to/pbt.rb
103
103
  - lib/poly_belongs_to/singleton_set.rb
104
+ - lib/poly_belongs_to/sorted_reflection_decorator.rb
104
105
  - lib/poly_belongs_to/version.rb
105
- - lib/tasks/poly_belongs_to_tasks.rake
106
106
  - test/core_test.rb
107
107
  - test/dummy/Rakefile
108
108
  - test/dummy/app/controllers/application_controller.rb
@@ -247,132 +247,132 @@ required_rubygems_version: !ruby/object:Gem::Requirement
247
247
  version: '0'
248
248
  requirements: []
249
249
  rubyforge_project:
250
- rubygems_version: 2.5.2
250
+ rubygems_version: 2.6.10
251
251
  signing_key:
252
252
  specification_version: 4
253
253
  summary: Uniform Omni-Relational ActiveRecord Tools
254
254
  test_files:
255
+ - test/faked_collection_test.rb
256
+ - test/core_test.rb
255
257
  - test/dup_test.rb
258
+ - test/major_version_changes_test.rb
259
+ - test/test_helper.rb
260
+ - test/pbt_test.rb
261
+ - test/fixtures/profiles.yml
262
+ - test/fixtures/users.yml
263
+ - test/fixtures/phones.yml
264
+ - test/fixtures/tags.yml
265
+ - test/fixtures/address_books.yml
256
266
  - test/fixtures/squishies.yml
257
267
  - test/fixtures/addresses.yml
258
- - test/fixtures/photos.yml
259
- - test/fixtures/profiles.yml
260
- - test/fixtures/tires.yml
261
268
  - test/fixtures/geo_locations.yml
262
- - test/fixtures/phones.yml
263
- - test/fixtures/users.yml
264
269
  - test/fixtures/cars.yml
265
- - test/fixtures/tags.yml
270
+ - test/fixtures/tires.yml
271
+ - test/fixtures/photos.yml
266
272
  - test/fixtures/contacts.yml
267
- - test/fixtures/address_books.yml
268
273
  - test/fixtures/ssns.yml
269
- - test/singleton_set_test.rb
270
- - test/test_helper.rb
271
- - test/faked_collection_test.rb
272
- - test/core_test.rb
274
+ - test/dummy/bin/setup
275
+ - test/dummy/bin/rails
276
+ - test/dummy/bin/rake
277
+ - test/dummy/bin/bundle
278
+ - test/dummy/log/test.log
279
+ - test/dummy/log/development.log
273
280
  - test/dummy/db/test.sqlite3
274
- - test/dummy/db/development.sqlite3
275
281
  - test/dummy/db/schema.rb
276
- - test/dummy/db/migrate/20161210150343_create_hmt_parts.rb
277
- - test/dummy/db/migrate/20150220230146_create_squishies.rb
278
- - test/dummy/db/migrate/20161209115003_create_events.rb
279
- - test/dummy/db/migrate/20161209115212_create_work_orders.rb
280
- - test/dummy/db/migrate/20150322233755_create_delta.rb
281
- - test/dummy/db/migrate/20150322233743_create_capas.rb
282
- - test/dummy/db/migrate/20150216092449_create_contacts.rb
283
- - test/dummy/db/migrate/20161210145334_create_assemblies.rb
284
- - test/dummy/db/migrate/20161210145757_create_assembly_part_join_table.rb
285
- - test/dummy/db/migrate/20150301100658_create_tires.rb
286
- - test/dummy/db/migrate/20150322233733_create_beta.rb
287
- - test/dummy/db/migrate/20150322233720_create_alphas.rb
282
+ - test/dummy/db/migrate/20150216092338_create_profiles.rb
288
283
  - test/dummy/db/migrate/20150216092218_create_addresses.rb
289
- - test/dummy/db/migrate/20150211224225_create_phones.rb
290
- - test/dummy/db/migrate/20160120224015_add_contactable_to_contacts.rb
291
- - test/dummy/db/migrate/20150220213422_create_geo_locations.rb
292
284
  - test/dummy/db/migrate/20161210145355_create_parts.rb
293
- - test/dummy/db/migrate/20160120231645_create_address_books.rb
294
- - test/dummy/db/migrate/20150216092519_create_ssns.rb
295
- - test/dummy/db/migrate/20150211224157_create_tags.rb
296
285
  - test/dummy/db/migrate/20150211224139_create_users.rb
297
- - test/dummy/db/migrate/20150216092338_create_profiles.rb
286
+ - test/dummy/db/migrate/20150211224157_create_tags.rb
287
+ - test/dummy/db/migrate/20150220230146_create_squishies.rb
288
+ - test/dummy/db/migrate/20150322233755_create_delta.rb
289
+ - test/dummy/db/migrate/20161209115212_create_work_orders.rb
290
+ - test/dummy/db/migrate/20161209115003_create_events.rb
291
+ - test/dummy/db/migrate/20150211224225_create_phones.rb
292
+ - test/dummy/db/migrate/20150322233720_create_alphas.rb
293
+ - test/dummy/db/migrate/20161210145757_create_assembly_part_join_table.rb
298
294
  - test/dummy/db/migrate/20150511161648_create_coffees.rb
299
- - test/dummy/db/migrate/20150301100722_create_cars.rb
300
- - test/dummy/db/migrate/20150216092411_create_photos.rb
301
- - test/dummy/db/migrate/20161210074616_add_big_company_id_to_work_order.rb
302
295
  - test/dummy/db/migrate/20161210074545_create_big_companies.rb
296
+ - test/dummy/db/migrate/20150216092519_create_ssns.rb
297
+ - test/dummy/db/migrate/20150220213422_create_geo_locations.rb
298
+ - test/dummy/db/migrate/20150216092411_create_photos.rb
299
+ - test/dummy/db/migrate/20161210150343_create_hmt_parts.rb
300
+ - test/dummy/db/migrate/20150301100658_create_tires.rb
303
301
  - test/dummy/db/migrate/20161210150330_create_hmt_assemblies.rb
304
- - test/dummy/config/initializers/mime_types.rb
305
- - test/dummy/config/initializers/session_store.rb
306
- - test/dummy/config/initializers/assets.rb
307
- - test/dummy/config/initializers/wrap_parameters.rb
308
- - test/dummy/config/initializers/backtrace_silencers.rb
309
- - test/dummy/config/initializers/filter_parameter_logging.rb
310
- - test/dummy/config/initializers/inflections.rb
311
- - test/dummy/config/initializers/cookies_serializer.rb
312
- - test/dummy/config/application.rb
313
- - test/dummy/config/environments/test.rb
314
- - test/dummy/config/environments/development.rb
315
- - test/dummy/config/environments/production.rb
316
- - test/dummy/config/secrets.yml
317
- - test/dummy/config/boot.rb
318
- - test/dummy/config/routes.rb
319
- - test/dummy/config/locales/en.yml
320
- - test/dummy/config/environment.rb
321
- - test/dummy/config/database.yml
322
- - test/dummy/app/controllers/application_controller.rb
302
+ - test/dummy/db/migrate/20150301100722_create_cars.rb
303
+ - test/dummy/db/migrate/20161210145334_create_assemblies.rb
304
+ - test/dummy/db/migrate/20160120231645_create_address_books.rb
305
+ - test/dummy/db/migrate/20160120224015_add_contactable_to_contacts.rb
306
+ - test/dummy/db/migrate/20150322233733_create_beta.rb
307
+ - test/dummy/db/migrate/20150216092449_create_contacts.rb
308
+ - test/dummy/db/migrate/20161210074616_add_big_company_id_to_work_order.rb
309
+ - test/dummy/db/migrate/20150322233743_create_capas.rb
310
+ - test/dummy/db/development.sqlite3
311
+ - test/dummy/config.ru
312
+ - test/dummy/app/views/layouts/application.html.erb
323
313
  - test/dummy/app/helpers/application_helper.rb
324
- - test/dummy/app/models/manifest.rb
325
- - test/dummy/app/models/coffee.rb
314
+ - test/dummy/app/models/big_company.rb
315
+ - test/dummy/app/models/assembly.rb
316
+ - test/dummy/app/models/phone.rb
326
317
  - test/dummy/app/models/ssn.rb
318
+ - test/dummy/app/models/address.rb
319
+ - test/dummy/app/models/user.rb
320
+ - test/dummy/app/models/manifest.rb
321
+ - test/dummy/app/models/address_book.rb
322
+ - test/dummy/app/models/geo_location.rb
327
323
  - test/dummy/app/models/event.rb
324
+ - test/dummy/app/models/car.rb
325
+ - test/dummy/app/models/coffee.rb
326
+ - test/dummy/app/models/hmt_part.rb
327
+ - test/dummy/app/models/squishy.rb
328
+ - test/dummy/app/models/part.rb
329
+ - test/dummy/app/models/beta.rb
330
+ - test/dummy/app/models/tag.rb
331
+ - test/dummy/app/models/tire.rb
332
+ - test/dummy/app/models/delta.rb
333
+ - test/dummy/app/models/photo.rb
328
334
  - test/dummy/app/models/capa.rb
329
335
  - test/dummy/app/models/work_order.rb
330
- - test/dummy/app/models/address_book.rb
331
336
  - test/dummy/app/models/contact.rb
332
337
  - test/dummy/app/models/alpha.rb
333
- - test/dummy/app/models/car.rb
334
- - test/dummy/app/models/tire.rb
335
- - test/dummy/app/models/part.rb
336
- - test/dummy/app/models/user.rb
337
- - test/dummy/app/models/big_company.rb
338
- - test/dummy/app/models/geo_location.rb
339
- - test/dummy/app/models/address.rb
340
338
  - test/dummy/app/models/hmt_assembly.rb
341
- - test/dummy/app/models/delta.rb
342
- - test/dummy/app/models/phone.rb
343
339
  - test/dummy/app/models/profile.rb
344
- - test/dummy/app/models/hmt_part.rb
345
- - test/dummy/app/models/squishy.rb
346
- - test/dummy/app/models/tag.rb
347
- - test/dummy/app/models/assembly.rb
348
- - test/dummy/app/models/photo.rb
349
- - test/dummy/app/models/beta.rb
350
- - test/dummy/app/views/layouts/application.html.erb
340
+ - test/dummy/app/controllers/application_controller.rb
341
+ - test/dummy/config/initializers/wrap_parameters.rb
342
+ - test/dummy/config/initializers/filter_parameter_logging.rb
343
+ - test/dummy/config/initializers/inflections.rb
344
+ - test/dummy/config/initializers/assets.rb
345
+ - test/dummy/config/initializers/cookies_serializer.rb
346
+ - test/dummy/config/initializers/mime_types.rb
347
+ - test/dummy/config/initializers/session_store.rb
348
+ - test/dummy/config/initializers/backtrace_silencers.rb
349
+ - test/dummy/config/locales/en.yml
350
+ - test/dummy/config/database.yml
351
+ - test/dummy/config/routes.rb
352
+ - test/dummy/config/environment.rb
353
+ - test/dummy/config/secrets.yml
354
+ - test/dummy/config/boot.rb
355
+ - test/dummy/config/environments/development.rb
356
+ - test/dummy/config/environments/test.rb
357
+ - test/dummy/config/environments/production.rb
358
+ - test/dummy/config/application.rb
351
359
  - test/dummy/public/favicon.ico
352
360
  - test/dummy/Rakefile
353
- - test/dummy/config.ru
354
- - test/dummy/log/test.log
355
- - test/dummy/log/development.log
356
- - test/dummy/bin/rake
357
- - test/dummy/bin/rails
358
- - test/dummy/bin/bundle
359
- - test/dummy/bin/setup
360
- - test/dummy/test/fixtures/big_companies.yml
361
- - test/dummy/test/fixtures/hmt_assemblies.yml
362
- - test/dummy/test/fixtures/parts.yml
363
- - test/dummy/test/fixtures/work_orders.yml
364
- - test/dummy/test/fixtures/hmt_parts.yml
365
- - test/dummy/test/fixtures/events.yml
366
- - test/dummy/test/fixtures/coffees.yml
367
- - test/dummy/test/fixtures/assemblies.yml
361
+ - test/dummy/test/models/hmt_assembly_test.rb
368
362
  - test/dummy/test/models/assembly_test.rb
369
- - test/dummy/test/models/hmt_part_test.rb
370
363
  - test/dummy/test/models/coffee_test.rb
371
- - test/dummy/test/models/address_book_test.rb
372
- - test/dummy/test/models/work_order_test.rb
373
364
  - test/dummy/test/models/part_test.rb
374
- - test/dummy/test/models/event_test.rb
365
+ - test/dummy/test/models/hmt_part_test.rb
366
+ - test/dummy/test/models/work_order_test.rb
375
367
  - test/dummy/test/models/big_company_test.rb
376
- - test/dummy/test/models/hmt_assembly_test.rb
377
- - test/pbt_test.rb
378
- - test/major_version_changes_test.rb
368
+ - test/dummy/test/models/event_test.rb
369
+ - test/dummy/test/models/address_book_test.rb
370
+ - test/dummy/test/fixtures/events.yml
371
+ - test/dummy/test/fixtures/parts.yml
372
+ - test/dummy/test/fixtures/assemblies.yml
373
+ - test/dummy/test/fixtures/hmt_assemblies.yml
374
+ - test/dummy/test/fixtures/work_orders.yml
375
+ - test/dummy/test/fixtures/big_companies.yml
376
+ - test/dummy/test/fixtures/hmt_parts.yml
377
+ - test/dummy/test/fixtures/coffees.yml
378
+ - test/singleton_set_test.rb
@@ -1,4 +0,0 @@
1
- # desc "Explaining what the task does"
2
- # task :poly_belongs_to do
3
- # # Task goes here
4
- # end