Use double quotes in config/initializers
This commit is contained in:
@@ -9,7 +9,7 @@ module ActsAsTaggableOn
|
||||
where(%{taggings.tag_id in (?) and
|
||||
(taggings.taggable_type = 'Debate' and taggings.taggable_id in (?)) or
|
||||
(taggings.taggable_type = 'Proposal' and taggings.taggable_id in (?))},
|
||||
Tag.where('kind IS NULL or kind = ?', 'category').pluck(:id),
|
||||
Tag.where("kind IS NULL or kind = ?", "category").pluck(:id),
|
||||
Debate.public_for_api.pluck(:id),
|
||||
Proposal.public_for_api.pluck(:id))
|
||||
end
|
||||
@@ -38,9 +38,9 @@ module ActsAsTaggableOn
|
||||
include Graphqlable
|
||||
|
||||
scope :public_for_api, -> do
|
||||
where('(tags.kind IS NULL or tags.kind = ?) and tags.id in (?)',
|
||||
'category',
|
||||
Tagging.public_for_api.pluck('DISTINCT taggings.tag_id'))
|
||||
where("(tags.kind IS NULL or tags.kind = ?) and tags.id in (?)",
|
||||
"category",
|
||||
Tagging.public_for_api.pluck("DISTINCT taggings.tag_id"))
|
||||
end
|
||||
|
||||
include PgSearch
|
||||
@@ -64,7 +64,7 @@ module ActsAsTaggableOn
|
||||
end
|
||||
|
||||
def recalculate_custom_counter_for(taggable_type)
|
||||
visible_taggables = taggable_type.constantize.includes(:taggings).where('taggings.taggable_type' => taggable_type, 'taggings.tag_id' => id)
|
||||
visible_taggables = taggable_type.constantize.includes(:taggings).where("taggings.taggable_type" => taggable_type, "taggings.tag_id" => id)
|
||||
|
||||
update(custom_counter_field_name_for(taggable_type) => visible_taggables.count)
|
||||
end
|
||||
@@ -74,7 +74,7 @@ module ActsAsTaggableOn
|
||||
end
|
||||
|
||||
def self.spending_proposal_tags
|
||||
ActsAsTaggableOn::Tag.where('taggings.taggable_type' => 'SpendingProposal').includes(:taggings).order(:name).uniq
|
||||
ActsAsTaggableOn::Tag.where("taggings.taggable_type" => "SpendingProposal").includes(:taggings).order(:name).uniq
|
||||
end
|
||||
|
||||
def self.graphql_field_name
|
||||
@@ -86,7 +86,7 @@ module ActsAsTaggableOn
|
||||
end
|
||||
|
||||
def self.graphql_type_name
|
||||
'Tag'
|
||||
"Tag"
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
@@ -1 +1 @@
|
||||
require 'age'
|
||||
require "age"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
# Version of your assets, change this if you want to expire all your assets.
|
||||
Rails.application.config.assets.version = '1.0'
|
||||
Rails.application.config.assets.version = "1.0"
|
||||
|
||||
# Add additional assets to the asset load path
|
||||
# Rails.application.config.assets.paths << Emoji.images_path
|
||||
|
||||
@@ -8,6 +8,6 @@ Delayed::Worker.sleep_delay = 2
|
||||
Delayed::Worker.max_attempts = 3
|
||||
Delayed::Worker.max_run_time = 1500.minutes
|
||||
Delayed::Worker.read_ahead = 10
|
||||
Delayed::Worker.default_queue_name = 'default'
|
||||
Delayed::Worker.default_queue_name = "default"
|
||||
Delayed::Worker.raise_signal_exceptions = :term
|
||||
Delayed::Worker.logger = Logger.new(File.join(Rails.root, 'log', 'delayed_job.log'))
|
||||
Delayed::Worker.logger = Logger.new(File.join(Rails.root, "log", "delayed_job.log"))
|
||||
|
||||
@@ -12,20 +12,20 @@ Devise.setup do |config|
|
||||
# Configure the e-mail address which will be shown in Devise::Mailer,
|
||||
# note that it will be overwritten if you use your own mailer class
|
||||
# with default "from" parameter.
|
||||
if Rails.env.test? || !ActiveRecord::Base.connection.table_exists?('settings')
|
||||
if Rails.env.test? || !ActiveRecord::Base.connection.table_exists?("settings")
|
||||
config.mailer_sender = "noreply@consul.dev"
|
||||
else
|
||||
config.mailer_sender = "'#{Setting['mailer_from_name']}' <#{Setting['mailer_from_address']}>"
|
||||
end
|
||||
|
||||
# Configure the class responsible to send e-mails.
|
||||
config.mailer = 'DeviseMailer'
|
||||
config.mailer = "DeviseMailer"
|
||||
|
||||
# ==> ORM configuration
|
||||
# Load and configure the ORM. Supports :active_record (default) and
|
||||
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
||||
# available as additional gems.
|
||||
require 'devise/orm/active_record'
|
||||
require "devise/orm/active_record"
|
||||
|
||||
# ==> Configuration for any authentication mechanism
|
||||
# Configure which keys are used when authenticating a user. The default is
|
||||
@@ -244,7 +244,7 @@ Devise.setup do |config|
|
||||
# up on your models and hooks.
|
||||
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
||||
config.omniauth :twitter, Rails.application.secrets.twitter_key, Rails.application.secrets.twitter_secret
|
||||
config.omniauth :facebook, Rails.application.secrets.facebook_key, Rails.application.secrets.facebook_secret, scope: 'email', info_fields: 'email,name,verified'
|
||||
config.omniauth :facebook, Rails.application.secrets.facebook_key, Rails.application.secrets.facebook_secret, scope: "email", info_fields: "email,name,verified"
|
||||
config.omniauth :google_oauth2, Rails.application.secrets.google_oauth2_key, Rails.application.secrets.google_oauth2_secret
|
||||
|
||||
# ==> Warden configuration
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
if ActiveRecord::Base.connection.tables.any?
|
||||
api_config = YAML.load_file('./config/api.yml')
|
||||
api_config = YAML.load_file("./config/api.yml")
|
||||
API_TYPE_DEFINITIONS = GraphQL::ApiTypesCreator::parse_api_config_file(api_config)
|
||||
end
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
require 'i18n/exceptions'
|
||||
require 'action_view/helpers/tag_helper'
|
||||
require "i18n/exceptions"
|
||||
require "action_view/helpers/tag_helper"
|
||||
|
||||
module ActionView
|
||||
module Helpers
|
||||
|
||||
@@ -17,5 +17,5 @@
|
||||
|
||||
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||
inflect.plural(/^(\d+)$/i, '\1')
|
||||
inflect.irregular 'organización', 'organizaciones'
|
||||
inflect.irregular "organización", "organizaciones"
|
||||
end
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
require 'rollbar/rails'
|
||||
require "rollbar/rails"
|
||||
Rollbar.configure do |config|
|
||||
# Without configuration, Rollbar is enabled in all environments.
|
||||
# To disable in specific environments, set config.enabled=false.
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
# Be sure to restart your server when you modify this file.
|
||||
|
||||
Rails.application.config.session_store :cookie_store, key: '_consul_session'
|
||||
Rails.application.config.session_store :cookie_store, key: "_consul_session"
|
||||
|
||||
@@ -13,23 +13,23 @@ ActsAsVotable::Vote.class_eval do
|
||||
end
|
||||
|
||||
def self.for_debates(debates)
|
||||
where(votable_type: 'Debate', votable_id: debates)
|
||||
where(votable_type: "Debate", votable_id: debates)
|
||||
end
|
||||
|
||||
def self.for_proposals(proposals)
|
||||
where(votable_type: 'Proposal', votable_id: proposals)
|
||||
where(votable_type: "Proposal", votable_id: proposals)
|
||||
end
|
||||
|
||||
def self.for_legislation_proposals(proposals)
|
||||
where(votable_type: 'Legislation::Proposal', votable_id: proposals)
|
||||
where(votable_type: "Legislation::Proposal", votable_id: proposals)
|
||||
end
|
||||
|
||||
def self.for_spending_proposals(spending_proposals)
|
||||
where(votable_type: 'SpendingProposal', votable_id: spending_proposals)
|
||||
where(votable_type: "SpendingProposal", votable_id: spending_proposals)
|
||||
end
|
||||
|
||||
def self.for_budget_investments(budget_investments=Budget::Investment.all)
|
||||
where(votable_type: 'Budget::Investment', votable_id: budget_investments)
|
||||
where(votable_type: "Budget::Investment", votable_id: budget_investments)
|
||||
end
|
||||
|
||||
def value
|
||||
|
||||
Reference in New Issue
Block a user