first_after_created_at 1.0.1 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (60) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +3 -0
  3. data/lib/first_after_created_at/version.rb +1 -1
  4. metadata +23 -75
  5. data/.travis.yml +0 -8
  6. data/Gemfile +0 -9
  7. data/Gemfile.lock +0 -166
  8. data/Rakefile +0 -50
  9. data/TODO +0 -0
  10. data/VERSION +0 -1
  11. data/first_after_created_at.gemspec +0 -111
  12. data/test/dummy/README.rdoc +0 -28
  13. data/test/dummy/Rakefile +0 -6
  14. data/test/dummy/app/assets/images/.keep +0 -0
  15. data/test/dummy/app/assets/javascripts/application.js +0 -13
  16. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  17. data/test/dummy/app/controllers/application_controller.rb +0 -5
  18. data/test/dummy/app/controllers/concerns/.keep +0 -0
  19. data/test/dummy/app/helpers/application_helper.rb +0 -2
  20. data/test/dummy/app/mailers/.keep +0 -0
  21. data/test/dummy/app/models/.keep +0 -0
  22. data/test/dummy/app/models/concerns/.keep +0 -0
  23. data/test/dummy/app/models/has_timestamp.rb +0 -2
  24. data/test/dummy/app/views/layouts/application.html.erb +0 -14
  25. data/test/dummy/bin/bundle +0 -3
  26. data/test/dummy/bin/rails +0 -4
  27. data/test/dummy/bin/rake +0 -4
  28. data/test/dummy/bin/setup +0 -29
  29. data/test/dummy/config.ru +0 -4
  30. data/test/dummy/config/application.rb +0 -22
  31. data/test/dummy/config/boot.rb +0 -5
  32. data/test/dummy/config/database.yml +0 -11
  33. data/test/dummy/config/environment.rb +0 -5
  34. data/test/dummy/config/environments/development.rb +0 -41
  35. data/test/dummy/config/environments/production.rb +0 -79
  36. data/test/dummy/config/environments/test.rb +0 -42
  37. data/test/dummy/config/initializers/assets.rb +0 -11
  38. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  39. data/test/dummy/config/initializers/cookies_serializer.rb +0 -3
  40. data/test/dummy/config/initializers/filter_parameter_logging.rb +0 -4
  41. data/test/dummy/config/initializers/inflections.rb +0 -16
  42. data/test/dummy/config/initializers/mime_types.rb +0 -4
  43. data/test/dummy/config/initializers/session_store.rb +0 -3
  44. data/test/dummy/config/initializers/to_time_preserves_timezone.rb +0 -10
  45. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  46. data/test/dummy/config/locales/en.yml +0 -23
  47. data/test/dummy/config/routes.rb +0 -56
  48. data/test/dummy/config/secrets.yml +0 -22
  49. data/test/dummy/db/migrate/20170802143942_create_has_timestamps.rb +0 -8
  50. data/test/dummy/db/schema.rb +0 -20
  51. data/test/dummy/lib/assets/.keep +0 -0
  52. data/test/dummy/log/.keep +0 -0
  53. data/test/dummy/public/404.html +0 -67
  54. data/test/dummy/public/422.html +0 -67
  55. data/test/dummy/public/500.html +0 -66
  56. data/test/dummy/public/favicon.ico +0 -0
  57. data/test/dummy/test/fixtures/has_timestamps.yml +0 -11
  58. data/test/dummy/test/models/has_timestamp_test.rb +0 -7
  59. data/test/first_after_created_at_test.rb +0 -46
  60. data/test/test_helper.rb +0 -23
File without changes
@@ -1,11 +0,0 @@
1
- # Read about fixtures at http://api.rubyonrails.org/classes/ActiveRecord/FixtureSet.html
2
-
3
- # This model initially had no columns defined. If you add columns to the
4
- # model remove the '{}' from the fixture names and add the columns immediately
5
- # below each fixture, per the syntax in the comments below
6
- #
7
- one: {}
8
- # column: value
9
- #
10
- two: {}
11
- # column: value
@@ -1,7 +0,0 @@
1
- require 'test_helper'
2
-
3
- class HasTimestampTest < ActiveSupport::TestCase
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
@@ -1,46 +0,0 @@
1
- require 'test_helper'
2
-
3
- class FirstAfterCreatedAtTest < ActiveSupport::TestCase
4
- test 'returns nil if no object exists' do
5
- assert_nil HasTimestamp.first_after_created_at(Time.now)
6
- end
7
-
8
- test 'returns nil if no object meets criteria' do
9
- HasTimestamp.create
10
- assert_nil HasTimestamp.first_after_created_at(1.hour.from_now)
11
- end
12
-
13
- test 'can return the first object' do
14
- obj = HasTimestamp.create
15
- HasTimestamp.create
16
- assert_equal obj, HasTimestamp.first_after_created_at(1.hour.ago)
17
- end
18
-
19
- test "will ignore first object if it's out of scope" do
20
- HasTimestamp.create
21
- obj = HasTimestamp.create(created_at: 2.hours.from_now)
22
-
23
- assert_equal obj, HasTimestamp.first_after_created_at(1.hour.from_now)
24
- end
25
-
26
- test 'given two objects with same created at, returns one with min id' do
27
- obj = HasTimestamp.create
28
- HasTimestamp.create(created_at: obj.created_at)
29
-
30
- assert_equal obj, HasTimestamp.first_after_created_at(1.hour.ago)
31
- end
32
-
33
- test 'can return the middle object' do
34
- objs = Array.new(3) do |n|
35
- HasTimestamp.create(created_at: n.hours.from_now)
36
- end
37
- middle = objs[1]
38
- assert_equal middle, HasTimestamp.first_after_created_at(middle.created_at)
39
- end
40
-
41
- test 'can join to another table' do
42
- obj = HasTimestamp.create
43
- found_with_join = HasTimestamp.joins('INNER JOIN has_timestamps h ON h.id = has_timestamps.id').first_after_created_at(obj.created_at)
44
- assert_equal obj, found_with_join
45
- end
46
- end
@@ -1,23 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require_relative "../test/dummy/config/environment"
5
-
6
- require "rails/test_help"
7
- ActiveRecord::MigrationContext.new(File.expand_path("../test/dummy/db/migrate", __dir__)).migrate
8
-
9
- # Filter out the backtrace from minitest while preserving the one from other libraries.
10
- Minitest.backtrace_filter = Minitest::BacktraceFilter.new
11
-
12
- require "rails/test_unit/reporter"
13
-
14
- Rails::TestUnitReporter.executable = 'bin/test'
15
-
16
-
17
- # Load fixtures from the engine
18
- if ActiveSupport::TestCase.respond_to?(:fixture_path=)
19
- ActiveSupport::TestCase.fixture_path = File.expand_path("fixtures", __dir__)
20
- ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
21
- ActiveSupport::TestCase.file_fixture_path = ActiveSupport::TestCase.fixture_path + "/files"
22
- ActiveSupport::TestCase.fixtures :all
23
- end