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
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
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 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
#lib/tasks/db.rake | |
namespace :db do | |
desc 'Drops the DB, migrates it, and finally seeds it' | |
task :reload => [:drop, :migrate, :seed] | |
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
<%= search_form_for(@report.search, :url => report_path('sales', 'by_contact')) do |f| %> | |
<div class="input string optional"> | |
<%= f.label :aggregator_of_User_type_name_eq, 'Name' %> | |
<%= f.text_field :aggregator_of_User_type_name_eq %> | |
</div> | |
<%= f.submit %> | |
<% 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
html, body { min-height: 100%; } /* force the footer to always be at the bottom */ | |
body { | |
background: | |
url(layout/header.jpg) no-repeat scroll center top, | |
url(layout/header-bg.jpg) repeat-x scroll left top, /* allows screen to be resized w/o eventual cutoff */ | |
url(layout/footer.jpg) no-repeat scroll center bottom, | |
url(layout/footer-bg.jpg) repeat-x scroll left bottom; /* allows screen to be resized w/o eventual cutoff */ | |
} |
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 Message < ActiveRecord::Base | |
belongs_to :recipient, :class => 'User' | |
belongs_to :sender, :class => 'User' | |
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
require 'test_helper' | |
require 'clearance/testing' | |
class EmployeesControllerTest < ActionController::TestCase | |
test "an ASM can not create a user" do | |
sign_in | |
post :create, :employee => { :name => 'Feed Store' } | |
assert_raise CanCan::AccessDenied | |
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
describe TaskList do | |
let(:list) { TaskList.new } | |
let(:todo) { mock('todo').as_null_object } | |
describe '#tasks' do | |
context 'without tasks' do | |
it 'returns an empty array' do | |
list.tasks.should be_empty | |
end | |
end |