Skip to content

Commit

Permalink
Make Model Properties public so integrating sites can use them for fi…
Browse files Browse the repository at this point in the history
…lters rather than using magic strings
  • Loading branch information
0xTim committed Aug 2, 2017
1 parent 67d1f73 commit c9c458e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 30 deletions.
32 changes: 16 additions & 16 deletions Sources/SteamPress/Models/BlogPost.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,22 +7,22 @@ import FluentProvider
public final class BlogPost: Model {

public struct Properties {
static let id = "id"
static let title = "title"
static let contents = "contents"
static let slugUrl = "slug_url"
static let published = "published"
static let created = "created"
static let lastEdited = "last_edited"
static let authorName = "author_name"
static let authorUsername = "author_username"
static let createdDate = "created_date"
static let createdDateIso8601 = "created_date_iso8601"
static let lastEditedDate = "last_edited_date"
static let lastEditedDateIso8601 = "last_edited_date_iso8601"
static let shortSnippet = "short_snippet"
static let longSnippet = "long_snippet"
static let tags = "tags"
public static let id = "id"
public static let title = "title"
public static let contents = "contents"
public static let slugUrl = "slug_url"
public static let published = "published"
public static let created = "created"
public static let lastEdited = "last_edited"
public static let authorName = "author_name"
public static let authorUsername = "author_username"
public static let createdDate = "created_date"
public static let createdDateIso8601 = "created_date_iso8601"
public static let lastEditedDate = "last_edited_date"
public static let lastEditedDateIso8601 = "last_edited_date_iso8601"
public static let shortSnippet = "short_snippet"
public static let longSnippet = "long_snippet"
public static let tags = "tags"
}

static var postsPerPage = 10
Expand Down
8 changes: 4 additions & 4 deletions Sources/SteamPress/Models/BlogTag.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import FluentProvider
public final class BlogTag: Model {

public struct Properties {
static let id = "id"
static let name = "name"
static let urlEncodedName = "url_encoded_name"
static let postCount = "post_count"
public static let id = "id"
public static let name = "name"
public static let urlEncodedName = "url_encoded_name"
public static let postCount = "post_count"
}

public let storage = Storage()
Expand Down
20 changes: 10 additions & 10 deletions Sources/SteamPress/Models/BlogUser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ import Foundation
public final class BlogUser: Model {

public struct Properties {
static let id = "id"
static let name = "name"
static let username = "username"
static let password = "password"
static let resetPasswordRequired = "reset_password_required"
static let profilePicture = "profile_picture"
static let twitterHandle = "twitter_handle"
static let biography = "biography"
static let tagline = "tagline"
static let postCount = "post_count"
public static let id = "id"
public static let name = "name"
public static let username = "username"
public static let password = "password"
public static let resetPasswordRequired = "reset_password_required"
public static let profilePicture = "profile_picture"
public static let twitterHandle = "twitter_handle"
public static let biography = "biography"
public static let tagline = "tagline"
public static let postCount = "post_count"
}

public let storage = Storage()
Expand Down

0 comments on commit c9c458e

Please sign in to comment.