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
| (rdb:1) old = Chronic.parse('yesterday at 5am') | |
| (rdb:1) Comment.all(:conditions => ['created_at > ?', old]).include? Comment.last | |
| => true | |
| (rdb:1) Comment.last.created_at > old | |
| => false |
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 Bracket < ActiveRecord::Base | |
| has_many :guesses | |
| has_many :memberships | |
| has_many :comments, :through => :memberships | |
| # Class Guess < BracketInfo | |
| named_scope :recently_updated, :include => [:comments, :guesses], :conditions => ['bracket_infos.created_at > ? OR comments.created_at > ?', Chronic.parse("Yesterday at 5 am"), Chronic.parse("Yesterday at 5 am")] | |
| # Good # Bracket.recently_updated => [...] |
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 Bracket < ActiveRecord::Base | |
| has_many :memberships | |
| has_many :comments, :through => :memberships | |
| has_many :guesses | |
| 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
| class BracketsController < ApplicationController | |
| def index | |
| yar! | |
| 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
| respond_to do |wants| | |
| wants.json do | |
| if @fold.save | |
| redirect_to :edit | |
| else | |
| render :json => false | |
| 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
| Missing template partial_path in view path |
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
| Using whenever (0.6.7) from git://github.com/DCarper/whenever.git (at master) NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01. | |
| Gem::Specification#default_executable= called from /Users/Dan/.rvm/gems/ruby-1.8.7-p334@global/specifications/bundler-1.0.11.gemspec:10. | |
| NOTE: Gem::Specification#default_executable= is deprecated with no replacement. It will be removed on or after 2011-10-01. | |
| Gem::Specification#default_executable= called from /Users/Dan/.rvm/gems/ruby-1.8.7-p334@global/specifications/rake-0.8.7.gemspec:10. | |
| /Users/Dan/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.rb:357:in `initialize': No such file or directory - /Users/Dan/.rvm/gems/ruby-1.8.7-p334@empty/bundler/gems/gems/whenever-0.6.7/bin/whenever (Errno::ENOENT) | |
| from /Users/Dan/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.rb:357:in `open' | |
| from /Users/Dan/.rvm/rubies/ruby-1.8.7-p334/lib/ruby/site_ruby/1.8/rubygems/installer.r |
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 ( confirmed() ) | |
| { do some stuff } |
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
| - owner_only do | |
| = link_to "My Control Panel", edit_bracket_path(@bracket), :title => 'Admin' |
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 prefix_template | |
| def self.default_template_name(action_name = self.action_name) | |
| if action_name | |
| action_name = action_name.to_s | |
| if action_name.include?('/') && template_path_includes_controller?(action_name) | |
| action_name = strip_out_controller(action_name) | |
| end | |
| end | |
| "admin/#{self.controller_path}/#{action_name}" | |
| end |