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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable database encoding configuration #230

Merged
merged 1 commit into from Oct 4, 2017

Conversation

Projects
None yet
3 participants
@morygonzalez
Copy link
Member

commented Oct 1, 2017

Enables to configure database encoding. That makes it possible to use utf8mb4 with MySQL so that everybody can write their blog with emoji 馃帀

filename = File.exist?("#{Lokka.root}/database.yml") ? 'database.yml' : 'database.default.yml'
YAML.load(ERB.new(File.read("#{Lokka.root}/#{filename}")).result(binding))[self.env]['dsn']
YAML.load(ERB.new(File.read("#{Lokka.root}/#{filename}")).result(binding))[self.env]

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Oct 1, 2017

Prefer using YAML.safe_load over YAML.load.
Line is too long. [90/80]
Redundant self detected.

#
# @return [Hash] DSH (Data Source Hash) is configuration for database.
def dsh
database_config.dup.delete_if {|key, _| key == 'dsn' }

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Oct 1, 2017

Space between { and | missing.
Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@@ -27,8 +27,20 @@ def admin_theme_dir
#
# @return [String] DSN (Data Source Name) is configuration for database.
def dsn
database_config['dsn']

This comment has been minimized.

Copy link
@houndci-bot

houndci-bot Oct 1, 2017

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

@komagata

This comment has been minimized.

Copy link
Member

commented Oct 4, 2017

@morygonzalez Thank you.

@komagata komagata merged commit 4d76eba into lokka:master Oct 4, 2017

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
hound 6 violations found.

@morygonzalez morygonzalez deleted the morygonzalez:configurable-database-encoding branch Oct 4, 2017

morygonzalez pushed a commit to morygonzalez/lokka that referenced this pull request Feb 25, 2018

Merge pull request lokka#230 from morygonzalez/configurable-database-鈥
鈥ncoding

Enable database encoding configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can鈥檛 perform that action at this time.