Skip to content

Commit

Permalink
Handle nil values for empty lists
Browse files Browse the repository at this point in the history
  • Loading branch information
alvinypyim committed Nov 7, 2016
1 parent fcba4f0 commit 0796bb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ All notable changes to this project will be documented in this file.
This project adheres to [Semantic Versioning](http://semver.org/).
This changelog adheres to [Keep a CHANGELOG](http://keepachangelog.com/).

## [2.4.1]
### Changed
- Handle nil values for empty lists

## [2.4.0]
### Changed
- Improve error handling when non JSON response
Expand Down
2 changes: 1 addition & 1 deletion lib/quick_travel/adapter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def self.has_many(relation_name, options = {})
"@#{relation_name}",
begin
klass = QuickTravel.const_get(options[:class_name] || relation_name.to_s.singularize.classify)
instance_variable_get("@#{relation_name}_attributes").map { |attr|
Array(instance_variable_get("@#{relation_name}_attributes")).map { |attr|
klass.new(attr)
}
end
Expand Down

0 comments on commit 0796bb9

Please sign in to comment.