meta_strf 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/lib/meta_strf.rb +17 -15
  2. data/lib/meta_strf/version.rb +1 -1
  3. metadata +3 -3
@@ -1,23 +1,25 @@
1
1
  module MetaStrf
2
- module ActsAsMetaStrf
3
- extend ActiveSupport::Concern
2
+ module ActsAsMetaStrf
3
+ extend ActiveSupport::Concern
4
4
 
5
- # included do
5
+ # included do
6
6
 
7
- # end
7
+ # end
8
8
 
9
- module ClassMethods
10
- def acts_as_meta_strf(options = {})
11
- default_format = options[:default] || "%FT%T"
9
+ module ClassMethods
10
+ def acts_as_meta_strf(options = {})
11
+ default_format = options[:default] || "%FT%T"
12
12
 
13
- columns.reject{|column| column.type!=:datetime && column.type!=:date }.each do |column|
14
- define_method("#{column.name.to_s}_strf") do
15
- send(column.name).strftime( default_format )
16
- end
17
- end
18
- end
19
- end
20
- end
13
+ columns.reject{|column| column.type!=:datetime && column.type!=:date }.each do |column|
14
+ define_method("#{column.name.to_s}_strf") do
15
+ send(column.name).try(:strftime, default_format)
16
+ end
17
+ end
18
+
19
+ end
20
+ end
21
+
22
+ end
21
23
  end
22
24
 
23
25
 
@@ -1,3 +1,3 @@
1
1
  module MetaStrf
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: meta_strf
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -115,7 +115,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
115
115
  version: '0'
116
116
  segments:
117
117
  - 0
118
- hash: 4423371402922157381
118
+ hash: 2769677696836080616
119
119
  required_rubygems_version: !ruby/object:Gem::Requirement
120
120
  none: false
121
121
  requirements:
@@ -124,7 +124,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
124
  version: '0'
125
125
  segments:
126
126
  - 0
127
- hash: 4423371402922157381
127
+ hash: 2769677696836080616
128
128
  requirements: []
129
129
  rubyforge_project:
130
130
  rubygems_version: 1.8.24