will_pickdate 0.0.4 → 0.0.5

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.
@@ -1,30 +1,31 @@
1
- module PickdateHelper
2
-
3
- #FIXME: maybe use datetime_field instead of datetime_field to prevent clash with future versions of rails
4
- def datetime_field(object_name, method, options = {})
1
+ module ActionView
2
+ module Helpers
3
+ #FIXME: maybe use datetime_field instead of datetime_field to prevent clash with future versions of rails
4
+ def datetime_field(object_name, method, options = {})
5
5
  InstanceTag.new(object_name, method, self, options.delete(:object)).to_datetime_field_tag(options)
6
- end
6
+ end
7
7
 
8
- module PickdateHelperInstanceTag
9
- def to_datetime_field_tag(options = {})
10
- options = options.stringify_keys
11
- options = DEFAULT_FIELD_OPTIONS.merge(options)
8
+ module PickdateHelperInstanceTag
9
+ def to_datetime_field_tag(options = {})
10
+ options = options.stringify_keys
11
+ options = DEFAULT_FIELD_OPTIONS.merge(options)
12
12
 
13
- options["type"] = "datetime"
14
- options["value"] = options.fetch("value"){ value_before_type_cast(object).iso8601 }
15
- options["value"] &&= ERB::Util.html_escape(options["value"])
16
- add_default_name_and_id(options)
17
- tag("input", options)
13
+ options["type"] = "datetime"
14
+ options["value"] = options.fetch("value"){ value_before_type_cast(object).iso8601 }
15
+ options["value"] &&= ERB::Util.html_escape(options["value"])
16
+ add_default_name_and_id(options)
17
+ tag("input", options)
18
+ end
18
19
  end
19
- end
20
20
 
21
- class InstanceTag
22
- include PickdateHelperInstanceTag
23
- end
21
+ class InstanceTag
22
+ include PickdateHelperInstanceTag
23
+ end
24
24
 
25
- class FormBuilder
25
+ class FormBuilder
26
26
  def datetime_field(method, options = {})
27
27
  @template.datetime_select(@object_name, method, objectify_options(options))
28
28
  end
29
29
  end
30
+ end
30
31
  end
@@ -1,3 +1,3 @@
1
1
  module WillPickdate
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
data/lib/will_pickdate.rb CHANGED
@@ -1,4 +1,2 @@
1
1
  require "will_pickdate/pickdate_builder.rb"
2
- require "will_pickdate/version.rb"
3
-
4
- ActionView::Base.send :include, PickdateHelper
2
+ require "will_pickdate/version.rb"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: will_pickdate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: