Add frozen string literal to files.

This commit is contained in:
Guo Xiang Tan 2019-05-13 10:16:50 +08:00
parent d3a5927ede
commit 546101a357
10 changed files with 20 additions and 1 deletions

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
source 'https://rubygems.org'
group :development do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ::AdPlugin
class HouseAdSettingsController < ::ApplicationController
requires_plugin AdPlugin.plugin_name

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ::AdPlugin
class HouseAdsController < ::ApplicationController
requires_plugin AdPlugin.plugin_name

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ::AdPlugin
class HouseAd
include ActiveModel::Validations

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
module ::AdPlugin
class HouseAdSetting
DEFAULTS = {

View File

@ -1,4 +1,5 @@
#!/usr/bin/env ruby
# frozen_string_literal: true
# Usage:
# bundle install

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
# name: discourse-adplugin
# about: Ad Plugin for Discourse
# version: 1.2.0

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe AdPlugin::HouseAdSetting do

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe AdPlugin::HouseAd do
@ -117,7 +119,7 @@ describe AdPlugin::HouseAd do
end
it "validates attributes" do
ad = AdPlugin::HouseAd.create({name: '', html: ''})
ad = AdPlugin::HouseAd.create(name: '', html: '')
expect(ad).to be_a(AdPlugin::HouseAd)
expect(ad).to_not be_valid
expect(ad.errors.full_messages).to be_present

View File

@ -1,3 +1,5 @@
# frozen_string_literal: true
require 'rails_helper'
describe AdPlugin::HouseAdSettingsController do