mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
Merge pull request #2671 from akshaymohite/optimization-fixes
removed useless assignments at some places
This commit is contained in:
commit
567879e434
6 changed files with 5 additions and 6 deletions
|
@ -92,7 +92,7 @@ class DiscourseSingleSignOn < SingleSignOn
|
|||
sso_record.last_payload = unsigned_payload
|
||||
sso_record.external_id = external_id
|
||||
else
|
||||
sso_record = user.create_single_sign_on_record(last_payload: unsigned_payload,
|
||||
user.create_single_sign_on_record(last_payload: unsigned_payload,
|
||||
external_id: external_id,
|
||||
external_username: username,
|
||||
external_email: email,
|
||||
|
|
|
@ -99,7 +99,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
|
|||
end
|
||||
|
||||
def approve_account_if_needed
|
||||
invited_user.approve(invite.invited_by_id, send_email=false)
|
||||
invited_user.approve(invite.invited_by_id, false)
|
||||
end
|
||||
|
||||
def notify_invitee
|
||||
|
|
|
@ -8,7 +8,7 @@ class PluginStore
|
|||
|
||||
def self.set(plugin_name, key, value)
|
||||
hash = {plugin_name: plugin_name, key: key}
|
||||
row = PluginStoreRow.find_by(hash) || row = PluginStoreRow.new(hash)
|
||||
row = PluginStoreRow.find_by(hash) || PluginStoreRow.new(hash)
|
||||
|
||||
row.type_name = determine_type(value)
|
||||
# nil are stored as nil
|
||||
|
|
|
@ -151,7 +151,7 @@ class TopicEmbed < ActiveRecord::Base
|
|||
def self.expanded_for(post)
|
||||
Rails.cache.fetch("embed-topic:#{post.topic_id}", expires_in: 10.minutes) do
|
||||
url = TopicEmbed.where(topic_id: post.topic_id).pluck(:embed_url).first
|
||||
title, body = TopicEmbed.find_remote(url)
|
||||
_title, body = TopicEmbed.find_remote(url)
|
||||
body << TopicEmbed.imported_from_html(url)
|
||||
body
|
||||
end
|
||||
|
|
|
@ -173,7 +173,6 @@ class User < ActiveRecord::Base
|
|||
end
|
||||
|
||||
def change_username(new_username)
|
||||
current_username = self.username
|
||||
self.username = new_username
|
||||
save
|
||||
end
|
||||
|
|
|
@ -69,7 +69,7 @@ class CookedPostProcessor
|
|||
@doc.css("img[src^='data']") -
|
||||
# minus, image inside oneboxes
|
||||
oneboxed_images -
|
||||
# minux, images inside quotes
|
||||
# minus, images inside quotes
|
||||
@doc.css(".quote img")
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in a new issue