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
| namespace :archive do | |
| task :users do | |
| users.each do |user| | |
| UnsubscribeUserFromList.call(user) | |
| ArchiveUserComments.call(user) | |
| end | |
| end | |
| 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
| # Illustrate the usage of service objects named in the noun-first form. | |
| # a test user | |
| user = User.where(name: 'Oleg').first | |
| UserListSubscription.subscribe(oleg, list) | |
| # => "Oleg was added to the mailing list." | |
| UserListSubscription.unsubscribe(oleg, list) | |
| # => "Oleg was removed from the mailing list." |
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
| # Illustrate the usage of service objects named in the verb-first form. | |
| # a test user | |
| user = User.where(name: 'Oleg').first | |
| SubscribeUserToList.call(user) | |
| # => "Oleg was added to the mailing list." | |
| UnsubscribeUserFromList.call(user) | |
| # => "Oleg was removed from the mailing list." |
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
| # app/models/clubs/notification/invitation.rb | |
| module Clubs | |
| class Notification | |
| class Invitation < Clubs::Notification | |
| # snip | |
| end | |
| end | |
| end | |
| # Alternate |
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
| # app/controllers/admin/clubs/applications/invitations_controller.rb | |
| module Admin | |
| module Clubs | |
| module Applications | |
| # InvitationsController allows an application invitation to be sent, and | |
| # to trigger subsequent actions, such as setting state on the application | |
| # or sending an invitation email. | |
| class InvitationsController < Admin::ApplicationController | |
| respond_to :js | |
| before_filter :set_application |
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
| <script type="text/javascript" id="">$(function(){$(".btn.btn-large.btn-action.btn-red").click(facebookTrackingSendClick)});function facebookTrackingSendClick(c){c.preventDefault();(function(){var a=document.createElement("script");a.async=!0;a.src="//connect.facebook.net/en_US/fp.js";a.onload=function(){};var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})()};</script> | |
| <script type="text/javascript" id="">$(function(){$(".btn.btn-large.btn-action.btn-red").click(googleTrackingSendClick)});function googleTrackingSendClick(c){c.preventDefault();(function(){var a=document.createElement("script");a.async=!0;a.src="//www.googleadservices.com/pagead/conversion.js";a.onload=function(){};var b=document.getElementsByTagName("script")[0];b.parentNode.insertBefore(a,b)})()};</script> |
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
| tire.search(tire_params, load: true) do | |
| query do | |
| # Assumes +term+ is the text you're searching for | |
| string term, default_field: 'title', default_operator: 'AND' | |
| match :title, term, type: 'phrase_prefix', max_expansions: 10 | |
| end | |
| 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
| #stories_list { | |
| position: relative; | |
| min-width: 960px; | |
| li { | |
| position: relative; | |
| .item.cf { | |
| padding: 0 5px; | |
| .image { | |
| margin-top: 5px; | |
| } |
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
| $("#stories_list li").mouseenter -> | |
| expandingClone = $(this).clone() | |
| thisStory = $(this); | |
| thisStory.addClass('original_story') | |
| thisStoryWidth = thisStory.width(); | |
| thisStoryHeight = thisStory.height(); | |
| thisStoryWidthDouble = thisStory.outerWidth() * 2; |
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
| ((window, $, App, undefined_) -> | |
| App.homePage = | |
| initialize: -> | |
| # exit if we're not on the correct page | |
| return if !$(document.body).hasClass('pages-home-view') | |
| @bindElements() | |
| bindElements: -> |