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
CSV.open('referral_update.csv', 'wb') do |csv| | |
MembershipAgreement. | |
joins(:membership_agreement_statuses). | |
where(membership_agreement_statuses: { status: 'sent', success: true }). | |
where("membership_agreements.created_at < ?", Date.new(2016, 12, 28)). | |
uniq. | |
find_each do |membership_agreement| | |
membership_agreement.all_primary_change_requests.group_by(&:location).each do |location, change_requests_by_location| | |
TenantService.switch_tenant_with_location_uuid(location.uuid) |
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
13:34:41.486 2014-10-20 17:34:41.174673+00:00 app web.2 - - [5172d7fd-f601-4e34-8c94-2677d5e3a27e] Started POST "/admin/accounting/payments/manual/cc.json" for 108.162.218.142 at 2014-10-20 17:34:41 +0000 | |
» 13:34:41.500 2014-10-20 17:34:41.197636+00:00 app web.2 - - [5172d7fd-f601-4e34-8c94-2677d5e3a27e] Processing by Admin::Accounting::ManualController#cc as JSON | |
» 13:34:41.576 2014-10-20 17:34:41.197645+00:00 app web.2 - - [5172d7fd-f601-4e34-8c94-2677d5e3a27e] Parameters: {"location_id"=>"23", "account_id"=>"8474", "payment_amount"=>"975.00"} | |
» 13:34:42.156 2014-10-20 17:34:40+00:00 app heroku-postgres - - source=HEROKU_POSTGRESQL_AMBER sample#current_transaction=20294749 sample#db_size=2191209592bytes sample#tables=46 sample#active-connections=21 sample#waiting-connections=0 sample#index-cache-hit-rate=0.99985 sample#table-cache-hit-rate=0.99483 sample#load-avg-1m=0.16 sample#load-avg-5m=0.2 sample#load-avg-15m=0.22 sample#read-iops=17.146 sample#write-iops=0.54468 sample#memory-total=1692568kB sample#mem |
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 'rails_helper' | |
RSpec.describe RestaurantsController, type: :controller do | |
let!(:restaurant){Restaurant.create(name:"TestRestaurant")} | |
context "GET index" do | |
it "should return all restaurants" do | |
get :index | |
expect(assigns(:restaurants)).to include restaurant | |
end |
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 FakeController < ActionController | |
before_action :find_fake, only: [:show, :edit, :update] | |
def index | |
@fakes = Fake.all | |
end | |
def new | |
@fake = Fake.new | |
end |
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
source 'https://rubygems.org' | |
ruby '2.1.1' | |
gem 'rails', "4.0.2" | |
gem 'turbolinks', "~> 2.2.1" | |
gem 'pg', "~> 0.17.1" | |
gem 'haml-rails', "~> 0.5.3" | |
gem "bootstrap-sass", "~> 3.1.1" |
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
<!-- / we render evnet/listing post differently than a regular post --> | |
<!-- / for event/listing posts that have comments, use commentator\'s profile --> | |
<div id=\'post_header\'> | |
Latest from NYC - Soho West | |
<\/div> | |
<!-- / we render evnet/listing post differently than a regular post --> | |
<!-- / for event/listing posts that have comments, use commentator\'s profile --> | |
<div class=\'post\' data-owning-profile-id=\'115\'> | |
<div class=\'media thumb_2x\' data-post-id=\'44208\' data-post-updated-at=\'2014-02-10 17:43:10 UTC\'> |
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 Groupable | |
has_many :group_rules, as: :grouped | |
has_many :rule_objects, through: :group_rules | |
end | |
class GroupRules | |
belongs_to :grouped, polymorphic: true | |
belongs_to :rulable, polymoprhic: true | |
end |
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
# in a standard situation, params will be passed into a Coordinate object like below: | |
{ | |
city_input: "New York", | |
state_or_country_input: "NY", | |
latitude: "40.7143528", | |
longitude: "-74.0059731", | |
neighborhood: "Tyler Run-Queens Gate", | |
city: "New York", | |
state: "New York", |
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
[9] pry(main)> info.update_attributes(params) | |
(0.1ms) BEGIN | |
Image Load (0.5ms) SELECT `assets`.* FROM `assets` WHERE `assets`.`type` IN ('Image') AND `assets`.`viewable_id` = 1 AND `assets`.`viewable_type` = 'User::Info' AND `assets`.`id` IN (4039) ORDER BY `assets`.`position` | |
(2.7ms) UPDATE `user_infos` SET `completion` = '---\n:card: false\n:statement: false\n:bio: false\n:contact_info: false\n:artworks: false\n:publish: false\n:share:\n :twitter: false\n :facebook: false\n :email: false\n :link: false\n', `updated_at` = '2013-07-19 15:24:04' WHERE `user_infos`.`id` = 1 | |
(0.6ms) UPDATE `assets` SET `remote_url` = 'https://s3.amazonaws.com/artsicle.filepicker.testing/tmp/AYRlLfbrS22r4dG7mtbH_Selection_004.png', `filepicker_url` = 'https://www.filepicker.io/api/file/Kb41uMctTeuAxdG57rE7', `attachment_file_size` = 29761, `attachment_file_name` = 'Selection_004.png', `attachment_content_type` = 'image/png' WHERE `assets`.`type` IN ('Image') AND `assets`.`id` = 4039 | |
(0.8ms) SELECT COUNT(*) FROM |
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
# test in users controller spec | |
# testing update with a guest account | |
context "updating guest account" do | |
before :each do | |
email = "[email protected]" | |
User.check_and_create_guest(email) | |
user = User.find_by_email(email) | |
controller.stub :current_user => user | |
end |
NewerOlder