Skip to content

Instantly share code, notes, and snippets.

@marcusleemitchell
Created November 13, 2013 14:09
Show Gist options
  • Save marcusleemitchell/7449709 to your computer and use it in GitHub Desktop.
Save marcusleemitchell/7449709 to your computer and use it in GitHub Desktop.
update_without_callbacks master list
Searching 8501 files for "update_without_callbacks" (regex)
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/booking.rb:
687 settings[:five_days_checkin_sms_sent] = false
688 settings[:checkin_day_sms_sent] = false
689: self.send(:update_without_callbacks) if force
690 end
691 end
...
902 if booking_reference.blank?
903 self.booking_reference = id
904: send :update_without_callbacks
905 end
906 end
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/initial_payment.rb:
87 booking.total_earnings = total_earnings
88 booking.send(:move_payment_dates_to_next_valid) # needed to get a user_2.feature:99 working
89: booking.send :update_without_callbacks
90 end
91
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/user.rb:
713 if override || self.next_host_nps_survey_date.nil?
714 self.next_host_nps_survey_date = next_survey_date
715: self.send(:update_without_callbacks)
716 end
717 end
...
727 if employee? and role_name != 'admin'
728 self.role_name = 'admin'
729: send(:update_without_callbacks)
730 end
731 end
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/booking/messaging_trait.rb:
129 if confirmed?
130 create_message
131: update_without_callbacks
132 end
133 end
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/property/calendar_trait.rb:
124 self.requested_bookings_count = all_bookings.requested.count
125 self.number_of_past_guests = all_bookings.accepted.past.sum(:number_of_guests)
126: send :update_without_callbacks
127 end
128
...
141 return if frozen?
142 self.cheapest_availability_per_week = Rate.cheapest_price_over_consecutive_days(self, 7)
143: send :update_without_callbacks unless frozen?
144 end
145
...
148 self.cheapest_availability_per_night_over_range = Rate.cheapest_price_occurring_at_least(self, 7, 183)
149 self.cheapest_availability_per_night_over_range = self.cheapest_availability if !self.cheapest_availability_per_night_over_range && self.cheapest_availability
150: send :update_without_callbacks unless frozen?
151 end
152
...
154 return if frozen?
155 self.cheapest_availability_per_month = Rate.cheapest_price_over_consecutive_days(self, 30)
156: send :update_without_callbacks unless frozen?
157 end
158
/Users/mmitchell/Projects/HouseTrip-Web-App/app/models/property/search_trait.rb:
11 without_timestamping_of Property do
12 update_search_fields
13: update_without_callbacks
14 end
15 end
/Users/mmitchell/Projects/HouseTrip-Web-App/db/migration_specs/set_correct_property_id_on_booking_offer_messages_spec.rb:
42 # Let's break some stuff
43 message_1.property_id = 5
44: message_1.send :update_without_callbacks
45 message_2.property_id = 17
46: message_2.send :update_without_callbacks
47 sender_conversation_1.property_id = 1337
48: sender_conversation_1.send :update_without_callbacks
49 recipient_conversation_2.property_id = 2342
50: recipient_conversation_2.send :update_without_callbacks
51
52 # Add another message to this conversation (we don't want it to be updated):
/Users/mmitchell/Projects/HouseTrip-Web-App/features/step_definitions/payment_steps.rb:
143 Given /^the property has a legacy paypal account with the email "([^\"]+)"$/ do |email|
144 paypal_account = PaypalAccount.new PaypalAccount.plan(:email => email, :validate_address_present => false, :address => '', :city => '', :country => '')
145: paypal_account.send(:update_without_callbacks)
146 Property.last.update_attribute :payment_method_selection, :paypal_account
147 end
/Users/mmitchell/Projects/HouseTrip-Web-App/features/step_definitions/payment_steps.rb.orig:
154 Given /^the property has a legacy paypal account with the email "([^\"]+)"$/ do |email|
155 paypal_account = PaypalAccount.new PaypalAccount.plan(:email => email, :validate_address_present => false, :address => '', :city => '', :country => '')
156: paypal_account.send(:update_without_callbacks)
157 Property.last.update_attribute :payment_method_selection, :paypal_account
158 end
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/geo/boroughs/assign_properties_borough.rb:
58 # Not running callbacks to speed the script
59 property.borough_id = borough.id
60: property.send(:update_without_callbacks)
61
62 # Update rates
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/geo/regions/fix_malta_regions.rb:
10 destination_location.send("region_name_#{locale}=", to_region.send("name_#{locale}"))
11 end
12: destination_location.send(:update_without_callbacks)
13
14 Property.update_all({ :region_id => to_region.id }, { :destination_id => destination_location.id })
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/geo/regions/other_region_fixer.rb:
36 destination_location.region_name_fr = to_region.name_fr
37 destination_location.region_name_de = to_region.name_de
38: destination_location.send(:update_without_callbacks)
39
40 Property.update_all({ :region_id => to_region.id }, { :destination_id => destination_location.id })
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/geo/regions/region_code_check_and_fix.rb:
24 destination_location.region_name_de = to_region.name_de
25 destination_location.adm_code = to_region.adm_code if to_region.adm_code.present?
26: destination_location.send(:update_without_callbacks)
27
28 Property.update_all({ :region_id => to_region.id }, { :destination_id => destination_location.id })
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/languages/update_destination_names.rb:
34 slugs["slug_name_#{locale}"] = new_name unless c.send("best_#{locale}_slug").present?
35 end
36: if c.send(:update_without_callbacks)
37 c.update_slugs!(slugs, false)
38 end
..
52 slugs["slug_name_#{locale}"] = new_name unless c.send("best_#{locale}_slug").present?
53 end
54: if c.send(:update_without_callbacks)
55 c.update_slugs!(slugs, false)
56 end
..
85 slugs["slug_name_#{locale}"] = new_name unless l.send("best_#{locale}_slug").present?
86 end
87: l.send(:update_without_callbacks)
88 l.update_slugs!(slugs, false)
89 end
..
105 slugs["slug_name_#{locale}"] = new_name unless r.send("best_#{locale}_slug").present?
106 end
107: if r.send(:update_without_callbacks)
108 r.update_slugs!(slugs, false)
109 end
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/destination_aldeburgh_region_fixer.rb:
32 destination_location.region_name_fr = to_region.name_fr
33 destination_location.region_name_de = to_region.name_de
34: destination_location.send(:update_without_callbacks)
35
36 Property.update_all({ :region_id => to_region.id }, { :destination_id => destination_location.id })
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/fill_published_at_for_published_properties.rb:
34 # Set published at
35 property.published_at = timestamp
36: property.send(:update_without_callbacks)
37
38 # Create the publish history
..
58
59 property.published_at = publish_story.created_at.advance(:minutes => 1)
60: property.send(:update_without_callbacks)
61 else
62 # This case means an unpublish story is
..
75
76 property.published_at = timestamp
77: property.send(:update_without_callbacks)
78
79 # Create the publish history
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/find_invalid_user_emails.rb:
48 u.email = fix[:new_email]
49 if u.valid?
50: u.send(:update_without_callbacks)
51 else
52 puts "COULD NOT SAVE USER #{u.id} with new better email"
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/greater_london_fixer.rb:
11 destination_location.region_name_fr = to_region.name_fr
12 destination_location.region_name_de = to_region.name_de
13: destination_location.send(:update_without_callbacks)
14
15 Property.update_all({ :region_id => to_region.id }, { :destination_id => destination_location.id })
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/populate_booking_ids_in_reviews.rb:
46 nr_reviews_with_1_property_booking += 1
47 review.booking_id = bookings.first.id
48: review.send(:update_without_callbacks)
49 else
50 # Requires iteration through the bookings
..
57 nr_reviews_with_n_property_bookings_guessed_correctly += 1
58 review.booking_id = booking.id
59: review.send(:update_without_callbacks)
60 else
61 nr_reviews_with_n_property_bookings_which_dont_match += 1
/Users/mmitchell/Projects/HouseTrip-Web-App/lib/scripts/create_historic_messages/historic_message_creator.rb:
85 booking.send(:create_message)
86 booking.status = booking.status_was
87: booking.send(:update_without_callbacks)
88 end
89 end
90 Timecop.freeze(updated_was + 1) do #requests need to be older
91 booking.send(:create_message)
92: booking.send(:update_without_callbacks)
93 end
94 end
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/maintenance/src/stylesheets/_mixins.sass
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/maintenance/src/stylesheets/_reset.sass
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/maintenance/src/stylesheets/_variables.sass
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/upload_all.js
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/javascripts/legacy_all.js
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/javascripts/upload_all.js
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/stylesheets/fonts
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/stylesheets/legacy.css
Unable to open /Users/mmitchell/Projects/HouseTrip-Web-App/public/legacy/stylesheets/legacy_for_ie.css
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/lib/ht/errands/destination_property_count_updater_spec.rb:
7 property = Property.make!(attributes)
8 property.attributes = {:listable => true, :cheapest_availability => 1}
9: property.send(:update_without_callbacks)
10 property
11 end
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/mailers/exact_target/opportunities_recap_mailer_spec.rb:
19 # @property = Property.make :user => @user
20 # @property.listable = true
21: # @property.send :update_without_callbacks
22 # Photo.create! :owner => @property, :uploader => @user, :title => 'b',
23 # :image => fixture_file('property-photo.jpg'), :default_photo => true
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/booking_spec.rb:
463 it 'should save without running any callbacks' do
464 subject.stub :id => 23
465: subject.should_receive :update_without_callbacks
466 subject.send :set_booking_reference
467 end
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/initial_payment_spec.rb:
381 booking.stub(:accepted? => true)
382 booking.should_receive(:send).with(:set_payment_dates_from_owner)
383: booking.should_receive(:send).with(:update_without_callbacks)
384 subject.stub(:booking).and_return booking
385 subject.update_booking_amounts
...
393 subject.stub(:booking).and_return booking
394 subject.should_receive(:total_earnings).and_return 100
395: booking.should_receive(:send).with(:update_without_callbacks)
396 subject.commission_amount = 10
397 subject.run_callbacks(:after_update)
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/user_spec.rb:
391 it 'should ignore other bookings' do
392 @booking1.host = User.make
393: @booking1.send(:update_without_callbacks)
394 @user.update_guests_count!
395 @user.guests_count.should == 5
...
398 it 'should ignore unaccepted bookings' do
399 @booking2.status = 'denied'
400: @booking2.send(:update_without_callbacks)
401 @user.update_guests_count!
402 @user.guests_count.should == 20
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/booking/rebooking_methods_spec.rb:
442 booking2.stub(:rebooked_booking => booking1, :total_cancellation_amount_for_guest_calculation => 50.3, :total_amount_guest_pays => 200.3)
443 booking3.initial_payment.attributes = initial_payment_attr
444: booking3.initial_payment.send :update_without_callbacks
445 booking3.payments << payment2
446 booking3.payments << payment3
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/data_extracts/accounting_table_spec.rb:
72
73 [@booking1, @booking2, @booking3].each do |booking|
74: booking.send :update_without_callbacks
75 end
76 end
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/models/property_search/filtering_spec.rb:
326 property.cheapest_availability = 30
327 property.cheapest_availability_per_night_over_range = 30
328: property.send(:update_without_callbacks)
329 property2 = Property.make!(:currency_code => 'GBP')
330 property2.cheapest_availability = 60
331 property2.cheapest_availability_per_night_over_range = 60
332: property2.send(:update_without_callbacks)
333 subject.price_ranges = [ PropertySearch::PriceRange.parse('34-') ]
334 subject.search.should == []
...
340 property.cheapest_availability = 30
341 property.cheapest_availability_per_night_over_range = 30
342: property.send(:update_without_callbacks)
343 property2 = Property.make!(:currency_code => 'GBP')
344 property2.cheapest_availability = 60
345 property2.cheapest_availability_per_night_over_range = 60
346: property2.send(:update_without_callbacks)
347 subject.price_ranges = [ PropertySearch::PriceRange.parse('32-34') ]
348 subject.search.collect(&:id).should =~ [property, property2].collect(&:id)
...
354 property.cheapest_availability = 30
355 property.cheapest_availability_per_night_over_range = 30
356: property.send(:update_without_callbacks)
357 property2 = Property.make!(:currency_code => 'GBP')
358 property2.cheapest_availability = 60
359 property2.cheapest_availability_per_night_over_range = 60
360: property2.send(:update_without_callbacks)
361 subject.price_ranges = [ PropertySearch::PriceRange.parse('-32') ]
362 subject.search.should == []
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/presenters/landing_page_presenters/informal_region_spec.rb:
43 [property_in_region1, property_in_region2].each do |property|
44 property.cheapest_availability = 10
45: property.send(:update_without_callbacks)
46 end
47
..
64 property.cheapest_availability = 10
65 property.listable = true
66: property.send(:update_without_callbacks)
67
68 # Bug happens somewhere and sets
/Users/mmitchell/Projects/HouseTrip-Web-App/spec/presenters/landing_page_presenters/region_spec.rb:
79 [property_in_region1, property_in_region2].each do |property|
80 property.cheapest_availability = 10
81: property.send(:update_without_callbacks)
82 end
83
53 matches across 30 files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment