inline_forms 1.6.8 → 1.6.9
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app/helpers/form_elements/info.rb +16 -2
- data/lib/inline_forms/version.rb +1 -1
- metadata +2 -2
@@ -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) + "
|
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) + "
|
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
|
+
|
data/lib/inline_forms/version.rb
CHANGED
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.
|
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:
|
12
|
+
date: 2013-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rvm
|