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 UnApprovedActions < ApplicationController | |
| def approve_action | |
| Action.find_by(token: params[:token], *other stuff*).run_action | |
| end | |
| 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
| order = Order.new | |
| #=> #<Order id: nil, created_at: nil, updated_at: nil, created_by: nil> | |
| order.order_lines.new | |
| # => #<OrderLine id: nil, product_id: nil, created_at: nil, updated_at: nil> | |
| order.order_lines.last.order | |
| #=> nil |
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
| # -- | |
| # Copyright (C) 2001-2016 OTRS AG, http://otrs.com/ | |
| # -- | |
| # This software comes with ABSOLUTELY NO WARRANTY. For details, see | |
| # the enclosed file COPYING for license information (AGPL). If you | |
| # did not receive this file, see http://www.gnu.org/licenses/agpl.txt. | |
| # -- | |
| package Kernel::GenericInterface::Invoker::Test::Test; |
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
| >> self | |
| => #<Activity id: 7126, user_id: 58, start_at: "2016-08-02 03:15:00", end_at: "2016-08-02 10:30:00", worked_hours: #<BigDecimal:7fda363efae0,'0.675E1',18(27)>, vacation_hours: #<BigDecimal:7fda363ef950,'0.51975E0',9(18)>, date: "2016-08-02", information: "othertest"> | |
| >> Activity.find(7126) | |
| => #<Activity id: 7126, user_id: 58, start_at: "2016-07-28 02:45:00", end_at: "2016-07-28 10:15:00", worked_hours: #<BigDecimal:7fda369f7bb8,'0.7E1',9(18)>, vacation_hours: #<BigDecimal:7fda369f7a50,'0.539E0',9(18)>, date: "2016-07-28", information: "test2"> | |
| Only clues: | |
| @changed_attributes => {"id"=>7135} | |
| @original_raw_attributes => {"id"=>7126} |
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
| app/models/invoice_payment.rb | |
| class InvoicePayment < ActiveRecord::Base | |
| def to_liquid | |
| InvoicePaymentDrop.new(self) | |
| end | |
| end | |
| app/drops/invoice_payment_drop.rb | |
| class InvoicePaymentDrop < Liquid::Drop | |
| delegate :days_late, :duedate, :priceinbtw, :priceexbtw, :print_date, :id, :late, :unpayed, to: :invoice |
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
| Rails.application.routes.draw do | |
| resources :comments | |
| resources :articles do | |
| #works | |
| resources :comments | |
| #works | |
| resources :comments, only: :index | |
| #broken?? | |
| resources :comments, only: :test #why doesn't this work? | |
| 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
| DOES NOT WORK: | |
| {% for invoice in relation.invoices.late %} | |
| <tr> | |
| <td>{{invoice.id}}</td> | |
| <td>{{invoice.print_date}}</td> | |
| <td>{{invoice.days_late}}</td> | |
| <td>{{invoice.priceinbtw}}</td> | |
| </tr> | |
| {% endfor %} |
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 random() | |
| x = {a: "asf"} | |
| case x | |
| when :b | |
| "foo" | |
| when :a | |
| "bar" | |
| else | |
| "fail" | |
| 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
| def new | |
| @letter = Letter.new(letter_date: Date.today, draft: true) | |
| @letter.message = render_to_string file: "letters/templates/default.txt.erb" | |
| render :new | |
| 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
| BEFORE: | |
| <div class="foo"> | |
| <div class="bar"></div> | |
| <div class="bar"></div> | |
| <div class="bar"></div> | |
| </div> | |
| AFTER: | |
| <div class="foo"> | |
| <div class="newdiff"> | |
| <div class="bar"></div> |
NewerOlder