scaffolding_extensions 1.1.5 → 1.1.6
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/README +2 -2
- data/doc/advanced.txt +0 -6
- data/doc/conversion.txt +3 -3
- data/lib/scaffolding_extensions/model/sequel.rb +10 -11
- metadata +12 -3
data/README
CHANGED
@@ -28,7 +28,7 @@ Scaffolding Extensions currently supports:
|
|
28
28
|
* Object/Relational Mappers
|
29
29
|
* ActiveRecord 2.1
|
30
30
|
* DataMapper 0.3.1
|
31
|
-
* Sequel 2.0
|
31
|
+
* Sequel 2.1.0
|
32
32
|
* Javascript Libaries (used for Ajax/Autocompleting)
|
33
33
|
* Prototype 1.6.0.1
|
34
34
|
* JQuery 1.2.3
|
@@ -49,7 +49,7 @@ You can get Scaffolding Extensions via git or as a gem:
|
|
49
49
|
* gem: sudo gem install scaffolding_extensions
|
50
50
|
* demo: http://scaffolding-extensions.jeremyevans.net
|
51
51
|
* github: http://github.com/jeremyevans/scaffolding_extensions
|
52
|
-
* RDoc: http://
|
52
|
+
* RDoc: http://scaffolding-ext.rubyforge.org
|
53
53
|
* Bug Tracker: http://rubyforge.org/tracker/?atid=22169&group_id=5726&func=browse
|
54
54
|
* Forum: http://rubyforge.org/forum/forum.php?forum_id=22403
|
55
55
|
|
data/doc/advanced.txt
CHANGED
@@ -72,9 +72,6 @@ Note how :sql_name can pull in data from multiple tables, since they are
|
|
72
72
|
specified via @scaffold_include. Note that the syntax might be database
|
73
73
|
specific (the accounting applation only supports PostreSQL).
|
74
74
|
|
75
|
-
Autocompleting currently requires the Prototype library (prototype.js,
|
76
|
-
effects.js, and controls.js).
|
77
|
-
|
78
75
|
== Customization
|
79
76
|
|
80
77
|
Scaffolding Extensions is extremely customizable. The database layer is split
|
@@ -136,9 +133,6 @@ objects to the association via Ajax. There is also a list of currently
|
|
136
133
|
associated objects that can be removed from the associated via Ajax. This
|
137
134
|
allows for quick modification of habtm associations.
|
138
135
|
|
139
|
-
HABTM Ajax functionality currently requires the Prototype library
|
140
|
-
(prototype.js).
|
141
|
-
|
142
136
|
== merge scaffolding
|
143
137
|
|
144
138
|
By default, Scaffolding Extensions will produce a merge scaffold for every
|
data/doc/conversion.txt
CHANGED
@@ -97,6 +97,6 @@ If you can't upgrade to the new version of the plugin and you want to use the
|
|
97
97
|
old version, use the following svn revision depending on the version of Rails
|
98
98
|
you are using:
|
99
99
|
|
100
|
-
Rails 2.0: svn revision 89
|
101
|
-
Rails 1.2: svn revision 81
|
102
|
-
Rails 1.1: svn revision 61
|
100
|
+
- Rails 2.0: svn revision 89
|
101
|
+
- Rails 1.2: svn revision 81
|
102
|
+
- Rails 1.1: svn revision 61
|
@@ -105,6 +105,9 @@ module ScaffoldingExtensions::MetaSequel
|
|
105
105
|
# Retrieve multiple objects given a hash of options
|
106
106
|
def scaffold_get_objects(options)
|
107
107
|
records = dataset
|
108
|
+
records = records.send(scaffold_use_eager_graph ? :eager_graph : :eager, *options[:include]) if options[:include]
|
109
|
+
records = records.order(*options[:order]) if options[:order]
|
110
|
+
records = records.limit(options[:limit], options[:offset]) if options[:limit]
|
108
111
|
conditions = options[:conditions]
|
109
112
|
if conditions && Array === conditions && conditions.length > 0
|
110
113
|
if String === conditions[0]
|
@@ -120,17 +123,6 @@ module ScaffoldingExtensions::MetaSequel
|
|
120
123
|
end
|
121
124
|
end
|
122
125
|
end
|
123
|
-
order = options[:order]
|
124
|
-
order = [order] unless Array === order
|
125
|
-
order.each do |o|
|
126
|
-
next if o.nil?
|
127
|
-
records = case o
|
128
|
-
when Proc then records.order(&o)
|
129
|
-
else records.order(o)
|
130
|
-
end
|
131
|
-
end
|
132
|
-
records = records.eager(options[:include]) if options[:include]
|
133
|
-
records = records.limit(options[:limit], options[:offset]) if options[:limit]
|
134
126
|
records.all
|
135
127
|
end
|
136
128
|
|
@@ -180,6 +172,13 @@ module ScaffoldingExtensions::MetaSequel
|
|
180
172
|
table_name
|
181
173
|
end
|
182
174
|
|
175
|
+
# Whether to use eager_graph instead of eager for eager loading. This is
|
176
|
+
# necessary if you need to reference associated tables when filtering.
|
177
|
+
# Can be set with an instance variable.
|
178
|
+
def scaffold_use_eager_graph
|
179
|
+
@scaffold_use_eager_graph ||= false
|
180
|
+
end
|
181
|
+
|
183
182
|
# Sequel doesn't allow you to use transaction on a model (only on a database),
|
184
183
|
# so add a transaction method that starts a transaction on the associated database.
|
185
184
|
def transaction(&block)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: scaffolding_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jeremy Evans
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-06-
|
12
|
+
date: 2008-06-26 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -82,13 +82,22 @@ files:
|
|
82
82
|
- scaffolds/show.rhtml
|
83
83
|
- test/scaffolding_extensions_test.rb
|
84
84
|
has_rdoc: true
|
85
|
-
homepage: http://
|
85
|
+
homepage: http://scaffolding-ext.rubyforge.org/
|
86
86
|
post_install_message:
|
87
87
|
rdoc_options:
|
88
88
|
- --inline-source
|
89
89
|
- --line-numbers
|
90
90
|
- README
|
91
|
+
- LICENSE
|
91
92
|
- lib
|
93
|
+
- doc/advanced.txt
|
94
|
+
- doc/camping.txt
|
95
|
+
- doc/controller_spec.txt
|
96
|
+
- doc/conversion.txt
|
97
|
+
- doc/model_spec.txt
|
98
|
+
- doc/ramaze.txt
|
99
|
+
- doc/sinatra.txt
|
100
|
+
- doc/testing.txt
|
92
101
|
require_paths:
|
93
102
|
- lib
|
94
103
|
required_ruby_version: !ruby/object:Gem::Requirement
|