This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
window.BrowserTZone ||= {} | |
BrowserTZone.setCookie = -> | |
$.cookie "browser.timezone", jstz.determine().name(), { expires: 365, path: '/' } | |
jQuery -> | |
BrowserTZone.setCookie() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
around_filter :set_time_zone | |
private | |
def set_time_zone | |
old_time_zone = Time.zone | |
Time.zone = browser_timezone if browser_timezone.present? | |
yield | |
ensure | |
Time.zone = old_time_zone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class BuildingTrafficController < ApplicationController | |
def show | |
format.html{ render :show} | |
format.json do | |
Jobs::DashboardQueriesJob.perform_async dashboard_params | |
render json: :success | |
end | |
end | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Viewthespace.BuildingTrafficDashboard | |
constructor: (pusherKey, uniqueUserId) -> | |
pusher = new Pusher pusherKey | |
channel = pusher.subscribe "dashboard_results_#{uniqueUserId}" | |
dashboard = @ | |
channel.bind 'top_traffic_sources', (trafficSources) -> | |
dashboard.refreshTopTrafficSources trafficSources |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'webrick/https' | |
require 'rack/handler/webrick' | |
def run_ssl_server(app, port) | |
opts = { | |
:Port => port, | |
:SSLEnable => true, | |
:SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE, | |
:SSLPrivateKey => OpenSSL::PKey::RSA.new("./spec/support/server.key"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Capybara.server_port = 3001 | |
Capybara.app_host = "https://localhost:%d" % Capybara.server_port |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#For selenium | |
Capybara.register_driver :selenium do |app| | |
profile = Selenium::WebDriver::Firefox::Profile.new | |
profile.secure_ssl = false | |
profile.assume_untrusted_certificate_issuer = false | |
Capybara::Selenium::Driver.new(app, :browser => :firefox, profile: profile) | |
end | |
#For capybara-webkit: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyPortfoliosController < ApplicationController | |
before_filter :authenticate_user! | |
def show | |
@portfolio_properties = my_portfolio_filter.filtered_properties | |
.includes(:city, :submarket, :photos, :videos, :spaces) | |
.page(page) | |
.per(10) | |
.decorate |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- content_for :title, "My Portfolio - VTS" | |
= cache [ "v2", 'my_portfolio', current_user.all_properties_cache_key, current_user.all_spaces_cache_key ] do | |
.my_portfolio#main | |
= render partial: 'search_filters' | |
= render partial: 'multishare_bar' | |
#search-results | |
= render partial: 'search_results' | |
#footer-links |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(15.0ms) SELECT "spaces"."property_id" FROM "spaces" INNER JOIN "properties" ON "properties"."id" = "spaces"."property_id" LEFT OUTER JOIN "user_properties" ON "user_properties"."property_id" = "properties"."id" LEFT OUTER JOIN "user_spaces" ON "user_spaces"."space_id" = "spaces"."id" WHERE ((user_spaces.user_id = 2023 and spaces.lease_type = 'sublease') or (user_properties.user_id = 2023 and spaces.lease_type = 'direct')) AND (spaces.status!='removed') ORDER BY "spaces"."status", "spaces"."id" | |
Property Load (9.3ms) SELECT distinct properties.* FROM "properties" LEFT OUTER JOIN "user_properties" ON "user_properties"."property_id" = "properties"."id" LEFT OUTER JOIN "spaces" ON "spaces"."property_id" = "properties"."id" AND spaces.status != 'removed' LEFT OUTER JOIN "user_spaces" ON "user_spaces"."space_id" = "spaces"."id" WHERE "properties"."id" IN (142, 143, 207, 208, 214, 304, 297, 305, 349, 351, 352, 353, 453, 454, 456, 457, 459, 461, 482, 483, 490, 508, 534, 536, 567, 596, 597, 598, 622, 621, 665, 67 |