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
if defined?(WillPaginate) | |
module WillPaginate | |
module ActiveRecord | |
module RelationMethods | |
alias_method :per, :per_page | |
alias_method :num_pages, :total_pages | |
alias_method :total_count, :count | |
end | |
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
# -*- coding: utf-8 -*- | |
module ApplicationHelper | |
# Public: Generates a resource's error messages as a sentence, wrapped in an | |
# alert message. | |
# | |
# resource - An ActiveModel-compliant object | |
# | |
# Examples | |
# |
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
# -*- coding: utf-8 -*- | |
module ApplicationHelper | |
# Public: Generates a resource's error messages as a sentence, wrapped in an | |
# alert message. | |
# | |
# resource - An ActiveModel-compliant object | |
# | |
# Examples | |
# |
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
<<< Query venue for venue scores, select user_ids from returned venue_scores >>> | |
1.9.3-p125 :011 > venue.venue_scores.all(:select => :user_id) | |
VenueScore Load (23.2ms) SELECT user_id FROM "venue_scores" WHERE "venue_scores"."venue_id" = 5 | |
=> [#<VenueScore user_id: 1>, #<VenueScore user_id: 2>] |
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
# Find count of users followed by current user that have submitted scores to Venue | |
def find_social_scores(venue) | |
followed_user_ids = self.follows.map { |user| | |
user.id | |
} | |
venue_score_ids = venue.venue_scores.map { |score| | |
score.user_id | |
} | |
(followed_user_ids & venue_score_ids).count | |
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
ArgumentError in Rails_admin/main#index | |
Showing /Volumes/UserData/Users/jraczak/.rvm/gems/ruby-1.9.3-p125@crowdscore/gems/rails_admin-0.0.1/app/views/rails_admin/main/index.html.haml where line #139 raised: | |
wrong number of arguments (2 for 1) | |
Extracted source (around line #139): | |
136: = paginate(@objects, :theme => 'twitter-bootstrap', :remote => true) | |
137: = link_to(t("admin.misc.show_all"), index_path(params.merge(:all => true)), :class => "show-all btn clearfix pjax") unless total_count > 100 || total_count <= @objects.to_a.size |
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
**ERROR** | |
NoMethodError in DwellingsController#create | |
undefined method `build' for nil:NilClass | |
Rails.root: /Volumes/UserData/Users/jraczak/Desktop/Everything/rails_projects/roomie | |
Application Trace | Framework Trace | Full Trace | |
app/controllers/dwellings_controller.rb:14:in `create' | |
**/ERROR** |
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 in DwellingsController#index | |
undefined method `search' for #<Class:0x0000010299cf70> |
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
def index | |
@search = Dwelling.search do | |
fulltext params[:search] | |
end | |
@dwellings = @search.results | |
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
ArgumentError in DwellingsController#index | |
You must specify at least one type to search |