Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use baseReference when String path is empty #19 #20

Merged
merged 3 commits into from
May 13, 2017
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 33 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# CHANGELOG
All notable changes to this project will be documented in this file.
`Nora` adheres to [Semantic Versioning](http://semver.org/).

---

## Versions

---

### Next Version

### API Breaking Changes
N/A

### Enhancements
N/A

### Bugfixes
N/A

---

### [0.1.1](https://github.com/SD10/Nora/releases/tag/0.1.0)

### Bugfixes
- Empty `String` path for `DatabaseTarget` & `StorageTarget` now uses `baseReference`. [#20](https://github.com/SD10/Nora/pull/20) by [@SD10](https://github.com/SD10)

---

### [0.1.0 Pre-Release](https://github.com/SD10/Nora/releases/tag/0.1.0)
- Initial Release

12 changes: 10 additions & 2 deletions Nora.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@
isa = PBXGroup;
children = (
B062C7091E947363006C3CB8 /* Sources */,
B062C6D31E946B59006C3CB8 /* Info.plist */,
B062C6D21E946B59006C3CB8 /* Nora.h */,
B0FF35661EC6E7C8005C5F62 /* Supporting */,
);
path = Nora;
sourceTree = "<group>";
Expand All @@ -145,6 +144,15 @@
name = Sources;
sourceTree = "<group>";
};
B0FF35661EC6E7C8005C5F62 /* Supporting */ = {
isa = PBXGroup;
children = (
B062C6D31E946B59006C3CB8 /* Info.plist */,
B062C6D21E946B59006C3CB8 /* Nora.h */,
);
name = Supporting;
sourceTree = "<group>";
};
FCE6F04A38E4E8B62D9181C9 /* Frameworks */ = {
isa = PBXGroup;
children = (
Expand Down
4 changes: 2 additions & 2 deletions Nora/DatabaseRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ struct DatabaseRequest {
extension DatabaseRequest {

init(_ target: DatabaseTarget) {
self.reference = target.baseReference.child(target.path)
self.reference = target.path == "" ? target.baseReference : target.baseReference.child(target.path)
self.task = target.task
self.transactionBlock = target.transactionBlock
self.onDisconnect = target.onDisconnect
Expand All @@ -44,7 +44,7 @@ struct DatabaseQueryRequest {
extension DatabaseQueryRequest {

init(_ target: DatabaseTarget) {
let reference = target.baseReference.child(target.path)
let reference = target.path == "" ? target.baseReference : target.baseReference.child(target.path)
self.query = target.queries?.reduce(reference) { $1.prepare($0) } ?? reference
self.task = target.task
}
Expand Down
2 changes: 1 addition & 1 deletion Nora/StorageRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct StorageRequest {
extension StorageRequest {

init(_ target: StorageTarget) {
self.reference = target.baseReference.child(target.path)
self.reference = target.path == "" ? target.baseReference : target.baseReference.child(target.path)
self.task = target.task
}

Expand Down
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
</p>

<p align="center">
<a href="https://codebeat.co/projects/github-com-sd10-nora-master">
<img src="https://codebeat.co/badges/222038d6-dd5d-4253-94a6-63f00d3a1ae9"
alt="codebeat badge">
</a>
<a href="https://travis-ci.org/SD10/Nora">
<img src="https://travis-ci.org/SD10/Nora.svg?branch=master"
alt="Build Status">
Expand Down