eac_rails_utils 0.11.3 → 0.12.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/helpers/eac_rails_utils/common_form_helper.rb +6 -2
- data/app/helpers/eac_rails_utils/common_form_helper/form_builder.rb +3 -3
- data/config/initializers/assets.rb +6 -0
- data/lib/assets/images/sort_asc.png +0 -0
- data/lib/assets/images/sort_asc_disabled.png +0 -0
- data/lib/assets/images/sort_both.png +0 -0
- data/lib/assets/images/sort_desc.png +0 -0
- data/lib/assets/images/sort_desc_disabled.png +0 -0
- data/lib/assets/javascripts/dataTables.bootstrap.min.js +14 -0
- data/lib/assets/javascripts/datatables.min.js +212 -0
- data/lib/assets/javascripts/eac_rails_utils.js +2 -1
- data/lib/assets/stylesheets/dataTables.bootstrap.min.css +1 -0
- data/lib/assets/stylesheets/datatables.min.css +13 -0
- data/lib/assets/stylesheets/eac_rails_utils.scss +2 -1
- data/lib/eac_rails_utils/models/tableless.rb +10 -0
- data/lib/eac_rails_utils/models/validations.rb +71 -0
- data/lib/eac_rails_utils/patches/active_model_associations.rb +2 -0
- data/lib/eac_rails_utils/version.rb +1 -1
- data/test/dummy/app/assets/config/manifest.js +3 -0
- data/test/dummy/app/models/user.rb +0 -4
- data/test/dummy/bin/rails +6 -0
- data/test/dummy/config/application.rb +1 -1
- data/test/dummy/db/migrate/20160415125333_create_users.rb +3 -1
- data/test/dummy/db/migrate/20160415143123_create_jobs.rb +3 -1
- data/test/dummy/db/migrate/20160415143229_add_job_to_users.rb +3 -1
- metadata +34 -21
- data/lib/assets/javascripts/jquery.dataTables.min.js +0 -164
- data/lib/assets/stylesheets/jquery.dataTables.min.css +0 -1
- data/lib/eac_rails_utils/models/attribute_required.rb +0 -43
- data/test/helpers/eac_rails_utils/common_form_helper_test.rb +0 -33
- data/test/lib/eac_rails_utils/models/attribute_required_test.rb +0 -42
- data/test/lib/eac_rails_utils/models/tableless_test.rb +0 -25
@@ -1,25 +0,0 @@
|
|
1
|
-
# frozen_string_literal: true
|
2
|
-
|
3
|
-
require 'test_helper'
|
4
|
-
|
5
|
-
module EacRailsUtils
|
6
|
-
module Models
|
7
|
-
class TablelessTest < ActiveSupport::TestCase
|
8
|
-
class Stub < ::EacRailsUtils::Models::Tableless
|
9
|
-
attribute :tempo, DateTime
|
10
|
-
end
|
11
|
-
|
12
|
-
test 'date time array values' do
|
13
|
-
stub = Stub.new('tempo(1i)' => '9', 'tempo(2i)' => '10', 'tempo(3i)' => '11',
|
14
|
-
'tempo(4i)' => '12', 'tempo(5i)' => '13', 'tempo(6i)' => '14')
|
15
|
-
assert stub.tempo.is_a?(DateTime), "Class: |#{stub.tempo.class}|, Value: |#{stub.tempo}|"
|
16
|
-
assert_equal 9, stub.tempo.year, 'Year'
|
17
|
-
assert_equal 10, stub.tempo.month, 'Month'
|
18
|
-
assert_equal 11, stub.tempo.day, 'Day'
|
19
|
-
assert_equal 12, stub.tempo.hour, 'Hour'
|
20
|
-
assert_equal 13, stub.tempo.minute, 'Minute'
|
21
|
-
assert_equal 14, stub.tempo.second, 'Second'
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|