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 ActiveRecord | |
| class Base | |
| def self.merge_conditions(*conditions) | |
| segments = [] | |
| conditions.each do |condition| | |
| unless condition.blank? | |
| sql = sanitize_sql(condition) | |
| segments << sql unless sql.blank? | |
| 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
| -----> Heroku receiving push | |
| -----> Rails app detected | |
| -----> Detected Rails is not set to serve static_assets | |
| Installing rails3_serve_static_assets... done | |
| -----> Gemfile detected, running Bundler version 1.0.0 | |
| Unresolved dependencies detected; Installing... | |
| /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize': not in gzip format (Zlib::GzipFile::Error) | |
| from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `new' | |
| from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_input.rb:49:in `initialize' | |
| from /usr/ruby1.8.7/lib/ruby/site_ruby/1.8/rubygems/package/tar_reader.rb:63:in `each' |
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 Location < ActiveRecord::Base | |
| searchable do | |
| location :coordinates | |
| end | |
| def coordinates | |
| Sunspot::Util::Coordinates.new(self.lat,self.lng) | |
| end | |
| def coordinates=(sunspot_util_coordinates) | |
| self.lat,self.lng = [sunspot_util_coordinates.lat, sunspot_util_coordinates.lng] | |
| 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
| NoMethodError: undefined method 'coordinates' for <Sunspot::DSL::Fields:...> |
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
| Location.search {with(:coordinates).near(42.331527,-83.075953)} |
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
| rm -rf ~/.bundle/ ~/.gem/ .bundle/ Gemfile.lock | |
| bundle install |
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
| # remove the github gem pointers | |
| gem 'foo', :git => 'github.com/...' |
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(){ | |
| if ($('.resize-font').length) { | |
| $(window).resize(resize); | |
| resize(); | |
| } | |
| }); | |
| function resize() { | |
| // sizeCoefficient lets me decide how big the fonts are. | |
| // 0.75 gives about 10 words per line, which is good design |
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
| select * from add_ons | |
| inner join pricing_plans on add_ons.id = pricing_plans.add_on_id | |
| inner join subscriptions on pricing_plans.id = subscriptions.pricing_plan_id | |
| inner join people on people.id = subscriptions.person_id | |
| where people.id = 1 |
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 AddOn < ActiveRecord::Base | |
| has_many :pricing_plans, :dependent => :destroy | |
| end | |
| class PricingPlan < ActiveRecord::Base | |
| has_many :subscriptions | |
| end | |
| class Subscription < ActiveRecord::Base | |
| belongs_to :person |
OlderNewer