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
merb : worker (port 4000) ~ undefined method `get' for nil:NilClass - (NoMethodError) | |
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/associations/relationship.rb:510:in `regions' | |
/home/piyush/Code/Intellecap/mostfit/app/controllers/staff_members.rb:114:in `show' | |
/usr/lib/ruby/gems/1.8/gems/merb-action-args-1.0.13/lib/merb-action-args/abstract_controller.rb:42:in `__send__' | |
/usr/lib/ruby/gems/1.8/gems/merb-action-args-1.0.13/lib/merb-action-args/abstract_controller.rb:42:in `_call_action' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.13/lib/merb-core/controller/abstract_controller.rb:289:in `_dispatch' | |
/usr/lib/ruby/gems/1.8/gems/merb-core-1.0.13/lib/merb-core/controller/merb_controller.rb:252:in `_dispatch' | |
/usr/lib/ |
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
PURE DM | |
start=Time.now; puts Branch.get(3).centers(:fields => [:id]).clients(:fields => [:id]).loans(:fields => [:id, :amount]).sum(:amount); puts Time.now-start | |
~ (0.000063) SET sql_auto_is_null = 0 | |
~ (0.000048) SET SESSION sql_mode = 'ANSI,NO_BACKSLASH_ESCAPES,NO_DIR_IN_CREATE,NO_ENGINE_SUBSTITUTION,NO_UNSIGNED_SUBTRACTION,TRADITIONAL' | |
~ (0.000140) SELECT `id`, `name`, `code`, `created_at`, `creation_date`, `area_id`, `manager_staff_id` FROM `branches` WHERE `id` = 3 ORDER BY `id` LIMIT 1 | |
~ (0.000058) SELECT `id` FROM `centers` WHERE `branch_id` = 3 ORDER BY `id` | |
~ (0.000106) SELECT `id`, `center_id` FROM `clients` WHERE `deleted_at` IS NULL AND `center_id` IN (5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 3 |
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
>> Loan.first(:amount.not => :amount_applied_for) | |
~ (0.001025) SELECT `id`, `discriminator`, `amount`, `amount_applied_for`, `amount_sanctioned`, `interest_rate`, `installment_frequency`, `number_of_installments`, `scheduled_disbursal_date`, `scheduled_first_payment_date`, `applied_on`, `approved_on`, `rejected_on`, `disbursal_date`, `written_off_on`, `validated_on`, `created_at`, `updated_at`, `loan_product_id`, `applied_by_staff_id`, `approved_by_staff_id`, `rejected_by_staff_id`, `disbursed_by_staff_id`, `written_off_by_staff_id`, `validated_by_staff_id`, `verified_by_user_id`, `created_by_user_id`, `cheque_number`, `cycle_number`, `original_amount`, `original_disbursal_date`, `original_first_payment_date`, `taken_over_on`, `taken_over_on_installment_number`, `occupation_id`, `funding_line_id`, `client_id` FROM `loans` WHERE `deleted_at` IS NULL AND `discriminator` IN ('Loan', 'DefaultLoan', 'A50Loan', 'EquatedWeekly', 'BulletLoan', 'BulletLoanWithPeriodicInterest', 'PararthRounded', 'TakeOverLoan', 'Take |
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
require "dm-core" | |
DataMapper::Logger.new($stdout, :debug) | |
DataMapper.setup(:default, 'mysql://test@localhost/dm_test') | |
class Amount | |
include DataMapper::Resource | |
property :id, Serial | |
property :amount_1, Integer |
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
require "dm-core" | |
DataMapper::Logger.new($stdout, :debug) | |
DataMapper.setup(:default, 'mysql://test@localhost/dm_test') | |
class Amount | |
include DataMapper::Resource | |
property :id, Serial | |
property :amount_1, Integer |
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
Mostfit::Business::Rule.prepare do |rule| | |
rule.allow :name => :number_of_branches_in_area, :model => Branch, :on => :create, :condition => ["area.branches.count", :less_than_equal, 5] | |
rule.allow :name => :loans_more_than_10k, :model => Loan, :on => :save, :precondition => {:disbursal_date.not => nil, :amount.gt => 10000}, :condition => {:disbursed_by => "client.center.branch.staff_member"} | |
rule.reject :name => :max_centers_in_area, :model => Center, :on => :create, :condition => ["branch.area.branches.centers.count", :greater_than_equal, 100] | |
rule.allow :name => :max_centers_in_branch, :model => Loan, :on => :create, :condition => ["client.center.branch.centers.count", :less_than_equal, 50] | |
rule.allow :name => :min_centers_in_branch, :model => Loan, :on => :create, :condition => ["client.center.branch.centers.count", :greater_than_equal, 5] | |
rule.allow :name => :min_clients_in_branch, :model => Loan, :on => :create, :condition => ["client.center.bran |
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
function create_remotes(){ | |
$("a._remote_").live('click', function(){ | |
href=$(this).attr("href"); | |
method="GET"; | |
if($(this).hasClass("self")){ | |
href=href+(href.indexOf("?")>-1 ? "&" : "?")+$(this).parent().serialize(); | |
method="POST"; | |
} | |
a=$(this); | |
a.after("<img id='spinner' src='/images/spinner.gif'/>"); |
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
%webengage{:license => <license_number>} | |
%script{:id => "_webengage_script_tag", :type => "text/javascript"} | |
(function(){var _we = document.createElement('script');_we.type = 'text/javascript';_we.async = true;_we.src = "//widgets.webengage.com/js/widget/webengage-min-v-2.0.js";var _sNode = document.getElementById('_webengage_script_tag');_sNode.parentNode.insertBefore(_we, _sNode);})(); |
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
window={}; | |
window.BlobBuilder = require("BlobBuilder"); | |
location={}; | |
location.protocol="http"; | |
BinaryPack = require("binary-pack"); | |
XMLHttpRequest = require("xmlhttprequest").XMLHttpRequest; | |
var wrtc = require("wrtc"); |
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
<html> | |
<head> | |
<script src="http://cdn.peerjs.com/0.3/peer.js"></script> | |
<title>Client</title> | |
</head> | |
<body> | |
<div class="error"></div> | |
<div id="container"></div> | |
<script type="text/javascript" src="/webrtc/client.js"></script> | |
</body> |
OlderNewer