Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Fix/issue 124 #125

Merged
merged 2 commits into from
Oct 28, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/adapters/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ def map_simple(model_field, public_field)
# @param [Symbol] public_field
# @param [String] date_format The Date format to use.
def map_date(model_field, public_field, date_format)
raise ArgumentError, "date_format cannot be nil" if date_format.nil?
Copy link
Contributor

@dazza-codes dazza-codes Oct 27, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it cannot be nil, give it a default value. Use the default that is always given when this method is called, i.e.

map_date(model_field, public_field, date_format = "%Y-%m-%dT%H:%M:%SZ")

map_from_public public_field do |value|
{model_field => time_from_public(value)}
end
Expand Down
2 changes: 2 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ class Application < Rails::Application
:request_specs => true
end

require_relative 'time_formats'

end
end
end