diff options
| author | anicet | 2015-06-23 17:58:31 +0200 |
|---|---|---|
| committer | anicet | 2015-06-23 17:58:31 +0200 |
| commit | 8d416883aac459ba610d56876752c98b7b6b8969 (patch) | |
| tree | 874b44a3def8738c384a8c85137b832c9b5d6871 | |
| parent | f0e302338d5289156376273fc9cb9b30caa00568 (diff) | |
| download | chouette-core-8d416883aac459ba610d56876752c98b7b6b8969.tar.bz2 | |
ComplianceCheck : fix acces to links hash
| -rw-r--r-- | app/models/concerns/job_concern.rb | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/app/models/concerns/job_concern.rb b/app/models/concerns/job_concern.rb index b0c26baa9..5700be4c0 100644 --- a/app/models/concerns/job_concern.rb +++ b/app/models/concerns/job_concern.rb @@ -3,8 +3,8 @@ module JobConcern extend ActiveModel::Naming extend ActiveModel::Translation include ActiveModel::Model - - included do + + included do attr_reader :datas end @@ -13,9 +13,9 @@ module JobConcern def links {}.tap do |links| - datas.links.each do |link| - links[link["rel"]] = link["href"] - end + datas['links'].each do |link| + links[link["rel"]] = link["href"] + end end end @@ -32,9 +32,9 @@ module JobConcern end def cache_expiration - started? ? 10.seconds : 1.hours + started? ? 10.seconds : 1.hours end - + def id datas.id end @@ -46,16 +46,16 @@ module JobConcern def referential_name datas.referential end - + def name datas.action_parameters.name end - - def user_name + + def user_name datas.action_parameters.user_name end - - def created_at + + def created_at Time.at(datas.created.to_i / 1000) if datas.created end @@ -66,5 +66,4 @@ module JobConcern def format datas.type end - end |
