This file contains 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 CreateAropenitems < ActiveRecord::Migration | |
def self.up | |
create_table :aropenitems do |t| | |
t.integer :cust_no | |
t.date :doc_date | |
t.integer :doc_no | |
t.string :doc_type, :limit => 1 | |
t.integer :apply_to_no | |
t.date :doc_due_date | |
t.decimal :amt1, :precision => 9, :scale => 2 |
This file contains 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
SampleApp::Application.routes.draw do |map| | |
match ':controller(/:action(/:id(.:format)))' | |
end |
This file contains 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
script/generate scaffold company title:string | |
script/generate scaffold address company_id:integer address:text | |
script/generate scaffold employee company_id:integer name:string surname:string | |
# company model | |
class Company < ActiveRecord::Base | |
has_one :address | |
has_many :employees |
This file contains 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 score(dice) | |
points = 0 | |
roll = { 1 => 0, 2 => 0, 3 => 0, 4 => 0, 5 => 0, 6 => 0 } | |
dice.each { |i| roll[i] += 1} | |
roll.each do |key, value| | |
case key | |
when 1 |
This file contains 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 Dog | |
def initialize(name) | |
@name = name | |
end | |
def bark | |
"#{@name} barks like a dog" | |
end | |
def eat |
This file contains 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 Granny | |
attr_reader :name | |
def initialize(name) | |
@name = name | |
end | |
end | |
class Conversation | |
attr_reader :grannys |
This file contains 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
# features/refinery/manage_files | |
Scenario: Files Delete | |
Given I have no files | |
When I upload the file at "features/uploads/refinery_is_awesome.txt" | |
And I go to the list of files | |
And I follow "Remove this file forever" | |
Then I should have 0 file | |
# next line fails ... | |
# And I should see "'refinery_is_awesome.txt' was successfully destroyed." |
This file contains 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
# /refinerycms/vendor/refinerycms/images/app/views/admin/images/_form.html.erb | |
<%#= f.error_messages %> | |
<%= render "/shared/admin/error_messages", :object => @image %> | |
# /refinerycms/vendor/refinerycms/core/app/views/shared/admin/_error_messages.html.erb | |
<% if object.errors.any? %> | |
<div class="errorExplanation" id="errorExplanation"> | |
<p><%= pluralize(object.errors.count, "error") %> prohibited this resource from being saved:</p> | |
<ul> |
This file contains 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
= Setup | |
=== In your browser | |
login to http://github.com | |
go to http://github.com/resolve/refinerycms | |
if you have a fork already, delete it (if you're not going to loose work. This makes it much easier for us to integrate your changes back in) | |
click on fork | |
=== In terminal | |
git clone [email protected]:USERNAME/refinerycms.git refinerycms |
This file contains 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
user app; | |
worker_processes 2; | |
error_log /home/app/logs/nginx.error.log info; | |
events { | |
worker_connections 1024; | |
} | |
OlderNewer