This file contains hidden or 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 Device::SearchesController < ApplicationController | |
| ## | |
| # Search | |
| # | |
| # @example [Request] GET /search?q=name&page=2 | |
| # @example [Response] total: <count>, episodes: [<episode>, <episode>, ...] | |
| # | |
| # @overload show(q) | |
| # @param [String] q Query string |
This file contains hidden or 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
| upstream <%= @name %> { | |
| # fail_timeout=0 means we always retry an upstream even if it failed | |
| # to return a good HTTP response (in case the Unicorn master nukes a | |
| # single worker for timing out). | |
| server unix:/u/apps/<%= @name %>/shared/.sock fail_timeout=0; | |
| } | |
| server { | |
| server_name staging.club.kommersant.home; |
This file contains hidden or 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 Company < ActiveRecord::Base | |
| ACCOUNT_VARIANT = %w'A B C' | |
| include Files::Company | |
| include StateMachines::Company | |
| validates :abbr, :uniqueness => true | |
| validates :name, :presence => true | |
| validates :uri, :presence => true |
This file contains hidden or 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 W::Company < BasePresenter | |
| present ::Company | |
| include Files::Company | |
| include StateMachines::Company | |
| default_scope with_state(:published) | |
| belongs_to :country, :class_name => 'W::Geo' | |
| belongs_to :variant |
This file contains hidden or 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
| module ConfirmationHelper | |
| extend ActiveSupport::Concern | |
| include AuthHelper | |
| included do | |
| alias_method_chain :sign_out, :confirmation_request_clear | |
| end | |
| module InstanceMethods |
This file contains hidden or 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
| YaAcl::Builder.build do | |
| roles do | |
| role :admin, :name => 'Администратор' | |
| role :remote_operator, :name => 'Удаленный Оператор' | |
| role :editor, :name => 'Редактор' | |
| role :taxonom, :name => 'Таксоном' | |
| role :operator, :name => 'Оператор' | |
| role :solo_operator, :name => 'Соло Оператор' | |
| role :transcripter, :name => 'Транскриптер' | |
| role :transcripts_editor, :name => 'Редактор транскриптов' |
This file contains hidden or 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
| module AccessHelper | |
| include AuthHelper | |
| def check_access(values = {}) | |
| acl.check! self.class.to_s, self.action_name, current_roles, values | |
| end | |
| def current_roles | |
| @current_roles ||= current_user.roles_hash.keys | |
| end |
This file contains hidden or 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 FacebookService | |
| class << self | |
| def register_via_google(data) | |
| auth = User::Google.find_by_uid(data.uid) | |
| if auth | |
| return :block if auth.user.blocked? | |
| auth.user.activate! unless auth.user.active? | |
| return :success | |
| end |
This file contains hidden or 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 "errors" | |
| class GoogleService | |
| private_class_method :new | |
| class << self | |
| def register(data_hash) | |
| data = AuthData.new(data_hash) | |
| auth = User::Google.find_by_uid(data.uid) |
This file contains hidden or 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 "errors" | |
| class FacebookService | |
| class << self | |
| def register(data_hash) | |
| data = AuthData.new(data_hash) | |
| auth = User::Facebook.find_by_uid(data.uid) | |
| if auth | |
| raise UserBlockedError if auth.user.blocked? |