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
| module AnimalFunctions | |
| def eat | |
| puts "The animal is eating" | |
| end | |
| end | |
| class Cow | |
| include AnimalFunctions |
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
| # been deleting a lot of this... | |
| <% content_for(:head) do %> | |
| <%= javascript_include_merged('databrowser') %> | |
| <%= stylesheet_link_merged('databrowser') %> | |
| <% 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
| # There are a bunch of (awkward) methods like this in view helpers | |
| # (awkward as they require the object to passed in). | |
| # I'm copying these to the models where they belong and marking the originals deprecated. | |
| # This sound ok? | |
| module PaymentsHelper | |
| def account_name(payment) | |
| "#{Account.find_with_deleted(payment.account_id).name}" | |
| 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
| <%if @report.report_type and @rows%> | |
| <table id="admin-report" width="100%" cellpadding="0" cellspacing="0" border="0" class="table table-striped table-bordered"> | |
| <thead> | |
| <tr> | |
| <%@columns.each do |c|%> | |
| <th><%=c[:display]%></th> | |
| <%end%> | |
| </tr> | |
| </thead> | |
| <tbody> |
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
| <th>Pricing</th> | |
| <td><%= label_tag :setup_cost%> <%=t 'payments.currency_label', :locale => @locale %> <%=t 'number.currency.unit', :locale => @locale %></td> | |
| <td><%= text_field_tag :setup_cost, @setup_cost %> <b>(excluding <%=t 'payments.tax', :locale => @locale %>)</b></td> |
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 item_class | |
| item_class = [Signup, SmsCredit, Subscription, Reactivation, Refund, SmsRefund, Adhoc].find{|type| item == type.item_name} | |
| raise "unknown purchase item '#{item}'" if item_class.nil? | |
| item_class | |
| end | |
| def description | |
| item_description = item_type ? item_type.description : '' | |
| self.read_attribute(:description) || item_description || default_description(quantity, item) | |
| 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
| # sort on position, *force* preservation original order if two have same position | |
| return fields_with_positions.each_with_index.sort{|(a,a_idx),(b,b_idx)| | |
| pos_comp = a[:position]<=>b[:position] | |
| pos_comp.zero? ? (a_idx<=>b_idx) : pos_comp | |
| }.map{|a| a[0] } |
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
| > git fetch origin | |
| > git checkout -b feature origin/feature | |
| > git rebase origin/master |
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
| AccountsController | |
| responding to POST register | |
| with valid user and account params | |
| should not shit me | |
| Finished in 0.77759 seconds | |
| 1 example, 0 failures |
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
| #So I have this in the acct creation controller | |
| @account.users.first.payment_methods << @payment_method | |
| #When this is hit by a spec I get this error | |
| Mock "PaymentMethod_1003" received unexpected message :[]= with ("user_id", 507) | |
| #Should I be attempting to stub it out with something like this: |