Skip to content

Commit

Permalink
Added shop model and a basic invoice liquid template.
Browse files Browse the repository at this point in the history
  • Loading branch information
Soleone committed Mar 17, 2009
1 parent 76fda20 commit ab337c0
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/models/shop.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
class Shop < ActiveRecord::Base
has_many :templates, :class_name => "PrintTemplate"
end
13 changes: 13 additions & 0 deletions db/migrate/20090317150827_create_shops.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
class CreateShops < ActiveRecord::Migration
def self.up
create_table :shops do |t|
t.string :name

t.timestamps
end
end

def self.down
drop_table :shops
end
end
31 changes: 31 additions & 0 deletions db/printing/invoice.liquid
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
<h1>{{ shop_name }}</h1>

Thank you for your business.

<br/>
<br/>
<br/>
<h3>Payment Details</h3>

<div>
<p>Amount: {{ total_price | money }}</p>
<p>Invoice: {{ name }}</p
<p>Credit Card: {{ payment.card_number }}</p>

{% if note_body %}
<p>Description: {{ note_body }}</p>
{% endif %}
</div>

Buyer:
<div>
{{ customer.name }}<br/>
{{ billing_address.company }}<br/>
{{ billing_address.street }}<br/>
{{ billing_address.city }}<br/>
{{ billing_address.zip }}<br/>
{{ billing_address.country }}<br/>
</div>

If you have any questions, please send an email to
<a href="mailto:{{shop_email}}">{{ shop_email }}</a>
7 changes: 7 additions & 0 deletions test/fixtures/shops.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html

one:
name: MyString

two:
name: MyString
8 changes: 8 additions & 0 deletions test/unit/shop_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
require 'test_helper'

class ShopTest < ActiveSupport::TestCase
# Replace this with your real tests.
test "the truth" do
assert true
end
end

0 comments on commit ab337c0

Please sign in to comment.