will_pickdate 0.0.5 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,31 +1,28 @@
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
- InstanceTag.new(object_name, method, self, options.delete(:object)).to_datetime_field_tag(options)
6
- end
1
+ module PickdateHelper
2
+ def datetime_field(object_name, method, options = {})
3
+ InstanceTag.new(object_name, method, self, options.delete(:object)).to_datetime_field_tag(options)
4
+ end
5
+ end
7
6
 
8
- module PickdateHelperInstanceTag
9
- def to_datetime_field_tag(options = {})
10
- options = options.stringify_keys
11
- options = DEFAULT_FIELD_OPTIONS.merge(options)
7
+ module PickdateHelperInstanceTag
8
+ def to_datetime_field_tag(options = {})
9
+ options = options.stringify_keys
10
+ options = DEFAULT_FIELD_OPTIONS.merge(options)
12
11
 
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
19
- end
12
+ options["type"] = "datetime"
13
+ options["value"] = options.fetch("value"){ value_before_type_cast(object).iso8601 }
14
+ options["value"] &&= ERB::Util.html_escape(options["value"])
15
+ add_default_name_and_id(options)
16
+ tag("input", options)
17
+ end
18
+ end
20
19
 
21
- class InstanceTag
22
- include PickdateHelperInstanceTag
23
- end
20
+ class ActionView::Helpers::InstanceTag
21
+ include PickdateHelperInstanceTag
22
+ end
24
23
 
25
- class FormBuilder
26
- def datetime_field(method, options = {})
27
- @template.datetime_select(@object_name, method, objectify_options(options))
28
- end
29
- end
24
+ class ActionView::Helpers::FormBuilder
25
+ def datetime_field(method, options = {})
26
+ @template.datetime_select(@object_name, method, objectify_options(options))
30
27
  end
31
28
  end
@@ -1,3 +1,3 @@
1
1
  module WillPickdate
2
- VERSION = "0.0.5"
2
+ VERSION = "0.0.7"
3
3
  end
data/lib/will_pickdate.rb CHANGED
@@ -1,2 +1,4 @@
1
1
  require "will_pickdate/pickdate_builder.rb"
2
- require "will_pickdate/version.rb"
2
+ require "will_pickdate/version.rb"
3
+
4
+ ActionView::Base.send :include, PickdateHelper
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.5
4
+ version: 0.0.7
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: