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 'active_record' | |
require 'ar_after_transaction/version' | |
module ARAfterTransaction | |
module ClassMethods | |
def self.extended( base ) | |
base.class_eval do | |
class << self | |
alias_method :transaction_without_after, :transaction | |
alias_method :transaction, :transaction_with_after |
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 'active_support/core_ext/hash/except' | |
require 'active_support/core_ext/module/introspection' | |
module ActiveModel | |
class Name | |
include Comparable | |
attr_reader :singular, :plural, :element, :collection, | |
:singular_route_key, :route_key, :param_key, :i18n_key, | |
:name |
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
def feedback(feedback, user) | |
@feedback = feedback | |
@user = user | |
@is_spam = @feedback.is_spam? | |
bcc = "alexey+feedback@curebit.com" if @is_spam | |
mail( | |
subject: (@is_spam ? "[POSSIBLE SPAM]" : "") + "Curebit Feedback from #{@feedback.email}", | |
from: @feedback.email.presence || SUPPORT_ACCOUNT, | |
to: curebit_sales_address('feedback'), | |
bcc: bcc, |
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
Value for params[:order][:discount_codes] was set to nil, because it was one of [], [null] or [null, null, ...]. Go to http://guides.rubyonrails.org/security.html#unsafe-query-generation for more information. | |
Value for params[:order][:note_attributes] was set to nil, because it was one of [], [null] or [null, null, ...]. Go to http://guides.rubyonrails.org/security.html#unsafe-query-generation for more information. | |
Value for params[:order][:tax_lines] was set to nil, because it was one of [], [null] or [null, null, ...]. Go to http://guides.rubyonrails.org/security.html#unsafe-query-generation for more information. | |
Value for params[:order][:line_items][:properties] was set to nil, because it was one of [], [null] or [null, null, ...]. Go to http://guides.rubyonrails.org/security.html#unsafe-query-generation for more information. | |
Value for params[:order][:line_items][:tax_lines] was set to nil, because it was one of [], [null] or [null, null, ...]. Go to http://guides.rubyonrails.org/security.html#unsafe-query |
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
%table.action_table.table.table-striped.table-bordered | |
%thead.header | |
%tr | |
%th{style: "width: 210px", rowspan: 2} Email Type | |
%th{style: "width: 75px", rowspan: 2} Sent | |
%th{colspan: 2} Delivered | |
%th{colspan: 2} Opened | |
%th{colspan: 2} Clicked | |
%th{colspan: 2} Complained | |
%tr |
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
Androgyny | |
Artifact Uprising | |
Classroom Friendly Supplies | |
Dinner Detective | |
FIGS | |
GoodWood NYC | |
Hired | |
Hired | |
Hired | |
Hired |
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
module ActiveSupport | |
module Testing | |
class SimpleStubs # :nodoc: | |
Stub = Struct.new(:object, :method_name, :original_method) | |
def initialize | |
@stubs = {} | |
end | |
def stub_object(object, method_name, return_value) |
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 'find' | |
namespace :db do desc "Backup the database to a file. Options: DIR=base_dir RAILS_ENV=development MAX=20" | |
task backup: [:environment] do | |
if Rails.env.production? || ENV['force_backup'] | |
ENV['backup_base'] = get_backup_base | |
backup_file = File.join(get_backup_folder, "#{Rails.env}_dump.sql.gz") | |
db_config = ActiveRecord::Base.configurations[Rails.env] |
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 SummaryGrid < CurebitDatagrid | |
attr_accessor :site, :campaigns_filter | |
include Rails.application.routes.url_helpers | |
scope { Array.new } | |
filter(:referral_status, :enum, select: Referral::STATUSES, multiple: true, | |
default: [Referral::PENDING, Referral::APPROVED], dummy: true) | |
# These are not actual filters, I'm just abusing the feature to render date pickers |
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
+-------------------------+---------------------+-----------------------------------------------------------------------------------+ | |
| 0 | 1 | 2 | | |
+-------------------------+---------------------+-----------------------------------------------------------------------------------+ | |
| DoubleSidedDealCampaign | testnosocialshare | [{:all=>nil, :clicks=>135, :clicks_unique=>103, :visits=>92, :visits_unique=>67}] | | |
| StandaloneCampaign | testnosocialshare | [{:all=>nil, :clicks=>92, :clicks_unique=>76, :visits=>26, :visits_unique=>21}] | | |
| DoubleSidedDealCampaign | testwithsocialshare | [{:all=>nil, :clicks=>188, :clicks_unique=>171, :visits=>29, :visits_unique=>25}] | | |
| StandaloneCampaign | testwithsocialshare | [{:all=>nil, :clicks=>82, :clicks_unique=>66, :visits=>28, :visits_unique=>25}] | | |
+-------------------------+---------------------+------------------------------------- |