Scott P anithri

View rspec failure error
1 2 3 4 5 6
1) Ruzo::Crm#get_records should get more than 1 slice for counts over @max_records
Failure/Error: crm.should_receive(:get_record_slice).with("Contacts",{from:1, to: 4}).ordered
#<Ruzo::Crm:0x00000002e2f980> received :get_record_slice with unexpected arguments
expected: ("Contacts", {:from=>1, :to=>4})
got: ("Contacts", {:from=>1, :to=>8}), ("Contacts", {:from=>5, :to=>12})
# ./spec/crm_spec.rb:88:in `block (4 levels) in <top (required)>'
View results.md

expected result in from excel function where =(NORMDIST(test,0,1,FALSE)) * 2.506628274631

actual result from (Normdist.normdist(test, 0 , 1, false) * 2.50663).round(4)

test value expected Actual
0 1.0 1.0
0.05 0.9988 0.9753
0.1 0.995 0.9512
0.15 0.9888 0.9277
View model.rb
1 2 3 4 5 6 7 8 9 10
<% module_namespacing do -%>
class <%= class_name %> < <%= parent_class_name.classify %>
#extends
 
#includes
 
#security
<% if !accessible_attributes.empty? -%>
attr_accessible <%= accessible_attributes.map {|a| ":#{a.name}" }.sort.join(', ') %>
<% else -%>
View controller_spec.rb
1 2 3 4 5 6 7 8 9 10
require 'spec_helper'
 
describe <%= controller_class_name %>Controller do
 
# This should return the minimal set of attributes required to create a valid
# <%= class_name %>. As you add validations to <%= class_name %>, be sure to
# update the return value of this method accordingly.
def valid_attributes
attributes_for(:<%= file_name %>)
end
View gist:3881265
1 2 3 4 5 6 7 8 9 10
class Project < ActiveRecord::Base
has_and_belongs_to_many :project_types
 
scope :has_any_project_types, ->(*project_types) do
joins(:project_types).
where("project_types.id IN (?)", project_types)
end
 
scope :has_all_project_types, ->(*project_types) do
joins(:project_types).
View addendum_grid.yml
1 2 3 4 5 6 7 8 9 10
#app/grids/addendum_grid.yml
---
:grid:
:dom_id: "addendums_grid"
:caption: "Addendums"
:pager_options:
:core:
:edit: true
:search: false
:add: true
View clause.rb
1 2 3 4 5 6 7 8 9
def clause(op, field, data)
out = []
out << ops_table[op][:field_proc].call(field)
out << ops_table[op][:data_proc].call(data)
out
end
 
#later
model.where(*clause(op, field, data))
View exception.rb
1 2 3 4 5 6 7 8 9 10
module MyModule
class MyModuleError < StandardError
@@ignore = :warn
 
def ok_to_ignore?
@@ignore
end
 
def self.ok_to_ignore
@@ignore
View gist:1208809
1 2 3 4 5 6 7 8 9 10
class ColorFormatter < Log4r::Formatter
attr_accessor :color, :label, :colors, :format_string
 
def colors
@level_colors || [:cyan, :green, :yellow, :light_red, :red]
end
 
def initialize(opts={})
@depth = (opts[:depth] || 7 ).to_i
@color = opts[:color] || true
View Gemfile
1 2 3 4 5 6 7 8 9 10
#Gemfile
group :development do
gem 'guard'
gem 'guard-bundler'
gem 'guard-rspec'
gem 'guard-annotate'
gem 'guard-spork'
#For linux
#gem 'rb-inotify'
#gem 'libnotify'
Something went wrong with that request. Please try again.