date_and_time_input 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: de8ba9f80205322b6c608a3d6c438fafc5f4770c
4
+ data.tar.gz: 701744e70c61b62ed768ff5e448e17061320d6e9
5
+ SHA512:
6
+ metadata.gz: 00c54e145902a0e1913f831e1f78a6da9ed2e788aa0fdacc6868da5846dea053aaf25520f509baa7411676ea4c275888559fcbe984e3c4f1d8adf8af0ae97074
7
+ data.tar.gz: 808729ce5dc43623882bd5b8198ada1a73894cc60cff86865e09fed45a3e2b2433504af29f49dc2ed4fa67bf94621eb42b3291a2b2bcc64b3ea126eab7d6c2ca
data/.gitignore CHANGED
@@ -4,3 +4,4 @@
4
4
  TAGS
5
5
  /bin
6
6
  /.bundle
7
+ /tmp
data/LICENSE ADDED
@@ -0,0 +1,22 @@
1
+ Copyright (c) 2013 Slava Kravchenko
2
+
3
+ MIT License
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining
6
+ a copy of this software and associated documentation files (the
7
+ "Software"), to deal in the Software without restriction, including
8
+ without limitation the rights to use, copy, modify, merge, publish,
9
+ distribute, sublicense, and/or sell copies of the Software, and to
10
+ permit persons to whom the Software is furnished to do so, subject to
11
+ the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be
14
+ included in all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20
+ LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21
+ OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22
+ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -2,7 +2,7 @@ Gem::Specification.new do |gem|
2
2
  gem.name = 'date_and_time_input'
3
3
  gem.authors = ['Slava Kravchenko']
4
4
  gem.email = ['slava.kravchenko@gmail.com']
5
- gem.version = ("$Release: 0.0.1 $" =~ /[\.\d]+/) && $&
5
+ gem.version = ("$Release: 0.0.2 $" =~ /[\.\d]+/) && $&
6
6
  gem.platform = Gem::Platform::RUBY
7
7
  gem.homepage = "https://github.com/cordawyn/date_and_time_input"
8
8
  gem.summary = "Rails extension for Datetime 2-field inputs"
@@ -3,21 +3,12 @@ module ActiveRecord
3
3
  module DatetimeMultiparameterAttribute
4
4
  private
5
5
 
6
- def read_value_from_parameter(name, values_hash_from_param)
7
- klass = (self.class.reflect_on_aggregation(name.to_sym) || column_for_attribute(name)).klass
8
- if (klass == Time || klass == Datetime) && values_hash_from_param.size == 2
6
+ def read_time_parameter_value(name, values_hash_from_param)
7
+ if values_hash_from_param.size == 2
9
8
  t = Time.zone.parse("#{values_hash_from_param[1]} #{values_hash_from_param[2]}")
10
9
  if t
11
- values = {
12
- 1 => t.year,
13
- 2 => t.month,
14
- 3 => t.day,
15
- 4 => t.hour,
16
- 5 => t.min,
17
- 6 => t.sec,
18
- 7 => t.usec
19
- }
20
- read_other_parameter_value(klass, name, values)
10
+ values = [t.year, t.month, t.day, t.hour, t.min, t.sec, t.usec]
11
+ instantiate_time_object(name, values)
21
12
  else
22
13
  nil
23
14
  end
metadata CHANGED
@@ -1,38 +1,32 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: date_and_time_input
3
3
  version: !ruby/object:Gem::Version
4
- prerelease:
5
- version: 0.0.1
4
+ version: 0.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Slava Kravchenko
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-07 00:00:00.000000000 Z
11
+ date: 2013-03-09 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
- version_requirements: !ruby/object:Gem::Requirement
14
+ name: actionpack
15
+ requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ~>
18
18
  - !ruby/object:Gem::Version
19
19
  version: 3.2.0
20
- none: false
21
- name: actionpack
22
20
  type: :runtime
23
21
  prerelease: false
24
- requirement: !ruby/object:Gem::Requirement
22
+ version_requirements: !ruby/object:Gem::Requirement
25
23
  requirements:
26
24
  - - ~>
27
25
  - !ruby/object:Gem::Version
28
26
  version: 3.2.0
29
- none: false
30
- description: ! 'DateAndTimeInput is a Rails extension, providing a form input for
31
- DateTime attributes
32
-
27
+ description: |
28
+ DateAndTimeInput is a Rails extension, providing a form input for DateTime attributes
33
29
  arranged as two input fields, for date and time, respectively.
34
-
35
- '
36
30
  email:
37
31
  - slava.kravchenko@gmail.com
38
32
  executables: []
@@ -42,6 +36,7 @@ extra_rdoc_files:
42
36
  files:
43
37
  - .gitignore
44
38
  - Gemfile
39
+ - LICENSE
45
40
  - README.md
46
41
  - Rakefile
47
42
  - date_and_time_input.gemspec
@@ -53,27 +48,26 @@ files:
53
48
  homepage: https://github.com/cordawyn/date_and_time_input
54
49
  licenses:
55
50
  - The MIT License (MIT)
51
+ metadata: {}
56
52
  post_install_message:
57
53
  rdoc_options: []
58
54
  require_paths:
59
55
  - lib
60
56
  required_ruby_version: !ruby/object:Gem::Requirement
61
57
  requirements:
62
- - - ! '>='
58
+ - - '>='
63
59
  - !ruby/object:Gem::Version
64
60
  version: '0'
65
- none: false
66
61
  required_rubygems_version: !ruby/object:Gem::Requirement
67
62
  requirements:
68
- - - ! '>='
63
+ - - '>='
69
64
  - !ruby/object:Gem::Version
70
65
  version: '0'
71
- none: false
72
66
  requirements: []
73
67
  rubyforge_project:
74
- rubygems_version: 1.8.24
68
+ rubygems_version: 2.0.0.rc.2
75
69
  signing_key:
76
- specification_version: 3
70
+ specification_version: 4
77
71
  summary: Rails extension for Datetime 2-field inputs
78
72
  test_files:
79
73
  - test/action_view/helpers/date_and_time_helper_test.rb