actionpack 1.11.2 → 1.12.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of actionpack might be problematic. Click here for more details.
- data/CHANGELOG +392 -5
- data/lib/action_controller.rb +8 -4
- data/lib/action_controller/assertions.rb +9 -10
- data/lib/action_controller/base.rb +177 -88
- data/lib/action_controller/benchmarking.rb +5 -5
- data/lib/action_controller/caching.rb +44 -36
- data/lib/action_controller/cgi_ext/cgi_methods.rb +71 -6
- data/lib/action_controller/cgi_ext/cookie_performance_fix.rb +1 -1
- data/lib/action_controller/cgi_process.rb +36 -24
- data/lib/action_controller/components.rb +152 -52
- data/lib/action_controller/dependencies.rb +1 -1
- data/lib/action_controller/deprecated_redirects.rb +2 -2
- data/lib/action_controller/deprecated_request_methods.rb +34 -0
- data/lib/action_controller/filters.rb +59 -19
- data/lib/action_controller/flash.rb +53 -47
- data/lib/action_controller/helpers.rb +2 -2
- data/lib/action_controller/integration.rb +524 -0
- data/lib/action_controller/layout.rb +58 -23
- data/lib/action_controller/mime_responds.rb +163 -0
- data/lib/action_controller/mime_type.rb +142 -0
- data/lib/action_controller/pagination.rb +13 -7
- data/lib/action_controller/request.rb +59 -56
- data/lib/action_controller/rescue.rb +1 -1
- data/lib/action_controller/routing.rb +29 -10
- data/lib/action_controller/scaffolding.rb +8 -0
- data/lib/action_controller/session/active_record_store.rb +21 -10
- data/lib/action_controller/session/mem_cache_store.rb +18 -12
- data/lib/action_controller/session_management.rb +30 -11
- data/lib/action_controller/templates/rescues/_trace.rhtml +1 -1
- data/lib/action_controller/templates/scaffolds/layout.rhtml +4 -4
- data/lib/action_controller/templates/scaffolds/list.rhtml +1 -1
- data/lib/action_controller/test_process.rb +189 -118
- data/lib/action_controller/vendor/html-scanner/html/node.rb +20 -1
- data/lib/action_controller/vendor/html-scanner/html/tokenizer.rb +3 -0
- data/lib/action_controller/vendor/html-scanner/html/version.rb +1 -1
- data/lib/action_controller/vendor/xml_node.rb +97 -0
- data/lib/action_controller/verification.rb +2 -0
- data/lib/action_pack/version.rb +3 -3
- data/lib/action_view.rb +0 -2
- data/lib/action_view/base.rb +109 -36
- data/lib/action_view/compiled_templates.rb +1 -1
- data/lib/action_view/helpers/active_record_helper.rb +4 -2
- data/lib/action_view/helpers/asset_tag_helper.rb +6 -7
- data/lib/action_view/helpers/capture_helper.rb +49 -12
- data/lib/action_view/helpers/date_helper.rb +14 -4
- data/lib/action_view/helpers/form_helper.rb +136 -20
- data/lib/action_view/helpers/form_options_helper.rb +29 -7
- data/lib/action_view/helpers/form_tag_helper.rb +22 -20
- data/lib/action_view/helpers/java_script_macros_helper.rb +29 -9
- data/lib/action_view/helpers/javascript_helper.rb +50 -446
- data/lib/action_view/helpers/javascripts/controls.js +95 -30
- data/lib/action_view/helpers/javascripts/dragdrop.js +161 -21
- data/lib/action_view/helpers/javascripts/effects.js +310 -211
- data/lib/action_view/helpers/javascripts/prototype.js +228 -28
- data/lib/action_view/helpers/number_helper.rb +9 -9
- data/lib/action_view/helpers/pagination_helper.rb +1 -1
- data/lib/action_view/helpers/prototype_helper.rb +900 -0
- data/lib/action_view/helpers/scriptaculous_helper.rb +135 -0
- data/lib/action_view/helpers/text_helper.rb +7 -6
- data/lib/action_view/helpers/url_helper.rb +23 -14
- data/lib/action_view/partials.rb +12 -4
- data/rakefile +13 -5
- data/test/abstract_unit.rb +4 -3
- data/test/active_record_unit.rb +88 -0
- data/test/{controller → activerecord}/active_record_assertions_test.rb +7 -50
- data/test/{controller → activerecord}/active_record_store_test.rb +27 -4
- data/test/activerecord/pagination_test.rb +161 -0
- data/test/controller/action_pack_assertions_test.rb +18 -15
- data/test/controller/base_test.rb +31 -42
- data/test/controller/benchmark_test.rb +8 -11
- data/test/controller/capture_test.rb +33 -1
- data/test/controller/cgi_test.rb +33 -0
- data/test/controller/custom_handler_test.rb +8 -0
- data/test/controller/fake_controllers.rb +9 -17
- data/test/controller/filters_test.rb +32 -3
- data/test/controller/flash_test.rb +26 -41
- data/test/controller/fragment_store_setting_test.rb +1 -1
- data/test/controller/layout_test.rb +73 -0
- data/test/controller/mime_responds_test.rb +257 -0
- data/test/controller/mime_type_test.rb +24 -0
- data/test/controller/new_render_test.rb +157 -1
- data/test/controller/redirect_test.rb +23 -0
- data/test/controller/render_test.rb +54 -56
- data/test/controller/request_test.rb +25 -0
- data/test/controller/routing_test.rb +74 -66
- data/test/controller/test_test.rb +66 -1
- data/test/controller/verification_test.rb +3 -1
- data/test/controller/webservice_test.rb +255 -0
- data/test/fixtures/companies.yml +24 -0
- data/test/fixtures/company.rb +9 -0
- data/test/fixtures/db_definitions/sqlite.sql +42 -0
- data/test/fixtures/developer.rb +7 -0
- data/test/fixtures/developers.yml +21 -0
- data/test/fixtures/developers_projects.yml +13 -0
- data/test/fixtures/layout_tests/layouts/controller_name_space/nested.rhtml +1 -0
- data/test/fixtures/layout_tests/layouts/item.rhtml +1 -0
- data/test/fixtures/layout_tests/layouts/layout_test.rhtml +1 -0
- data/test/fixtures/layout_tests/layouts/third_party_template_library.mab +1 -0
- data/test/fixtures/layout_tests/views/hello.rhtml +1 -0
- data/test/fixtures/multipart/mona_lisa.jpg +0 -0
- data/test/fixtures/project.rb +3 -0
- data/test/fixtures/projects.yml +7 -0
- data/test/fixtures/replies.yml +13 -0
- data/test/fixtures/reply.rb +5 -0
- data/test/fixtures/respond_to/all_types_with_layout.rhtml +1 -0
- data/test/fixtures/respond_to/all_types_with_layout.rjs +1 -0
- data/test/fixtures/respond_to/layouts/standard.rhtml +1 -0
- data/test/fixtures/respond_to/using_defaults.rhtml +1 -0
- data/test/fixtures/respond_to/using_defaults.rjs +1 -0
- data/test/fixtures/respond_to/using_defaults.rxml +1 -0
- data/test/fixtures/respond_to/using_defaults_with_type_list.rhtml +1 -0
- data/test/fixtures/respond_to/using_defaults_with_type_list.rjs +1 -0
- data/test/fixtures/respond_to/using_defaults_with_type_list.rxml +1 -0
- data/test/fixtures/test/block_content_for.rhtml +2 -0
- data/test/fixtures/test/delete_with_js.rjs +2 -0
- data/test/fixtures/test/dot.directory/render_file_with_ivar.rhtml +1 -0
- data/test/fixtures/test/enum_rjs_test.rjs +6 -0
- data/test/fixtures/test/erb_content_for.rhtml +2 -0
- data/test/fixtures/test/hello_world.rxml +3 -0
- data/test/fixtures/test/hello_world_with_layout_false.rhtml +1 -0
- data/test/fixtures/test/non_erb_block_content_for.rxml +4 -0
- data/test/fixtures/topic.rb +3 -0
- data/test/fixtures/topics.yml +22 -0
- data/test/template/active_record_helper_test.rb +4 -0
- data/test/template/asset_tag_helper_test.rb +7 -2
- data/test/template/date_helper_test.rb +39 -2
- data/test/template/form_helper_test.rb +238 -5
- data/test/template/form_options_helper_test.rb +78 -0
- data/test/template/form_tag_helper_test.rb +11 -0
- data/test/template/java_script_macros_helper_test.rb +51 -6
- data/test/template/javascript_helper_test.rb +7 -153
- data/test/template/number_helper_test.rb +14 -13
- data/test/template/prototype_helper_test.rb +423 -0
- data/test/template/scriptaculous_helper_test.rb +90 -0
- data/test/template/text_helper_test.rb +12 -9
- data/test/template/url_helper_test.rb +31 -15
- metadata +291 -246
- data/lib/action_controller/cgi_ext/multipart_progress.rb +0 -169
- data/lib/action_controller/upload_progress.rb +0 -473
- data/lib/action_controller/vendor/html-scanner/html/node.rb.rej +0 -17
- data/lib/action_view/helpers/upload_progress_helper.rb +0 -433
- data/lib/action_view/vendor/builder.rb +0 -13
- data/lib/action_view/vendor/builder/blankslate.rb +0 -53
- data/lib/action_view/vendor/builder/xmlbase.rb +0 -143
- data/lib/action_view/vendor/builder/xmlevents.rb +0 -63
- data/lib/action_view/vendor/builder/xmlmarkup.rb +0 -308
- data/test/controller/multipart_progress_testx.rb +0 -365
- data/test/controller/upload_progress_testx.rb +0 -89
- data/test/template/upload_progress_helper_testx.rb +0 -136
@@ -207,10 +207,12 @@ class VerificationTest < Test::Unit::TestCase
|
|
207
207
|
assert_redirected_to :action => "unguarded"
|
208
208
|
end
|
209
209
|
|
210
|
-
def
|
210
|
+
def test_guarded_post_and_calls_render_succeeds
|
211
211
|
post :must_be_post
|
212
212
|
assert_equal "Was a post!", @response.body
|
213
|
+
end
|
213
214
|
|
215
|
+
def test_guarded_post_and_calls_render_fails
|
214
216
|
get :must_be_post
|
215
217
|
assert_response 500
|
216
218
|
assert_equal "Must be post", @response.body
|
@@ -0,0 +1,255 @@
|
|
1
|
+
require File.dirname(__FILE__) + '/../abstract_unit'
|
2
|
+
require 'stringio'
|
3
|
+
|
4
|
+
class WebServiceTest < Test::Unit::TestCase
|
5
|
+
|
6
|
+
class MockCGI < CGI #:nodoc:
|
7
|
+
attr_accessor :stdinput, :stdoutput, :env_table
|
8
|
+
|
9
|
+
def initialize(env, data = '')
|
10
|
+
self.env_table = env
|
11
|
+
self.stdinput = StringIO.new(data)
|
12
|
+
self.stdoutput = StringIO.new
|
13
|
+
super()
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
|
18
|
+
class TestController < ActionController::Base
|
19
|
+
session :off
|
20
|
+
|
21
|
+
def assign_parameters
|
22
|
+
if params[:full]
|
23
|
+
render :text => dump_params_keys
|
24
|
+
else
|
25
|
+
render :text => (params.keys - ['controller', 'action']).sort.join(", ")
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
def dump_params_keys(hash=params)
|
30
|
+
hash.keys.sort.inject("") do |s, k|
|
31
|
+
value = hash[k]
|
32
|
+
value = Hash === value ? "(#{dump_params_keys(value)})" : ""
|
33
|
+
s << ", " unless s.empty?
|
34
|
+
s << "#{k}#{value}"
|
35
|
+
end
|
36
|
+
end
|
37
|
+
|
38
|
+
def rescue_action(e) raise end
|
39
|
+
end
|
40
|
+
|
41
|
+
def setup
|
42
|
+
@controller = TestController.new
|
43
|
+
ActionController::Base.param_parsers.clear
|
44
|
+
ActionController::Base.param_parsers[Mime::XML] = :xml_node
|
45
|
+
end
|
46
|
+
|
47
|
+
def test_check_parameters
|
48
|
+
process('GET')
|
49
|
+
assert_equal '', @controller.response.body
|
50
|
+
end
|
51
|
+
|
52
|
+
def test_post_xml
|
53
|
+
process('POST', 'application/xml', '<entry attributed="true"><summary>content...</summary></entry>')
|
54
|
+
|
55
|
+
assert_equal 'entry', @controller.response.body
|
56
|
+
assert @controller.params.has_key?(:entry)
|
57
|
+
assert_equal 'content...', @controller.params["entry"].summary.node_value
|
58
|
+
assert_equal 'true', @controller.params["entry"]['attributed']
|
59
|
+
end
|
60
|
+
|
61
|
+
def test_put_xml
|
62
|
+
process('PUT', 'application/xml', '<entry attributed="true"><summary>content...</summary></entry>')
|
63
|
+
|
64
|
+
assert_equal 'entry', @controller.response.body
|
65
|
+
assert @controller.params.has_key?(:entry)
|
66
|
+
assert_equal 'content...', @controller.params["entry"].summary.node_value
|
67
|
+
assert_equal 'true', @controller.params["entry"]['attributed']
|
68
|
+
end
|
69
|
+
|
70
|
+
def test_register_and_use_yaml
|
71
|
+
ActionController::Base.param_parsers[Mime::YAML] = Proc.new { |d| YAML.load(d) }
|
72
|
+
process('POST', 'application/x-yaml', {"entry" => "loaded from yaml"}.to_yaml)
|
73
|
+
assert_equal 'entry', @controller.response.body
|
74
|
+
assert @controller.params.has_key?(:entry)
|
75
|
+
assert_equal 'loaded from yaml', @controller.params["entry"]
|
76
|
+
end
|
77
|
+
|
78
|
+
def test_register_and_use_yaml_as_symbol
|
79
|
+
ActionController::Base.param_parsers[Mime::YAML] = :yaml
|
80
|
+
process('POST', 'application/x-yaml', {"entry" => "loaded from yaml"}.to_yaml)
|
81
|
+
assert_equal 'entry', @controller.response.body
|
82
|
+
assert @controller.params.has_key?(:entry)
|
83
|
+
assert_equal 'loaded from yaml', @controller.params["entry"]
|
84
|
+
end
|
85
|
+
|
86
|
+
def test_register_and_use_xml_simple
|
87
|
+
ActionController::Base.param_parsers[Mime::XML] = Proc.new { |data| XmlSimple.xml_in(data, 'ForceArray' => false) }
|
88
|
+
process('POST', 'application/xml', '<request><summary>content...</summary><title>SimpleXml</title></request>' )
|
89
|
+
assert_equal 'summary, title', @controller.response.body
|
90
|
+
assert @controller.params.has_key?(:summary)
|
91
|
+
assert @controller.params.has_key?(:title)
|
92
|
+
assert_equal 'content...', @controller.params["summary"]
|
93
|
+
assert_equal 'SimpleXml', @controller.params["title"]
|
94
|
+
end
|
95
|
+
|
96
|
+
def test_use_xml_ximple_with_empty_request
|
97
|
+
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
|
98
|
+
assert_nothing_raised { process('POST', 'application/xml', "") }
|
99
|
+
assert_equal "", @controller.response.body
|
100
|
+
end
|
101
|
+
|
102
|
+
def test_deprecated_request_methods
|
103
|
+
process('POST', 'application/x-yaml')
|
104
|
+
assert_equal Mime::YAML, @controller.request.content_type
|
105
|
+
assert_equal true, @controller.request.post?
|
106
|
+
assert_equal :yaml, @controller.request.post_format
|
107
|
+
assert_equal true, @controller.request.yaml_post?
|
108
|
+
assert_equal false, @controller.request.xml_post?
|
109
|
+
end
|
110
|
+
|
111
|
+
def test_dasherized_keys_as_xml
|
112
|
+
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
|
113
|
+
process('POST', 'application/xml', "<first-key>\n<sub-key>...</sub-key>\n</first-key>", true)
|
114
|
+
assert_equal 'action, controller, first_key(sub_key), full', @controller.response.body
|
115
|
+
assert_equal "...", @controller.params[:first_key][:sub_key]
|
116
|
+
end
|
117
|
+
|
118
|
+
def test_typecast_as_xml
|
119
|
+
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
|
120
|
+
process('POST', 'application/xml', <<-XML)
|
121
|
+
<data>
|
122
|
+
<a type="integer">15</a>
|
123
|
+
<b type="boolean">false</b>
|
124
|
+
<c type="boolean">true</c>
|
125
|
+
<d type="date">2005-03-17</d>
|
126
|
+
<e type="datetime">2005-03-17T21:41:07Z</e>
|
127
|
+
<f>unparsed</f>
|
128
|
+
<g type="integer">1</g>
|
129
|
+
<g>hello</g>
|
130
|
+
<g type="date">1974-07-25</g>
|
131
|
+
</data>
|
132
|
+
XML
|
133
|
+
params = @controller.params
|
134
|
+
assert_equal 15, params[:data][:a]
|
135
|
+
assert_equal false, params[:data][:b]
|
136
|
+
assert_equal true, params[:data][:c]
|
137
|
+
assert_equal Date.new(2005,3,17), params[:data][:d]
|
138
|
+
assert_equal Time.utc(2005,3,17,21,41,7), params[:data][:e]
|
139
|
+
assert_equal "unparsed", params[:data][:f]
|
140
|
+
assert_equal [1, "hello", Date.new(1974,7,25)], params[:data][:g]
|
141
|
+
end
|
142
|
+
|
143
|
+
def test_entities_unescaped_as_xml_simple
|
144
|
+
ActionController::Base.param_parsers[Mime::XML] = :xml_simple
|
145
|
+
process('POST', 'application/xml', <<-XML)
|
146
|
+
<data><foo "bar's" & friends></data>
|
147
|
+
XML
|
148
|
+
assert_equal %(<foo "bar's" & friends>), @controller.params[:data]
|
149
|
+
end
|
150
|
+
|
151
|
+
def test_dasherized_keys_as_yaml
|
152
|
+
ActionController::Base.param_parsers[Mime::YAML] = :yaml
|
153
|
+
process('POST', 'application/x-yaml', "---\nfirst-key:\n sub-key: ...\n", true)
|
154
|
+
assert_equal 'action, controller, first_key(sub_key), full', @controller.response.body
|
155
|
+
assert_equal "...", @controller.params[:first_key][:sub_key]
|
156
|
+
end
|
157
|
+
|
158
|
+
def test_typecast_as_yaml
|
159
|
+
ActionController::Base.param_parsers[Mime::YAML] = :yaml
|
160
|
+
process('POST', 'application/x-yaml', <<-YAML)
|
161
|
+
---
|
162
|
+
data:
|
163
|
+
a: 15
|
164
|
+
b: false
|
165
|
+
c: true
|
166
|
+
d: 2005-03-17
|
167
|
+
e: 2005-03-17T21:41:07Z
|
168
|
+
f: unparsed
|
169
|
+
g:
|
170
|
+
- 1
|
171
|
+
- hello
|
172
|
+
- 1974-07-25
|
173
|
+
YAML
|
174
|
+
params = @controller.params
|
175
|
+
assert_equal 15, params[:data][:a]
|
176
|
+
assert_equal false, params[:data][:b]
|
177
|
+
assert_equal true, params[:data][:c]
|
178
|
+
assert_equal Date.new(2005,3,17), params[:data][:d]
|
179
|
+
assert_equal Time.utc(2005,3,17,21,41,7), params[:data][:e]
|
180
|
+
assert_equal "unparsed", params[:data][:f]
|
181
|
+
assert_equal [1, "hello", Date.new(1974,7,25)], params[:data][:g]
|
182
|
+
end
|
183
|
+
|
184
|
+
private
|
185
|
+
|
186
|
+
def process(verb, content_type = 'application/x-www-form-urlencoded', data = '', full=false)
|
187
|
+
|
188
|
+
cgi = MockCGI.new({
|
189
|
+
'REQUEST_METHOD' => verb,
|
190
|
+
'CONTENT_TYPE' => content_type,
|
191
|
+
'QUERY_STRING' => "action=assign_parameters&controller=webservicetest/test#{"&full=1" if full}",
|
192
|
+
"REQUEST_URI" => "/",
|
193
|
+
"HTTP_HOST" => 'testdomain.com',
|
194
|
+
"CONTENT_LENGTH" => data.size,
|
195
|
+
"SERVER_PORT" => "80",
|
196
|
+
"HTTPS" => "off"}, data)
|
197
|
+
|
198
|
+
@controller.send(:process, ActionController::CgiRequest.new(cgi, {}), ActionController::CgiResponse.new(cgi))
|
199
|
+
end
|
200
|
+
|
201
|
+
end
|
202
|
+
|
203
|
+
|
204
|
+
class XmlNodeTest < Test::Unit::TestCase
|
205
|
+
def test_all
|
206
|
+
xn = XmlNode.from_xml(%{<?xml version="1.0" encoding="UTF-8"?>
|
207
|
+
<response success='true'>
|
208
|
+
<page title='Ajax Summit' id='1133' email_address='ry87ib@backpackit.com'>
|
209
|
+
<description>With O'Reilly and Adaptive Path</description>
|
210
|
+
<notes>
|
211
|
+
<note title='Hotel' id='1020' created_at='2005-05-14 16:41:11'>
|
212
|
+
Staying at the Savoy
|
213
|
+
</note>
|
214
|
+
</notes>
|
215
|
+
<tags>
|
216
|
+
<tag name='Technology' id='4' />
|
217
|
+
<tag name='Travel' id='5' />
|
218
|
+
</tags>
|
219
|
+
</page>
|
220
|
+
</response>
|
221
|
+
}
|
222
|
+
)
|
223
|
+
assert_equal 'UTF-8', xn.node.document.encoding
|
224
|
+
assert_equal '1.0', xn.node.document.version
|
225
|
+
assert_equal 'true', xn['success']
|
226
|
+
assert_equal 'response', xn.node_name
|
227
|
+
assert_equal 'Ajax Summit', xn.page['title']
|
228
|
+
assert_equal '1133', xn.page['id']
|
229
|
+
assert_equal "With O'Reilly and Adaptive Path", xn.page.description.node_value
|
230
|
+
assert_equal nil, xn.nonexistent
|
231
|
+
assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip
|
232
|
+
assert_equal 'Technology', xn.page.tags.tag[0]['name']
|
233
|
+
assert_equal 'Travel', xn.page.tags.tag[1][:name]
|
234
|
+
matches = xn.xpath('//@id').map{ |id| id.to_i }
|
235
|
+
assert_equal [4, 5, 1020, 1133], matches.sort
|
236
|
+
matches = xn.xpath('//tag').map{ |tag| tag['name'] }
|
237
|
+
assert_equal ['Technology', 'Travel'], matches.sort
|
238
|
+
assert_equal "Ajax Summit", xn.page['title']
|
239
|
+
xn.page['title'] = 'Ajax Summit V2'
|
240
|
+
assert_equal "Ajax Summit V2", xn.page['title']
|
241
|
+
assert_equal "Staying at the Savoy", xn.page.notes.note.node_value.strip
|
242
|
+
xn.page.notes.note.node_value = "Staying at the Ritz"
|
243
|
+
assert_equal "Staying at the Ritz", xn.page.notes.note.node_value.strip
|
244
|
+
assert_equal '5', xn.page.tags.tag[1][:id]
|
245
|
+
xn.page.tags.tag[1]['id'] = '7'
|
246
|
+
assert_equal '7', xn.page.tags.tag[1]['id']
|
247
|
+
end
|
248
|
+
|
249
|
+
|
250
|
+
def test_small_entry
|
251
|
+
node = XmlNode.from_xml('<entry>hi</entry>')
|
252
|
+
assert_equal 'hi', node.node_value
|
253
|
+
end
|
254
|
+
|
255
|
+
end
|
@@ -0,0 +1,24 @@
|
|
1
|
+
thirty_seven_signals:
|
2
|
+
id: 1
|
3
|
+
name: 37Signals
|
4
|
+
rating: 4
|
5
|
+
|
6
|
+
TextDrive:
|
7
|
+
id: 2
|
8
|
+
name: TextDrive
|
9
|
+
rating: 4
|
10
|
+
|
11
|
+
PlanetArgon:
|
12
|
+
id: 3
|
13
|
+
name: Planet Argon
|
14
|
+
rating: 4
|
15
|
+
|
16
|
+
Google:
|
17
|
+
id: 4
|
18
|
+
name: Google
|
19
|
+
rating: 4
|
20
|
+
|
21
|
+
Ionist:
|
22
|
+
id: 5
|
23
|
+
name: Ioni.st
|
24
|
+
rating: 4
|
@@ -0,0 +1,42 @@
|
|
1
|
+
CREATE TABLE 'companies' (
|
2
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
3
|
+
'name' TEXT DEFAULT NULL,
|
4
|
+
'rating' INTEGER DEFAULT 1
|
5
|
+
);
|
6
|
+
|
7
|
+
CREATE TABLE 'replies' (
|
8
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
9
|
+
'content' text,
|
10
|
+
'created_at' datetime,
|
11
|
+
'updated_at' datetime,
|
12
|
+
'topic_id' integer
|
13
|
+
);
|
14
|
+
|
15
|
+
CREATE TABLE 'topics' (
|
16
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
17
|
+
'title' varchar(255),
|
18
|
+
'subtitle' varchar(255),
|
19
|
+
'content' text,
|
20
|
+
'created_at' datetime,
|
21
|
+
'updated_at' datetime
|
22
|
+
);
|
23
|
+
|
24
|
+
CREATE TABLE 'developers' (
|
25
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
26
|
+
'name' TEXT DEFAULT NULL,
|
27
|
+
'salary' INTEGER DEFAULT 70000,
|
28
|
+
'created_at' DATETIME DEFAULT NULL,
|
29
|
+
'updated_at' DATETIME DEFAULT NULL
|
30
|
+
);
|
31
|
+
|
32
|
+
CREATE TABLE 'projects' (
|
33
|
+
'id' INTEGER PRIMARY KEY NOT NULL,
|
34
|
+
'name' TEXT DEFAULT NULL
|
35
|
+
);
|
36
|
+
|
37
|
+
CREATE TABLE 'developers_projects' (
|
38
|
+
'developer_id' INTEGER NOT NULL,
|
39
|
+
'project_id' INTEGER NOT NULL,
|
40
|
+
'joined_on' DATE DEFAULT NULL,
|
41
|
+
'access_level' INTEGER DEFAULT 1
|
42
|
+
);
|
@@ -0,0 +1,21 @@
|
|
1
|
+
david:
|
2
|
+
id: 1
|
3
|
+
name: David
|
4
|
+
salary: 80000
|
5
|
+
|
6
|
+
jamis:
|
7
|
+
id: 2
|
8
|
+
name: Jamis
|
9
|
+
salary: 150000
|
10
|
+
|
11
|
+
<% for digit in 3..10 %>
|
12
|
+
dev_<%= digit %>:
|
13
|
+
id: <%= digit %>
|
14
|
+
name: fixture_<%= digit %>
|
15
|
+
salary: 100000
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
poor_jamis:
|
19
|
+
id: 11
|
20
|
+
name: Jamis
|
21
|
+
salary: 9000
|
@@ -0,0 +1 @@
|
|
1
|
+
controller_name_space/nested.rhtml <%= yield %>
|
@@ -0,0 +1 @@
|
|
1
|
+
item.rhtml <%= yield %>
|
@@ -0,0 +1 @@
|
|
1
|
+
layout_test.rhtml <%= yield %>
|
@@ -0,0 +1 @@
|
|
1
|
+
Mab
|
@@ -0,0 +1 @@
|
|
1
|
+
hello.rhtml
|
Binary file
|