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 | |
STOP_WORDS = %w(a the inc incorporated corp corporated usa us) | |
include Traits::Dictionary::Core | |
# | |
# Associations | |
# | |
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
find app/ config/ lib/ populator/ public/ spec/ -type f -exec sed -i 's/JobApplication/JobOpportunity/g' {}\; | |
find app/ db/ config/ lib/ populator/ public/ spec/ -type f -exec sed -i 's/job_applications/job_opportunities/g' {} \; | |
find app/ db/ config/ lib/ populator/ public/ spec/ -type f -exec sed -i 's/job_application/job_opportunity/g' {} \; | |
find app/ config/ lib/ populator/ public/ spec/ -type f -exec sed -i 's/JobApplication/JobOpportunity/g' {} \; | |
find app/ config/ lib/ populator/ public/ spec/ -type f -exec sed -i 's/JobOpportunitys/JobOpportunities/g' {} \; |
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
# In order to not spawn suggestions on every update | |
# perform suggestion if no changes were made in time interval | |
def suggest_jobs | |
after_transaction do | |
Resque.remove_delayed(JobSuggestionWorker, self.owner_id) | |
Resque.enqueue_at(1.minutes.from_now, JobSuggestionWorker, self.owner_id) | |
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
describe '.visible' do | |
before :each do | |
@me = Factory :customer | |
@friend = Factory :customer | |
@somebody = Factory :customer | |
@commentable = Factory :job_opportunity, :owner => @me | |
@my_comment = Factory :comment, :owner => @me, :commentable => @commentable | |
@friends_comment = Factory :comment, :owner => @friend, :commentable => @commentable | |
@private_comment = Factory :comment, :owner => @friend, :commentable => @commentable, :private => true | |
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
def create_comment_notification | |
commentable.owner.comment_notifications.create!(:source => self) if commentable.owner | |
parent.owner.comment_notifications.create!(:source => self) if parent | |
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 UserNotifier < BaseNotifier | |
def registration_confirmation(user_id) | |
user = User.find(user_id) | |
subject "StartWire Authentication – Almost Ready To Rock!" | |
from "robot@#{Settings.default_domain}" | |
recipients user.email | |
sent_on Time.now | |
body "user" => user | |
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 'spec_helper' | |
describe "Discover" do | |
let(:named_scope) { | |
Group.by_char("j") | |
} | |
let(:java) { Group.create!(:name => "java") } | |
let(:json) { Group.create!(:name => "json") } |
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 'spec_helper' | |
describe "Discover" do | |
let(:named_scope) { | |
Group.by_char("j") | |
} | |
let(:java) { Group.create!(:name => "java") } | |
let(:json) { Group.create!(:name => "json") } |
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
if defined?(ActiveRecord) | |
# In order to spec ActiveRecord finders | |
# Implemented discover custom matcher | |
# | |
# :call-seq: | |
# Class.named_scope.should discover(model1, model2) | |
# Class.named_scope.should_not discover(model3, model4) | |
# | |
# matcher subject should be an instance of ActiverRecord::NamedScope::Scoped or Array |
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
$(document).ready(function() { | |
{ | |
submit: function(data) { | |
$('.js-sidebar-profile').replaceWith(data.html) | |
this.init(); | |
}, | |
init: function() { | |
$('#sidebar_profile').ajaxSubmit(this.submit); | |
} |