nostalgic 0.5.0 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (66) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +11 -24
  3. data/Rakefile +3 -8
  4. data/app/assets/config/nostalgic_manifest.js +2 -0
  5. data/app/assets/javascripts/nostalgic/application.js +3 -1
  6. data/app/assets/stylesheets/nostalgic/application.css +3 -3
  7. data/app/jobs/nostalgic/application_job.rb +4 -0
  8. data/app/mailers/nostalgic/application_mailer.rb +6 -0
  9. data/app/models/nostalgic/application_record.rb +5 -0
  10. data/app/views/layouts/nostalgic/application.html.erb +3 -1
  11. data/lib/nostalgic.rb +3 -3
  12. data/lib/nostalgic/nostalgic_attr.rb +48 -26
  13. data/lib/nostalgic/railtie.rb +3 -5
  14. data/lib/nostalgic/version.rb +1 -1
  15. metadata +27 -126
  16. data/test/dummy/README.rdoc +0 -28
  17. data/test/dummy/Rakefile +0 -6
  18. data/test/dummy/app/assets/javascripts/application.js +0 -13
  19. data/test/dummy/app/assets/stylesheets/application.css +0 -15
  20. data/test/dummy/app/controllers/application_controller.rb +0 -5
  21. data/test/dummy/app/helpers/application_helper.rb +0 -2
  22. data/test/dummy/app/models/company.rb +0 -3
  23. data/test/dummy/app/models/user.rb +0 -4
  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 -23
  31. data/test/dummy/config/boot.rb +0 -5
  32. data/test/dummy/config/database.yml +0 -25
  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/wrap_parameters.rb +0 -14
  45. data/test/dummy/config/locales/en.yml +0 -23
  46. data/test/dummy/config/routes.rb +0 -4
  47. data/test/dummy/config/secrets.yml +0 -22
  48. data/test/dummy/db/migrate/20160807103323_create_users.rb +0 -9
  49. data/test/dummy/db/migrate/20161217105723_create_companies.rb +0 -8
  50. data/test/dummy/db/migrate/20161217105921_add_column_company_id_on_users.rb +0 -5
  51. data/test/dummy/db/schema.rb +0 -40
  52. data/test/dummy/db/test.sqlite3 +0 -0
  53. data/test/dummy/log/test.log +0 -162
  54. data/test/dummy/public/404.html +0 -67
  55. data/test/dummy/public/422.html +0 -67
  56. data/test/dummy/public/500.html +0 -66
  57. data/test/dummy/public/favicon.ico +0 -0
  58. data/test/dummy/test/models/company_test.rb +0 -5
  59. data/test/dummy/test/models/user_test.rb +0 -60
  60. data/test/fixtures/companies.yml +0 -7
  61. data/test/fixtures/nostalgic/attrs.yml +0 -28
  62. data/test/fixtures/users.yml +0 -5
  63. data/test/integration/navigation_test.rb +0 -8
  64. data/test/models/nostalgic/attr_test.rb +0 -11
  65. data/test/nostalgic_test.rb +0 -11
  66. data/test/test_helper.rb +0 -21
