Merge pull request #2671 from akshaymohite/optimization-fixes

removed useless assignments at some places
This commit is contained in:
Régis Hanol 2014-08-19 15:27:17 +02:00
commit 567879e434
6 changed files with 5 additions and 6 deletions

View file

@ -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,

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -173,7 +173,6 @@ class User < ActiveRecord::Base
end
def change_username(new_username)
current_username = self.username
self.username = new_username
save
end

View file

@ -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