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 CreateProducts < ActiveRecord::Migration | |
def self.up | |
create_table :products do |t| | |
t.string :title | |
t.text :description | |
t.string :image_url | |
t.decimal :price, :precision => 8, :scale => 2 | |
t.timestamps | |
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
Started GET "/clients/5" for 127.0.0.1 at 2011-06-19 22:02:54 -0500 | |
Processing by ClientsController#show as HTML | |
Parameters: {"id"=>"5"} | |
... | |
Completed 200 OK in 495ms (Views: 401.1ms | ActiveRecord: 2.0ms) | |
Started GET "/assets/application.js" for 127.0.0.1 at 2011-06-19 22:02:55 -0500 | |
Compiled ~/Sites/invoicey/app/assets/javascripts/application.js (3ms) (pid 2725) | |
Compiled ~/.rvm/gems/ruby-1.9.2-p180@invoicey/gems/jquery-rails-1.0.11/vendor/assets/javascripts/jquery.js (0ms) (pid 2725) |
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 ContentBlock | |
attr_accessor :template | |
delegate :content_tag, :to => :template | |
def initialize(template, options = {}, block) | |
@template = template | |
@title = options[:title] || '' | |
@block = block | |
@tabs = [] | |
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
SEC_TO_TIME(SUM(TIME_TO_SEC(TIMEDIFF(s.ended_at, s.started_at)))) |
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
Contact.limit(5).search({ :deleted_at_is_blank => true }) | |
ActiveRecord::StatementInvalid: PGError: ERROR: invalid input syntax for type timestamp: "" | |
: SELECT "contacts".* FROM "contacts" WHERE (("contacts"."deleted_at" IS NULL OR "contacts"."deleted_at" = '')) LIMIT 5 |
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
ActiveRecord::StatementInvalid: PGError: ERROR: column "sales.id" must appear in the GROUP BY clause or be used in an aggregate function | |
: SELECT "sales".* FROM "sales" WHERE (branch_name = 'St. Joseph') AND ("sales"."invoiced_on" = '2010-08-09') GROUP BY date_part('year', invoiced_on) |
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
can :read, Contact, :deleted_at => nil | |
#SELECT * FROM contacts WHERE (deleted_at IS NULL or deleted_at = "") |
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
gem 'sqlite3-ruby', :require => 'sqlite3', :group => :development | |
gem 'mysql', :group => :production |
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 | |
@activities = current_user.activities.search(params[:search] | |
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
WillPaginate::ViewHelpers.pagination_options[:renderer] = "ProperPagination" |