File without changes
@@ -1,5 +0,0 @@
1
- require 'test_helper'
2
-
3
- class CompanyTest < ActiveSupport::TestCase
4
-
5
- end
@@ -1,60 +0,0 @@
1
- require 'test_helper'
2
-
3
- class UserTest < ActiveSupport::TestCase
4
-
5
- def test_belongs_to
6
- assert @user = User.first
7
- assert_equal 1, @user.company_id
8
-
9
- today = Date.today
10
- assert_equal 1, @user.company_on(today).id
11
-
12
- @user.company_id = Company.second.id
13
- @user.company_id_effective_at = today + 1.day
14
- assert @user.save
15
-
16
- @user.reload
17
- assert_equal 1, @user.company.id
18
- assert_equal 1, @user.company_on(nil).id
19
- assert_equal 1, @user.company_on(today - 1.day).id
20
- assert_equal 1, @user.company_on(today).id
21
- assert_equal 2, @user.company_on(today + 1.day).id
22
- end
23
-
24
- def test_tel
25
- assert @user = User.first
26
- assert_equal '222-123-4567', @user.tel
27
-
28
- assert_equal '222-123-4567', @user.tel_at(nil)
29
- assert_equal '111-123-4567', @user.tel_at(Date.today - 1.day)
30
- assert_equal '222-123-4567', @user.tel_at(Date.today)
31
- assert_equal '333-123-4567', @user.tel_at(Date.today + 1.day)
32
- end
33
-
34
- def test_save_tel
35
- today = Date.today
36
- assert @user = User.first
37
- assert_not_equal '444-123-4567', @user.tel
38
- assert_not_equal '444-123-4567', @user.tel_at(today)
39
-
40
- @user.tel = '444-123-4567'
41
- @user.tel_effective_at = today
42
- assert @user.save
43
- assert_equal '444-123-4567', @user.tel
44
- assert_equal '444-123-4567', @user.tel_at(today)
45
-
46
- @user.tel = '555-123-4567'
47
- @user.tel_effective_at = today + 2.days
48
- assert @user.save
49
- assert_equal '555-123-4567', @user.tel
50
- assert_equal '444-123-4567', @user.tel_at(today)
51
- assert_equal '333-123-4567', @user.tel_at(today + 1.day)
52
- assert_equal '555-123-4567', @user.tel_at(today + 2.day)
53
- end
54
-
55
- def test_tels
56
- assert @user = User.first
57
- assert @user.respond_to?(:tels)
58
- assert_equal 3, @user.tels.size
59
- end
60
- end
@@ -1,7 +0,0 @@
1
- 1:
2
- id: 1
3
- name: TestCompany001
4
-
5
- 2:
6
- id: 2
7
- name: TestCompany002
@@ -1,28 +0,0 @@
1
- 1:
2
- id: 1
3
- model_type: User
4
- model_id: 1
5
- name: tel
6
- value: '111-123-4567'
7
- effective_at: <%= Date.today - 1.month %>
8
- 2:
9
- id: 2
10
- model_type: User
11
- model_id: 1
12
- name: tel
13
- value: '222-123-4567'
14
- effective_at: <%= Date.today %>
15
- 3:
16
- id: 3
17
- model_type: User
18
- model_id: 1
19
- name: tel
20
- value: '333-123-4567'
21
- effective_at: <%= Date.today + 1.day %>
22
- 4:
23
- id: 4
24
- model_type: User
25
- model_id: 1
26
- name: company_id
27
- value: 1
28
- effective_at: <%= Date.today - 1.day %>
@@ -1,5 +0,0 @@
1
- 1:
2
- id: 1
3
- company_id: 1
4
- email: test1@example.com
5
- tel: 222-123-4567
@@ -1,8 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NavigationTest < ActionDispatch::IntegrationTest
4
- # test "the truth" do
5
- # assert true
6
- # end
7
- end
8
-
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- module Nostalgic
4
- class AttrTest < ActiveSupport::TestCase
5
-
6
- def test_nostalgic_model
7
- Nostalgic::Attr.new
8
- end
9
-
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'test_helper'
2
-
3
- class NostalgicTest < ActiveSupport::TestCase
4
- def test_that_it_has_a_version_number
5
- refute_nil ::Nostalgic::VERSION
6
- end
7
-
8
- def test_it_does_something_useful
9
- assert_kind_of Module, Nostalgic
10
- end
11
- end
@@ -1,21 +0,0 @@
1
- # Configure Rails Environment
2
- ENV["RAILS_ENV"] = "test"
3
-
4
- require File.expand_path("../../test/dummy/config/environment.rb", __FILE__)
5
- ActiveRecord::Migrator.migrations_paths = [File.expand_path("../../test/dummy/db/migrate", __FILE__)]
6
- ActiveRecord::Migrator.migrations_paths << File.expand_path('../../db/migrate', __FILE__)
7
- require "rails/test_help"
8
-
9
- # Filter out Minitest backtrace while allowing backtrace from other libraries
10
- # to be shown.
11
- Minitest.backtrace_filter = Minitest::BacktraceFilter.new
12
-
13
- # Load support files
14
- Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
15
-
16
- # Load fixtures from the engine
17
- if ActiveSupport::TestCase.respond_to?(:fixture_path=)
18
- ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
19
- ActionDispatch::IntegrationTest.fixture_path = ActiveSupport::TestCase.fixture_path
20
- ActiveSupport::TestCase.fixtures :all
21
- end