hobo 1.0.3 → 1.1.0.pre0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGES.txt +0 -66
- data/README +3 -0
- data/Rakefile +7 -7
- data/doctest/model.rdoctest +0 -2
- data/doctest/multi_model_forms.rdoctest +0 -2
- data/doctest/scopes.rdoctest +13 -21
- data/lib/active_record/association_collection.rb +7 -16
- data/lib/hobo.rb +10 -65
- data/lib/hobo/accessible_associations.rb +1 -5
- data/lib/hobo/authentication_support.rb +1 -1
- data/lib/hobo/controller.rb +5 -5
- data/lib/hobo/hobo_helper.rb +0 -84
- data/lib/hobo/lifecycles/lifecycle.rb +37 -31
- data/lib/hobo/lifecycles/transition.rb +1 -2
- data/lib/hobo/model.rb +13 -21
- data/lib/hobo/model_controller.rb +8 -8
- data/lib/hobo/rapid_helper.rb +12 -1
- data/lib/hobo/scopes/automatic_scopes.rb +26 -13
- data/lib/hobo/scopes/named_scope_extensions.rb +16 -28
- data/lib/hobo/user_controller.rb +1 -0
- data/lib/hobo/view_hints.rb +1 -5
- data/rails_generators/hobo/templates/initializer.rb +1 -1
- data/rails_generators/hobo_front_controller/templates/summary.dryml +4 -2
- data/rails_generators/hobo_model/hobo_model_generator.rb +12 -0
- data/rails_generators/hobo_model/templates/model.rb +9 -2
- data/rails_generators/hobo_rapid/templates/hobo-rapid.js +98 -23
- data/rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/clean.css +1 -1
- data/rails_generators/hobo_rapid/templates/themes/clean/public/stylesheets/rapid-ui.css +3 -1
- data/{dryml_generators → rapid_generators}/rapid/cards.dryml.erb +0 -0
- data/{dryml_generators → rapid_generators}/rapid/forms.dryml.erb +0 -0
- data/{dryml_generators → rapid_generators}/rapid/pages.dryml.erb +1 -1
- data/taglibs/rapid.dryml +2 -0
- data/taglibs/rapid_core.dryml +10 -9
- data/taglibs/rapid_forms.dryml +70 -35
- data/taglibs/rapid_lifecycles.dryml +17 -4
- data/taglibs/rapid_plus.dryml +3 -3
- data/taglibs/rapid_summary.dryml +11 -0
- data/taglibs/rapid_user_pages.dryml +39 -28
- data/tasks/hobo_tasks.rake +1 -1
- metadata +45 -61
- data/hobo.gemspec +0 -226
- data/lib/hobo/dryml.rb +0 -188
- data/lib/hobo/dryml/dryml_builder.rb +0 -140
- data/lib/hobo/dryml/dryml_doc.rb +0 -159
- data/lib/hobo/dryml/dryml_generator.rb +0 -263
- data/lib/hobo/dryml/dryml_support_controller.rb +0 -13
- data/lib/hobo/dryml/parser.rb +0 -3
- data/lib/hobo/dryml/parser/attribute.rb +0 -41
- data/lib/hobo/dryml/parser/base_parser.rb +0 -254
- data/lib/hobo/dryml/parser/document.rb +0 -57
- data/lib/hobo/dryml/parser/element.rb +0 -27
- data/lib/hobo/dryml/parser/elements.rb +0 -45
- data/lib/hobo/dryml/parser/source.rb +0 -58
- data/lib/hobo/dryml/parser/text.rb +0 -13
- data/lib/hobo/dryml/parser/tree_parser.rb +0 -67
- data/lib/hobo/dryml/part_context.rb +0 -137
- data/lib/hobo/dryml/scoped_variables.rb +0 -42
- data/lib/hobo/dryml/tag_parameters.rb +0 -36
- data/lib/hobo/dryml/taglib.rb +0 -123
- data/lib/hobo/dryml/template.rb +0 -1019
- data/lib/hobo/dryml/template_environment.rb +0 -613
- data/lib/hobo/dryml/template_handler.rb +0 -187
- data/lib/hobo/static_tags +0 -98
- data/taglibs/core.dryml +0 -104
data/CHANGES.txt
CHANGED
@@ -14,72 +14,6 @@ likely to cause conflicts, so it is highly recommended that you have
|
|
14
14
|
your code backed up and in a change control system such as git or
|
15
15
|
subversion.
|
16
16
|
|
17
|
-
=== Hobo 1.0.3 ===
|
18
|
-
|
19
|
-
This is a security release. All applications that use the reset
|
20
|
-
password functionality or are on versions of Rails prior to version
|
21
|
-
2.3.4 should upgrade.
|
22
|
-
|
23
|
-
To patch the reset password vulnerability, two changes have been made.
|
24
|
-
|
25
|
-
First of all, the lifecycle key hash mechanism has been changed.
|
26
|
-
Existing lifecycle keys will become invalid after you upgrade.
|
27
|
-
Lifecycle keys are typically short lived, so this is unlikely to be a
|
28
|
-
problem for most applications.
|
29
|
-
|
30
|
-
Secondly, lifecycle keys are now cleared on every transition to avoid
|
31
|
-
replay vulnerabilities. This new behaviour may be avoided by added
|
32
|
-
the `:keep_key => true` option to a transition.
|
33
|
-
|
34
|
-
More information about the vulnerability can be viewed on the [bug
|
35
|
-
report](https://hobo.lighthouseapp.com/projects/8324/tickets/666-user-model-secure-links-have-low-security).
|
36
|
-
|
37
|
-
Other changes:
|
38
|
-
|
39
|
-
The text input tag (`<textarea>`) has a security hole with versions of
|
40
|
-
Rails prior to 2.3.4. This release makes these old versions of Rails
|
41
|
-
safe again, although it is highly recommended that you upgrade to
|
42
|
-
Rails 2.3.11 because of other security vulnerabilities on earlier versions
|
43
|
-
of Rails.
|
44
|
-
|
45
|
-
The "include" automatic scope has been aliased to "includes" to
|
46
|
-
increase future compatibility with Rails 3. Future versions of Hobo
|
47
|
-
will remove support for "include".
|
48
|
-
|
49
|
-
This release increases compatibility with Ruby v1.9.2.
|
50
|
-
|
51
|
-
Hobo 1.0.2 introduced a major problem with chained scopes. This has
|
52
|
-
been fixed.
|
53
|
-
|
54
|
-
All code changes may viewed on the [github
|
55
|
-
log](https://github.com/tablatom/hobo/compare/v1.0.2...v1.0.3)
|
56
|
-
|
57
|
-
=== Hobo 1.0.2 ===
|
58
|
-
|
59
|
-
This release is almost identical to 1.0.1 except that it updates the
|
60
|
-
version requirements to exclude Rails3. Hobo does not currently work
|
61
|
-
with Rails3, although we are working on it.
|
62
|
-
|
63
|
-
This release silences some warnings produced when running with Rails
|
64
|
-
2.3.10.
|
65
|
-
|
66
|
-
This release contains preliminary support for Ruby 1.9.2, although you
|
67
|
-
may encounter problems if you use Single Type Inheritance (STI)
|
68
|
-
models.
|
69
|
-
|
70
|
-
A few very minor bug fixes have also been included. See the [github
|
71
|
-
log](https://github.com/tablatom/hobo/compare/v1.0.1...v1.0.2) for
|
72
|
-
more details.
|
73
|
-
|
74
|
-
=== Hobo 1.0.1 ===
|
75
|
-
|
76
|
-
This version contains two speedups: one fix that reduces the number of
|
77
|
-
database accesses by Matt Jones and one that speeds up compilation of
|
78
|
-
DRYML by Petteri Räty.
|
79
|
-
|
80
|
-
This version also contains several bug fixes. See the [github
|
81
|
-
log](http://github.com/tablatom/hobo/tree/v1.0.1) for more details.
|
82
|
-
|
83
17
|
=== Hobo 1.0.0 ===
|
84
18
|
|
85
19
|
Drumm-roll! Trumpets! Fanfare!
|
data/README
CHANGED
@@ -7,3 +7,6 @@ Hobo is an Open Source extension to Ruby on Rails which helps you build full blo
|
|
7
7
|
* Switchable themes. Customise and tweak your application structure and layout to meet any design goals.
|
8
8
|
* Powerful mark-up language, DRYML, combines rapid development with ultimate design flexibility. The end of the cookie cutter blues!
|
9
9
|
|
10
|
+
== RDOC Note
|
11
|
+
|
12
|
+
This is also the front page to the Hobo RDOC. RDOC is not the main documentation method for Hobo. See [hobocentral](http://cookbook.hobocentral.net) for the Hobo documentation.
|
data/Rakefile
CHANGED
@@ -10,11 +10,7 @@ $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '/../hobosupport/
|
|
10
10
|
require 'hobo'
|
11
11
|
|
12
12
|
RUBY = File.join(Config::CONFIG['bindir'], Config::CONFIG['ruby_install_name']).sub(/.*\s.*/m, '"\&"')
|
13
|
-
|
14
|
-
RUBYDOCTEST = 'bundle exec rubydoctest'
|
15
|
-
else
|
16
|
-
RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"
|
17
|
-
end
|
13
|
+
RUBYDOCTEST = ENV['RUBYDOCTEST'] || "#{RUBY} -S rubydoctest"
|
18
14
|
|
19
15
|
desc "Default Task"
|
20
16
|
task :default => [ :test ]
|
@@ -63,10 +59,14 @@ Jeweler::Tasks.new do |gemspec|
|
|
63
59
|
gemspec.executables = ['hobo']
|
64
60
|
gemspec.default_executable = 'hobo'
|
65
61
|
gemspec.rubyforge_project = "hobo"
|
66
|
-
gemspec.add_dependency("rails", [">= 2.2.2"
|
67
|
-
gemspec.add_dependency("will_paginate", [">= 2.3.11"
|
62
|
+
gemspec.add_dependency("rails", [">= 2.2.2"])
|
63
|
+
gemspec.add_dependency("will_paginate", [">= 2.3.11"])
|
68
64
|
gemspec.add_dependency("hobosupport", ["= #{Hobo::VERSION}"])
|
69
65
|
gemspec.add_dependency("hobofields", ["= #{Hobo::VERSION}"])
|
66
|
+
gemspec.add_dependency("dryml", ["= #{Hobo::VERSION}"])
|
70
67
|
gemspec.files.include %w(tasks/environments.rake tasks/hobo_tasks.rake)
|
71
68
|
end
|
72
69
|
Jeweler::GemcutterTasks.new
|
70
|
+
Jeweler::RubyforgeTasks.new do |rubyforge|
|
71
|
+
rubyforge.doc_task = false
|
72
|
+
end
|
data/doctest/model.rdoctest
CHANGED
@@ -34,7 +34,6 @@ Contents
|
|
34
34
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobofields/lib')
|
35
35
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobosupport/lib')
|
36
36
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobo/lib')
|
37
|
-
>> gem 'will_paginate', '~> 2'
|
38
37
|
>> require 'will_paginate'
|
39
38
|
>> require 'will_paginate/finder'
|
40
39
|
>> require 'hobosupport'
|
@@ -45,7 +44,6 @@ Contents
|
|
45
44
|
>>
|
46
45
|
def migrate(renames={})
|
47
46
|
up, down = HoboFields::MigrationGenerator.run(renames)
|
48
|
-
puts up
|
49
47
|
ActiveRecord::Migration.class_eval(up)
|
50
48
|
ActiveRecord::Base.send(:subclasses).each { |model| model.reset_column_information }
|
51
49
|
[up, down]
|
@@ -31,7 +31,6 @@ Contents
|
|
31
31
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobofields/lib')
|
32
32
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobosupport/lib')
|
33
33
|
>> $:.unshift File.join(File.expand_path(File.dirname(__FILE__)), '../../hobo/lib')
|
34
|
-
>> gem 'will_paginate', '~> 2'
|
35
34
|
>> require 'will_paginate'
|
36
35
|
>> require 'will_paginate/finder'
|
37
36
|
>> require 'hobosupport'
|
@@ -43,7 +42,6 @@ Contents
|
|
43
42
|
>>
|
44
43
|
def migrate(renames={})
|
45
44
|
up, down = HoboFields::MigrationGenerator.run(renames)
|
46
|
-
puts up
|
47
45
|
ActiveRecord::Migration.class_eval(up)
|
48
46
|
ActiveRecord::Base.send(:subclasses).each { |model| model.reset_column_information }
|
49
47
|
[up, down]
|
data/doctest/scopes.rdoctest
CHANGED
@@ -74,7 +74,6 @@ Some load path manipulation:
|
|
74
74
|
And we'll require hobo:
|
75
75
|
{.hidden}
|
76
76
|
|
77
|
-
>> gem 'will_paginate', '~> 2'
|
78
77
|
>> require 'will_paginate'
|
79
78
|
>> require 'will_paginate/finder'
|
80
79
|
>> require 'hobosupport'
|
@@ -95,7 +94,6 @@ Let's set up a few models for our testing:
|
|
95
94
|
born_at :date
|
96
95
|
code :integer
|
97
96
|
male :boolean
|
98
|
-
foo :string
|
99
97
|
timestamps
|
100
98
|
end
|
101
99
|
|
@@ -120,19 +118,19 @@ Generate a migration and run it:
|
|
120
118
|
|
121
119
|
>> ActiveRecord::Migration.class_eval(HoboFields::MigrationGenerator.run[0])
|
122
120
|
>> Person.columns.*.name
|
123
|
-
=> ["id", "name", "born_at", "code", "male", "
|
121
|
+
=> ["id", "name", "born_at", "code", "male", "created_at", "updated_at", "state"]
|
124
122
|
{.hidden}
|
125
123
|
|
126
124
|
And create a couple of fixtures:
|
127
125
|
|
128
126
|
>>
|
129
127
|
Bryan = Person.new(:name => "Bryan", :code => 17,
|
130
|
-
:born_at => Date.new(1973,4,8), :male => true
|
128
|
+
:born_at => Date.new(1973,4,8), :male => true)
|
131
129
|
>> Bryan.state = "active"
|
132
130
|
>> Bryan.save!
|
133
131
|
>>
|
134
132
|
Bethany = Person.new(:name => "Bethany", :code => 42,
|
135
|
-
:born_at => Date.new(1975,5,13), :male => false
|
133
|
+
:born_at => Date.new(1975,5,13), :male => false)
|
136
134
|
>> Bethany.state = "inactive"
|
137
135
|
>> Bethany.save!
|
138
136
|
>> Friendship.new(:person => Bryan, :friend => Bethany).save!
|
@@ -288,16 +286,12 @@ Gives the N most recent items:
|
|
288
286
|
>> Person.order_by(:code).*.name
|
289
287
|
=> ["Bryan", "Bethany"]
|
290
288
|
|
291
|
-
##
|
289
|
+
## include
|
292
290
|
|
293
|
-
Adding the
|
291
|
+
Adding the include function to your query chain has the same effect as
|
294
292
|
the `:include` option to the `find` method.
|
295
293
|
|
296
|
-
>> Person.
|
297
|
-
=> ["Bryan", "Bethany"]
|
298
|
-
.hidden
|
299
|
-
|
300
|
-
>> Person.includes(:friends).*.name
|
294
|
+
>> Person.include(:friends).*.name
|
301
295
|
=> ["Bryan", "Bethany"]
|
302
296
|
|
303
297
|
## search
|
@@ -323,6 +317,13 @@ You can also specify multiple records with the plural form
|
|
323
317
|
>> Person.with_friends(Bethany, nil).*.name
|
324
318
|
=> ["Bryan"]
|
325
319
|
|
320
|
+
## any\_of\_
|
321
|
+
|
322
|
+
This works on plural associations to find a model associated with any of the arguments
|
323
|
+
|
324
|
+
>> Person.any_of_friends(Bethany, Bryan).*.name
|
325
|
+
=> ["Bryan"]
|
326
|
+
|
326
327
|
## without\_
|
327
328
|
|
328
329
|
>> Person.without_friend(Bethany).*.name
|
@@ -395,15 +396,6 @@ Like named scopes, Hobo scopes can be chained:
|
|
395
396
|
>> Bryan.inactive_friends.inactive.*.name
|
396
397
|
=> ["Bethany"]
|
397
398
|
|
398
|
-
>> Person.scoped(:conditions => {:state => "active"}).scoped(:conditions => {:foo => "common"}).*.name
|
399
|
-
=> ["Bryan"]
|
400
|
-
|
401
|
-
>> Person.with_friendship(Friendship.first).born_before(Date.new(1974)).*.name
|
402
|
-
=> ["Bryan"]
|
403
|
-
|
404
|
-
>> Person.born_after(Date.new(1974)).with_friendship(Friendship.first).*.name
|
405
|
-
=> []
|
406
|
-
|
407
399
|
Clean up our test database:
|
408
400
|
{.hidden}
|
409
401
|
|
@@ -25,24 +25,19 @@ module ActiveRecord
|
|
25
25
|
record
|
26
26
|
end
|
27
27
|
|
28
|
-
def member_class
|
29
|
-
proxy_reflection.klass
|
30
|
-
end
|
31
|
-
|
32
28
|
# DO NOT call super here - AssociationProxy's version loads the collection, and that's bad.
|
33
29
|
# TODO: this really belongs in Rails; migrate it there ASAP
|
34
30
|
def respond_to?(*args)
|
35
|
-
|
36
|
-
proxy_respond_to?(*args) || [].respond_to?(*args)
|
31
|
+
proxy_respond_to?(*args) || Array.new.respond_to?(*args)
|
37
32
|
end
|
38
33
|
|
34
|
+
# TODO: send this patch into Rails. There's no reason to load the collection just to find out it acts like an array.
|
39
35
|
def is_a?(klass)
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
end
|
36
|
+
[].is_a?(klass)
|
37
|
+
end
|
38
|
+
|
39
|
+
def member_class
|
40
|
+
proxy_reflection.klass
|
46
41
|
end
|
47
42
|
|
48
43
|
private
|
@@ -57,10 +52,6 @@ module ActiveRecord
|
|
57
52
|
end
|
58
53
|
end
|
59
54
|
|
60
|
-
def has_one_collection?
|
61
|
-
proxy_reflection.macro == :has_one
|
62
|
-
end
|
63
|
-
|
64
55
|
end
|
65
56
|
end
|
66
57
|
end
|
data/lib/hobo.rb
CHANGED
@@ -2,17 +2,12 @@
|
|
2
2
|
require 'hobosupport'
|
3
3
|
require 'hobofields'
|
4
4
|
begin
|
5
|
-
gem 'will_paginate', '~> 2'
|
6
5
|
require 'will_paginate'
|
7
6
|
rescue MissingSourceFile
|
8
7
|
# OK, Hobo won't do pagination then
|
9
8
|
end
|
10
9
|
|
11
|
-
|
12
|
-
ActiveSupport::Dependencies.autoload_paths |= [ File.dirname(__FILE__)]
|
13
|
-
else
|
14
|
-
ActiveSupport::Dependencies.load_paths |= [ File.dirname(__FILE__)]
|
15
|
-
end
|
10
|
+
ActiveSupport::Dependencies.load_paths |= [ File.dirname(__FILE__)]
|
16
11
|
|
17
12
|
# Hobo can be installed in /vendor/hobo, /vendor/plugins/hobo, vendor/plugins/hobo/hobo, etc.
|
18
13
|
::HOBO_ROOT = File.expand_path(File.dirname(__FILE__) + "/..")
|
@@ -21,8 +16,8 @@ class HoboError < RuntimeError; end
|
|
21
16
|
|
22
17
|
module Hobo
|
23
18
|
|
24
|
-
VERSION = "1.0.
|
25
|
-
|
19
|
+
VERSION = "1.1.0.pre0"
|
20
|
+
|
26
21
|
class PermissionDeniedError < RuntimeError; end
|
27
22
|
|
28
23
|
class RawJs < String; end
|
@@ -62,8 +57,9 @@ module Hobo
|
|
62
57
|
search_targets.build_hash do |search_target|
|
63
58
|
conditions = []
|
64
59
|
parameters = []
|
60
|
+
like_operator = ActiveRecord::Base.connection.adapter_name =~ /postgres/i ? 'ILIKE' : 'LIKE'
|
65
61
|
query_words.each do |word|
|
66
|
-
column_queries = search_target.search_columns.map { |column| "#{column}
|
62
|
+
column_queries = search_target.search_columns.map { |column| "#{column} #{like_operator} ?" }
|
67
63
|
conditions << "(" + column_queries.join(" or ") + ")"
|
68
64
|
parameters.concat(["%#{word}%"] * column_queries.length)
|
69
65
|
end
|
@@ -87,53 +83,6 @@ module Hobo
|
|
87
83
|
(not refl.options[:conditions])
|
88
84
|
end
|
89
85
|
|
90
|
-
|
91
|
-
def get_field(object, field)
|
92
|
-
return nil if object.nil?
|
93
|
-
field_str = field.to_s
|
94
|
-
begin
|
95
|
-
return object.send(field_str)
|
96
|
-
rescue NoMethodError => ex
|
97
|
-
if field_str =~ /^\d+$/
|
98
|
-
return object[field.to_i]
|
99
|
-
else
|
100
|
-
return object[field]
|
101
|
-
end
|
102
|
-
end
|
103
|
-
end
|
104
|
-
|
105
|
-
|
106
|
-
def get_field_path(object, path)
|
107
|
-
path = if path.is_a? String
|
108
|
-
path.split('.')
|
109
|
-
else
|
110
|
-
Array(path)
|
111
|
-
end
|
112
|
-
|
113
|
-
parent = nil
|
114
|
-
path.each do |field|
|
115
|
-
return nil if object.nil?
|
116
|
-
parent = object
|
117
|
-
object = get_field(parent, field)
|
118
|
-
end
|
119
|
-
[parent, path.last, object]
|
120
|
-
end
|
121
|
-
|
122
|
-
|
123
|
-
def static_tags
|
124
|
-
@static_tags ||= begin
|
125
|
-
path = if FileTest.exists?("#{RAILS_ROOT}/config/dryml_static_tags.txt")
|
126
|
-
"#{RAILS_ROOT}/config/dryml_static_tags.txt"
|
127
|
-
else
|
128
|
-
File.join(File.dirname(__FILE__), "hobo/static_tags")
|
129
|
-
end
|
130
|
-
File.readlines(path).*.chop
|
131
|
-
end
|
132
|
-
end
|
133
|
-
|
134
|
-
attr_writer :static_tags
|
135
|
-
|
136
|
-
|
137
86
|
def subsites
|
138
87
|
# Any directory inside app/controllers defines a subsite
|
139
88
|
@subsites ||= Dir["#{RAILS_ROOT}/app/controllers/*"].map { |f| File.basename(f) if File.directory?(f) }.compact
|
@@ -149,12 +98,12 @@ module Hobo
|
|
149
98
|
require 'hobo/model_router'
|
150
99
|
require 'hobo/undefined'
|
151
100
|
require 'hobo/user'
|
152
|
-
require '
|
153
|
-
require '
|
154
|
-
require '
|
101
|
+
require 'dryml'
|
102
|
+
require 'dryml/template'
|
103
|
+
require 'dryml/dryml_generator'
|
155
104
|
|
156
105
|
Hobo::Model.enable
|
157
|
-
|
106
|
+
Dryml.enable(["#{HOBO_ROOT}/rapid_generators"], "#{RAILS_ROOT}/app/views/taglibs/auto")
|
158
107
|
Hobo::Permissions.enable
|
159
108
|
Hobo::ViewHints.enable
|
160
109
|
|
@@ -166,11 +115,7 @@ module Hobo
|
|
166
115
|
|
167
116
|
HoboFields.never_wrap(Hobo::Undefined) if defined? HoboFields
|
168
117
|
|
169
|
-
|
170
|
-
ActiveSupport::Dependencies.autoload_paths |= [ "#{RAILS_ROOT}/app/viewhints" ]
|
171
|
-
else
|
172
|
-
ActiveSupport::Dependencies.load_paths |= [ "#{RAILS_ROOT}/app/viewhints" ]
|
173
|
-
end
|
118
|
+
ActiveSupport::Dependencies.load_paths |= [ "#{RAILS_ROOT}/app/viewhints" ]
|
174
119
|
end
|
175
120
|
|
176
121
|
end
|
@@ -9,11 +9,7 @@ module Hobo
|
|
9
9
|
|
10
10
|
array = params_hash_to_array(array_or_hash)
|
11
11
|
array.map! do |record_hash_or_string|
|
12
|
-
|
13
|
-
finder = association.member_class
|
14
|
-
else
|
15
|
-
finder = association.member_class.scoped :conditions => association.conditions
|
16
|
-
end
|
12
|
+
finder = association.member_class.scoped :conditions => association.conditions
|
17
13
|
find_or_create_and_update(owner, association_name, finder, record_hash_or_string) do |id|
|
18
14
|
# The block is required to either locate find an existing record in the collection, or build a new one
|
19
15
|
if id
|
@@ -67,7 +67,7 @@ module Hobo
|
|
67
67
|
accepts.xml do
|
68
68
|
headers["Status"] = "Unauthorized"
|
69
69
|
headers["WWW-Authenticate"] = %(Basic realm="Web Password")
|
70
|
-
render :text => ht("hobo.messages.unauthenticated", :default=>["Couldn't authenticate you"]
|
70
|
+
render :text => ht("hobo.messages.unauthenticated", :default=>["Couldn't authenticate you"], :status => '401 Unauthorized')
|
71
71
|
end
|
72
72
|
end
|
73
73
|
false
|
data/lib/hobo/controller.rb
CHANGED
@@ -58,7 +58,7 @@ module Hobo
|
|
58
58
|
|
59
59
|
def redirect_to_with_object_url(destination, *args)
|
60
60
|
if destination.is_one_of?(String, Hash, Symbol)
|
61
|
-
redirect_to_without_object_url(destination
|
61
|
+
redirect_to_without_object_url(destination)
|
62
62
|
else
|
63
63
|
redirect_to_without_object_url(object_url(destination, *args))
|
64
64
|
end
|
@@ -80,7 +80,7 @@ module Hobo
|
|
80
80
|
|
81
81
|
def ajax_update_response(page_path, render_specs, results={})
|
82
82
|
@template.send(:_evaluate_assigns_and_ivars)
|
83
|
-
renderer =
|
83
|
+
renderer = Dryml.page_renderer(@template, [], page_path) if page_path
|
84
84
|
|
85
85
|
render :update do |page|
|
86
86
|
page << "var _update = typeof Hobo == 'undefined' ? Element.update : Hobo.updateElement;"
|
@@ -124,7 +124,7 @@ module Hobo
|
|
124
124
|
def tag_renderer
|
125
125
|
@tag_renderer ||= begin
|
126
126
|
@template.send(:_evaluate_assigns_and_ivars)
|
127
|
-
|
127
|
+
Dryml.empty_page_renderer(@template)
|
128
128
|
end
|
129
129
|
end
|
130
130
|
|
@@ -157,8 +157,8 @@ module Hobo
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def not_found(error)
|
160
|
-
if self.class.superclass.method_defined?(
|
161
|
-
|
160
|
+
if self.class.superclass.method_defined?(:not_found)
|
161
|
+
self.class.superclass.instance_method(:not_found).bind(self).call(error)
|
162
162
|
elsif render_tag("not-found-page", {}, :status => 404)
|
163
163
|
# cool
|
164
164
|
else
|