removed useless assignments at some places

This commit is contained in:
Akshay 2014-08-19 18:10:23 +05:30
parent 7d068c1432
commit 3fd784b513
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.last_payload = unsigned_payload
sso_record.external_id = external_id sso_record.external_id = external_id
else 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_id: external_id,
external_username: username, external_username: username,
external_email: email, external_email: email,

View File

@ -99,7 +99,7 @@ InviteRedeemer = Struct.new(:invite, :username, :name) do
end end
def approve_account_if_needed def approve_account_if_needed
invited_user.approve(invite.invited_by_id, send_email=false) invited_user.approve(invite.invited_by_id, false)
end end
def notify_invitee def notify_invitee

View File

@ -8,7 +8,7 @@ class PluginStore
def self.set(plugin_name, key, value) def self.set(plugin_name, key, value)
hash = {plugin_name: plugin_name, key: key} 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) row.type_name = determine_type(value)
# nil are stored as nil # nil are stored as nil

View File

@ -151,7 +151,7 @@ class TopicEmbed < ActiveRecord::Base
def self.expanded_for(post) def self.expanded_for(post)
Rails.cache.fetch("embed-topic:#{post.topic_id}", expires_in: 10.minutes) do 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 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 << TopicEmbed.imported_from_html(url)
body body
end end

View File

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

View File

@ -69,7 +69,7 @@ class CookedPostProcessor
@doc.css("img[src^='data']") - @doc.css("img[src^='data']") -
# minus, image inside oneboxes # minus, image inside oneboxes
oneboxed_images - oneboxed_images -
# minux, images inside quotes # minus, images inside quotes
@doc.css(".quote img") @doc.css(".quote img")
end end