inline_forms 1.6.8 → 1.6.9

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.
@@ -4,14 +4,14 @@
4
4
  def info_show(object, attribute)
5
5
  # show the attribute. if it's a date/time, make it nicer. If it has a _presentation, show that instead
6
6
  o = object.send(attribute)
7
- o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + " ago )" if o.is_a?(Time)
7
+ o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + ")" if o.is_a?(Time)
8
8
  o = o._presentation if o.respond_to?(:_presentation)
9
9
  o
10
10
  end
11
11
 
12
12
  def info_edit(object, attribute)
13
13
  o = object.send(attribute)
14
- o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + " ago )" if o.is_a?(Time)
14
+ o = o.to_s + " (" + distance_of_time_in_words_to_now(o) + ")" if o.is_a?(Time)
15
15
  o = o._presentation if o.respond_to?(:_presentation)
16
16
  o
17
17
  end
@@ -20,3 +20,17 @@ def info_update(object, attribute)
20
20
  # do absolutely nothing
21
21
  end
22
22
 
23
+ module ActionView::Helpers::DateHelper
24
+
25
+ def distance_of_time_in_words_to_now_with_future(from_time, include_seconds = false)
26
+ if from_time > Time.now()
27
+ 'in ' + distance_of_time_in_words_to_now_without_future(from_time, include_seconds)
28
+ else
29
+ distance_of_time_in_words_to_now_without_future(from_time, include_seconds) + ' ago'
30
+ end
31
+ end
32
+
33
+ alias_method_chain :distance_of_time_in_words_to_now, :future
34
+
35
+ end
36
+
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module InlineForms
3
- VERSION = "1.6.8"
3
+ VERSION = "1.6.9"
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: inline_forms
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.8
4
+ version: 1.6.9
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-12-27 00:00:00.000000000 Z
12
+ date: 2013-01-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rvm