Skip to content
Newer
Older
100644 56 lines (43 sloc) 1.09 KB
7b88d62 @ryanb getting specs passing for the most part, a couple specs are pending b…
ryanb authored Feb 15, 2011
1 require "rubygems"
2 require "bundler/setup"
3
4 require "action_view"
5 require "active_record"
4ab1868 @ryanb updating gemspec, readme, Gemfile, RSpec, and rvmrc
ryanb authored Feb 15, 2011
6
7 Bundler.require(:default)
8
7b88d62 @ryanb getting specs passing for the most part, a couple specs are pending b…
ryanb authored Feb 15, 2011
9 # require 'active_model'
10 # require 'active_record'
11 # require 'action_controller'
12 # require 'action_view'
13 # require 'action_view/template'
14 # require "active_support/all"
4241c40 @madebydna initial commit
madebydna authored Oct 16, 2010
15
7b88d62 @ryanb getting specs passing for the most part, a couple specs are pending b…
ryanb authored Feb 15, 2011
16 # require 'nested_form/view_helper'
17 # require 'nested_form/builder'
4241c40 @madebydna initial commit
madebydna authored Oct 17, 2010
18
7b88d62 @ryanb getting specs passing for the most part, a couple specs are pending b…
ryanb authored Feb 15, 2011
19 RSpec.configure do |config|
20 config.mock_with :mocha
4241c40 @madebydna initial commit
madebydna authored Oct 17, 2010
21 end
22
23 class TablelessModel < ActiveRecord::Base
24 def self.columns() @columns ||= []; end
25
26 def self.column(name, sql_type = nil, default = nil, null = true)
27 columns << ActiveRecord::ConnectionAdapters::Column.new(name.to_s, default, sql_type.to_s, null)
28 end
29
30 def self.quoted_table_name
31 name.pluralize.underscore
32 end
33
34 def quoted_id
35 "0"
36 end
37 end
38
39 class Project < TablelessModel
40 column :name, :string
41 has_many :tasks
42 accepts_nested_attributes_for :tasks
43 end
44
45 class Task < TablelessModel
46 column :project_id, :integer
47 column :name, :string
48 belongs_to :project
49 end
50
51 class Milestone < TablelessModel
52 column :task_id, :integer
53 column :name, :string
54 belongs_to :task
bd5f1c2 @madebydna converted plugin into gem
madebydna authored Oct 17, 2010
55 end
Something went wrong with that request. Please try again.