sunstone 5.1.0.1 → 5.1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b7e49d0ceb3c5aed542832e24ef362879e726ad6
4
- data.tar.gz: 69b3b7e07205ff9a13d4673a7fe98314c606ca46
3
+ metadata.gz: f44d08dc6bb1c700f32c5271ccab0db4fe069bc4
4
+ data.tar.gz: a442c4792155830be5fd507b479469e89adaddb9
5
5
  SHA512:
6
- metadata.gz: a9ac83b1f164e71ed3ebc7f2f2156b3974d73e5605e661fe0c8c27709f09476d7dd238e1a4c3a206abdf5fc9f3cbc778dd14acead0e8b71f7248f0d1c919a850
7
- data.tar.gz: 0576bfa189e528511fa40e33d2b9e45b5175e43872d8431ac6434fd4043ef9cce6c4b86262e30ec339776d935373e7f34c7790dd5e8260ee71d21848a7e300cd
6
+ metadata.gz: 2221ec8ec6cb8a6b14d0d4d08b8639b611e0fefafcec97aa6ea6d0721933f124e930a8a77382de76ce9d57d31f17aa8ce9beca7175dfd5d64630fef86e030494
7
+ data.tar.gz: 0d588df4234c01d1a1272fc3620c592308fda785a56a0c2ac4939301be68678547eee8907e7f780f461e390cdafad84291fdbb9d16dfe429cebb750bb2ada623
@@ -461,6 +461,10 @@ module Arel
461
461
  def visit_Arel_Nodes_Descending o, collector
462
462
  { visit(o.expr, collector) => :desc }
463
463
  end
464
+
465
+ def visit_Arel_Nodes_RandomOrdering o, collector
466
+ :random
467
+ end
464
468
  #
465
469
  # def visit_Arel_Nodes_Group o, collector
466
470
  # visit o.expr, collector
@@ -1036,4 +1040,4 @@ module Arel
1036
1040
  end
1037
1041
  end
1038
1042
  end
1039
- end
1043
+ end
@@ -1,3 +1,3 @@
1
1
  module Sunstone
2
- VERSION = '5.1.0.1'
2
+ VERSION = '5.1.0.2'
3
3
  end
@@ -0,0 +1,27 @@
1
+ require 'test_helper'
2
+
3
+ class ActiveRecord::OrderTest < ActiveSupport::TestCase
4
+
5
+ schema do
6
+ create_table "ships", limit: 100 do |t|
7
+ t.string "name", limit: 255
8
+ end
9
+ end
10
+
11
+ class Ship < ActiveRecord::Base
12
+ end
13
+
14
+ test '::order(COLUMN)' do
15
+ webmock(:get, "/ships", { limit: 1, order: [{id: :asc}] }).to_return({
16
+ body: [{id: 42}].to_json
17
+ })
18
+
19
+ assert_equal 42, Ship.order(:id).first.id
20
+ end
21
+
22
+ # TODO: Uses Arel::Nodes::RandomOrdering from:
23
+ # https://github.com/malomalo/activerecord-sort
24
+ # which should probably go into arel-extensions?
25
+ test '::order(:random)'
26
+
27
+ end
data/test/test_helper.rb CHANGED
@@ -27,16 +27,16 @@ $debugging = false
27
27
  class ActiveSupport::TestCase
28
28
  include WebMock::API
29
29
 
30
- # include ActiveSupport::Testing::TimeHelpers
30
+ # File 'lib/active_support/testing/declarative.rb'
31
31
  def self.test(name, &block)
32
- test_name = "test_#{name.gsub(/\s+/,'_')}".to_sym
33
- defined = instance_method(test_name) rescue false
32
+ test_name = "test_#{name.gsub(/\s+/, '_')}".to_sym
33
+ defined = method_defined? test_name
34
34
  raise "#{test_name} is already defined in #{self}" if defined
35
35
  if block_given?
36
36
  define_method(test_name, &block)
37
37
  else
38
38
  define_method(test_name) do
39
- flunk "No implementation provided for #{name}"
39
+ skip "No implementation provided for #{name}"
40
40
  end
41
41
  end
42
42
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sunstone
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.1.0.1
4
+ version: 5.1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jon Bracy
@@ -295,6 +295,7 @@ files:
295
295
  - test/active_record/query/count_test.rb
296
296
  - test/active_record/query/distinct_test.rb
297
297
  - test/active_record/query/find_test.rb
298
+ - test/active_record/query/order_test.rb
298
299
  - test/active_record/query/where_test.rb
299
300
  - test/active_record/query_test.rb
300
301
  - test/schema_mock.rb
@@ -337,6 +338,7 @@ test_files:
337
338
  - test/active_record/query/count_test.rb
338
339
  - test/active_record/query/distinct_test.rb
339
340
  - test/active_record/query/find_test.rb
341
+ - test/active_record/query/order_test.rb
340
342
  - test/active_record/query/where_test.rb
341
343
  - test/active_record/query_test.rb
342
344
  - test/schema_mock.rb