eac_rails_utils 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper.rb +5 -1
  3. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder.rb +10 -2
  4. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/association_select_field.rb +1 -1
  5. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/common_text_fields.rb +1 -1
  6. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/currency_field.rb +1 -1
  7. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/date_field.rb +1 -1
  8. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/fields_for.rb +1 -1
  9. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/file_field.rb +1 -1
  10. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/radio_select_field.rb +1 -1
  11. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/searchable_association_field.rb +1 -1
  12. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/select_field.rb +1 -1
  13. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/time_field.rb +1 -1
  14. data/{lib/eac → app/helpers/eac_rails_utils}/common_form_helper/form_builder/year_month_field.rb +1 -1
  15. data/app/helpers/eac_rails_utils/data_table_helper.rb +13 -0
  16. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/column.rb +1 -1
  17. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/data_table.rb +2 -2
  18. data/{lib/eac → app/helpers/eac_rails_utils}/data_table_helper/setup.rb +2 -2
  19. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper.rb +5 -1
  20. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/bootstrap_gui_builder.rb +1 -1
  21. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/data_builder.rb +1 -1
  22. data/{lib/eac → app/helpers/eac_rails_utils}/menus_helper/gui_builder.rb +1 -1
  23. data/{lib/eac → app/validators/eac_rails_utils}/cpf_validator.rb +1 -1
  24. data/{lib/eac → app/validators/eac_rails_utils}/no_presence_validator.rb +1 -1
  25. data/lib/eac_rails_utils.rb +2 -39
  26. data/lib/eac_rails_utils/engine.rb +2 -0
  27. data/lib/{eac → eac_rails_utils}/htmlbeautifier.rb +1 -1
  28. data/lib/eac_rails_utils/models.rb +9 -0
  29. data/lib/eac_rails_utils/models/attribute_required.rb +43 -0
  30. data/lib/eac_rails_utils/models/fetch_errors.rb +92 -0
  31. data/lib/eac_rails_utils/models/inequality_queries.rb +39 -0
  32. data/lib/eac_rails_utils/models/tableless.rb +97 -0
  33. data/lib/eac_rails_utils/models/test_utils.rb +65 -0
  34. data/lib/eac_rails_utils/patches.rb +9 -0
  35. data/lib/eac_rails_utils/patches/action_controller_base.rb +2 -0
  36. data/lib/eac_rails_utils/version.rb +1 -1
  37. data/test/dummy/app/models/user.rb +4 -0
  38. data/test/{lib/eac → helpers/eac_rails_utils}/common_form_helper_test.rb +2 -2
  39. data/test/{lib/eac → helpers/eac_rails_utils}/data_table_test_helper_test.rb +2 -2
  40. data/test/{app/helpers → helpers}/eac_rails_utils/formatter_helper_test.rb +0 -0
  41. data/test/lib/eac_rails_utils/{patches/model_attribute_required_test.rb → models/attribute_required_test.rb} +1 -0
  42. data/test/lib/eac_rails_utils/models/fetch_errors_test.rb +80 -0
  43. data/test/lib/eac_rails_utils/models/tableless_test.rb +25 -0
  44. data/test/{lib/eac → validators}/cpf_validator_test.rb +2 -2
  45. metadata +63 -64
  46. data/lib/eac/data_table_helper.rb +0 -13
  47. data/lib/eac/inequality_queries.rb +0 -37
  48. data/lib/eac/model.rb +0 -90
  49. data/lib/eac/test_utils.rb +0 -61
  50. data/lib/eac_rails_utils/patches/model_attribute_required.rb +0 -34
  51. data/lib/eac_rails_utils/patches/ofx_parser.rb +0 -43
  52. data/lib/eac_rails_utils/tableless_model.rb +0 -92
  53. data/test/lib/eac/model_test.rb +0 -78
  54. data/test/lib/eac/source_target_fixtures_test_files/a.source.html +0 -1
  55. data/test/lib/eac/source_target_fixtures_test_files/a.target.yaml +0 -1
  56. data/test/lib/eac/source_target_fixtures_test_files/b.source.html +0 -1
  57. data/test/lib/eac/source_target_fixtures_test_files/c.target.yaml +0 -1
  58. data/test/lib/eac_rails_utils/tableless_model_test.rb +0 -23
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'test_helper'
4
-
5
- module EacRailsUtils
6
- class TablelessModelTest < ActiveSupport::TestCase
7
- class Stub < ::EacRailsUtils::TablelessModel
8
- attribute :tempo, DateTime
9
- end
10
-
11
- test 'date time array values' do
12
- stub = Stub.new('tempo(1i)' => '9', 'tempo(2i)' => '10', 'tempo(3i)' => '11',
13
- 'tempo(4i)' => '12', 'tempo(5i)' => '13', 'tempo(6i)' => '14')
14
- assert stub.tempo.is_a?(DateTime), "Class: |#{stub.tempo.class}|, Value: |#{stub.tempo}|"
15
- assert_equal 9, stub.tempo.year, 'Year'
16
- assert_equal 10, stub.tempo.month, 'Month'
17
- assert_equal 11, stub.tempo.day, 'Day'
18
- assert_equal 12, stub.tempo.hour, 'Hour'
19
- assert_equal 13, stub.tempo.minute, 'Minute'
20
- assert_equal 14, stub.tempo.second, 'Second'
21
- end
22
- end
23
- end