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
| Hi, | |
| This is Neela, recruiter from Kellton Tech Solutions (Formerly Prosoft Technology Group, Inc) | |
| We are an Information Technology and Business Consulting firm specializing in Project-based Solutions | |
| and Professional Staffing Services. I just tried reaching you today as your profile has been one of | |
| the best matches for an immediate job opportunity I have with my client. So, please have a look at | |
| the job description and let me know your interest ASAP. I would really appreciate if you could send | |
| me your most updated resume also. | |
| Please Note: |
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
| # Channel | |
| class CommentsChannel < ApplicationCable::Channel | |
| def self.broadcast_comment(comment) | |
| broadcast_to comment.message, comment: CommentsController.render( | |
| partial: 'comments/comment', locals: { comment: comment } | |
| ) | |
| end | |
| def follow(data) | |
| stop_all_streams |
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 YourApp | |
| class Application < Rails::Application | |
| # Convenience for loading config/foo.yml for the current Rails env. | |
| # | |
| # Example: | |
| # | |
| # config/cleversafe.yml: | |
| # | |
| # production: | |
| # url: http://127.0.0.1:8080 |
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
| # Original Rails controller and action | |
| class EmployeesController < ApplicationController | |
| def create | |
| @employee = Employee.new(employee_params) | |
| if @employee.save | |
| redirect_to @employee, notice: "Employee #{@employee.name} created" | |
| else | |
| render :new | |
| 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 Profile < ActiveModel::Aggregator | |
| aggregate :user | |
| aggregate :email | |
| def combine | |
| user.save | |
| user.emails.build(email_attributes).save | |
| 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
| class Customers::GridCountsController < ApplicationController | |
| def index | |
| render json: GridCountsQuery.run(params[:grid_counts]) | |
| end | |
| end | |
| class GridCountsQuery | |
| class << self | |
| def run | |
| query.each_with_object(Hash.new) do |row, grid| |
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 UserAuthenticationsController < AuthenticatedController | |
| def create | |
| if authenticate | |
| enroll_promotions | |
| redirect_to return_path | |
| else | |
| redirect_to back_path, error: authentication_error_message | |
| 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
| # Option A: I'd start with this | |
| class Micropost < ActiveRecord::Base | |
| validate :no_profanity | |
| private | |
| def no_profanity | |
| if user.minor? && profanity = profane_words_used_in_content | |
| errors.add :content, "Profanity: '#{profanity.join(", ")}' not allowed!" | |
| 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
| class TimeEntriesController < ApplicationController | |
| before_action :set_project, :set_issue | |
| def create | |
| @time_entry = container.time_entries.build time_entry_params.merge(user: User.current) | |
| if @time_entry.save | |
| respond_to do |format| | |
| format.html { redirect_back_or_default created_time_entry_url, notice: l(:notice_successful_create) } | |
| format.api { render :show, status: :created, location: @time_entry } |
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
| # config/routes.rb | |
| resources :documents do | |
| scope module: 'documents' do | |
| resources :versions do | |
| post :restore, on: :member | |
| end | |
| resource :lock | |
| end | |
| end |