/
CHANGELOG
285 lines (143 loc) · 11.5 KB
/
CHANGELOG
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
=== HEAD
* Add :eager_loader association option, to specify code to be run when eager loading (jeremyevans)
* Make :many_to_one associations support :dataset, :order, :limit association options, as well as block arguments (jeremyevans)
* Add :dataset association option, which overrides the default base dataset to use (jeremyevans)
* Add :eager_graph association option, works just like :eager except it uses #eager_graph (jeremyevans)
* Make eager loading via #eager respect the :limit association option (jeremyevans)
* Add :graph_join_table_join_type association option (jeremyevans)
* Add :graph_only_conditions and :graph_join_table_only_conditions association options (jeremyevans)
* Add :graph_block and :graph_join_table_block association options (jeremyevans)
* Set the model's dataset's columns in addition to the model's columns when loading the schema for a model (jeremyevans)
* Make caching work correctly with subclasses (jeremyevans)
* Add the Model.to_hash dataset method (jeremyevans)
=== 2.1.0 (2008-06-17)
* Break association add_/remove_/remove_all_ methods into two parts, for easier overriding (jeremyevans)
* Add Model.strict_param_setting, on by default, which raises errors if a missing/restricted method is called via new/set/update/etc. (jeremyevans)
* Raise errors when using association methods on objects without valid primary keys (jeremyevans)
* The model's primary key is a restricted column by default, Add model.unrestrict_primary_key to get the old behavior (jeremyevans)
* Add Model.set_(allowed|restricted)_columns, which affect which columns create/new/set/update/etc. modify (jeremyevans)
* Calls to Model.def_dataset_method with a block are cached and reapplied to the new dataset if set_dataset is called, even in a subclass (jeremyevans)
* The :reciprocal option to associations should now be the symbol name of the reciprocal association, not an instance variable symbol (jeremyevans)
* Add Model#associations, which is a hash holding a cache of associated objects, with each association being a separate key (jeremyevans)
* Make all associations support a :graph_select option, specifying a column or array of columns to select when using eager_graph (jeremyevans)
* Bring back Model#set and Model#update, now the same as Model#set_with_params and Model#update_with_params (jeremyevans)
* Allow model datasets to call to_hash without any arguments, which allows easy creation of identity maps (jeremyevans)
* Add Model.set_sti_key, for easily setting up single table inheritance (jeremyevans)
* Make all associations support a :read_only option, which doesn't add methods that modify the database (jeremyevans)
* Make *_to_many associations support a :limit option, for specifying a limit to the resulting records (and possibly an offset) (jeremyevans)
* Make association block argument and :eager option affect the _dataset method (jeremyevans)
* Add a :one_to_one option to one_to_many associations, which creates a getter and setter similar to many_to_one (a.k.a. has_one) (jeremyevans)
* add_ and remove_ one_to_many association methods now raise an error if the passed object cannot be saved, instead of saving without validation (jeremyevans)
* Add support for :if option on validations, using a symbol (specifying an instance method) or a proc (dtsato)
=== 2.0.1 (2008-06-04)
* Make the choice of Time or DateTime optional for typecasting :datetime types, default to Time (jeremyevans)
* Reload database schema for table when calling Model.create_table (jeremyevans)
=== 2.0.0 (2008-06-01)
* Comprehensive update of all documentation (jeremyevans)
* Remove methods deprecated in 1.5.0 (jeremyevans)
* Add typecasting on attribute assignment to Sequel::Model objects, optional but enabled by default (jeremyevans)
* Returning false in one of the before_ hooks now causes the appropriate method(s) to immediately return false (jeremyevans)
* Add remove_all_* association method for *_to_many associations, which removes the association with all currently associated objects (jeremyevans)
* Add Model.lazy_load_schema=, when set to true, it loads the schema on first instantiation (jeremyevans)
* Add before_validation and after_validation hooks, called whenever the model is validated (jeremyevans)
* Add Model.default_foreign_key, a private class method that allows changing the default foreign key that Sequel will use in associations (jeremyevans)
* Cache negative lookup when eagerly loading many_to_one associations (jeremyevans)
* Make all associations support the :select option, not just many_to_many (jeremyevans)
* Allow the use of blocks when eager loading, and add the :eager_block and :allow_eager association options for configuration (jeremyevans)
* Add the :graph_join_type, :graph_conditions, and :graph_join_table_conditions association options, used when eager graphing (jeremyevans)
* Add AssociationReflection class (subclass of Hash), to make calling a couple of private Model methods unnecessary (jeremyevans)
* Change hook methods so that if a tag/method is specified it overwrites an existing hook block with the same tag/method (jeremyevans)
=== 1.5.1 (2008-04-30)
* Fix Dataset#eager_graph when not all objects have associated objects (jeremyevans)
=== 1.5.0 (2008-04-29)
* Make the validation errors API compatible with Merb (Inviz)
* Add validates_uniqueness_of, for protecting against duplicate entries in the database (neaf, jeremyevans)
* Alias Model#dataset= to Model#set_dataset (tmm1)
* Make some Model class methods private: def_hook_method, hooks, add_hook, plugin_module, plugin_gem (jeremyevans)
* Add the eager! and eager_graph! mutation methods to model datasets (jeremyevans)
* Remove Model.database_opened (jeremyevans)
* Remove Model.super_dataset (jeremyevans)
* Deprecate .create_with_params, .create_with, #set, #update, #update_with, and #new_record from Sequel::Model (jeremyevans)
* Add Model.def_dataset_method, for defining methods on the model that reference methods on the dataset (jeremyevans)
* Deprecate Model.method_missing, add dataset methods to Model via metaprogramming (jeremyevans)
* Remove Model.join, so it is the same as Dataset#join (jeremyevans)
* Use reciprocal associations for all types of associations in the getter/setter/add_/remove_ methods (jeremyevans)
* Fix many_to_one associations to cache negative lookups (jeremyevans)
* Change Model#=== to always be false if the primary key is nil (jeremyevans)
* Add Model#hash, which should be unique for a given class and primary key (or values if primary key is nil) (jeremyevans)
* Add Model#eql? as a alias to Model#== (jeremyevans)
* Make Model#reload clear any cached associations (jeremyevans)
* No longer depend on the assistance gem, merge the Inflector and Validations code (jeremyevans)
* Add Model#set_with_params, which is Model#update_with_params without the save (jeremyevans)
* Fix Model#destroy so that it returns self, not the result of after_destroy (jeremyevans)
* Define Model column accessors in set_dataset, so they should always be avaiable, deprecate Model#method_missing (jeremyevans)
* Add eager loading of associations via new sequel_core object graphing feature (jeremyevans)
* Fix many_to_many associations with classes inside modules without an explicit join table (jeremyevans)
* Allow creation of new records that don't have primary keys when the cache is on (jeremyevans) (#213)
* Make Model#initialize, Model#set, and Model#update_with_params invulnerable to memory exhaustion (jeremyevans) (#210)
* Add Model.str_columns, which gives a list of columns as frozen strings (jeremyevans)
* Remove pretty_table.rb from sequel, since it is in sequel_core (jeremyevans)
=== 1.4.0 (2008-04-08)
* Don't mark a column as changed unless the new value is different from the current value (tamas.denes, jeremyevans) (#203).
* Switch gem name from "sequel_model" to just "sequel", which required large version bump (jeremyevans).
* Add :select option to many_to_many associations, default to selecting only the associated model table and not the join table (jeremyevans) (#208).
* Add :reciprocal one_to_many association option, for setting corresponding many_to_one instance variable (jeremyevans).
* Add eager loading implementation (jeremyevans).
* Change *_to_many associations so that the all associations are considered :cache=>true (jeremyevans).
* Fix associations with block arguments and :cache=>true (jeremyevans).
=== 0.5.0.2 (2008-03-12)
* More fixes for Model.associate to accept strings and symbols as class references.
=== 0.5.0.1 (2008-03-09)
* Fixed Model.associate to accept class and class name in :class option.
=== 0.5 (2008-03-08)
* Merged new associations branch into trunk.
* Rewrote RDoc for associations.
* Added has_and_belongs_to_many alias for many_to_many.
* Added support for optional dataset block.
* Added :order option to order association datasets.
* Added :cache option to return and cache array of objects for association.
* Changed one_to_many, many_to_many associations to return dataset by default.
* Added has_many, belongs_to aliases.
* Refactored associations code.
* Added deprecations for old-style relations.
* Completed specs for new associations code.
* New associations code by Jeremy Evans (replaces relations code.)
=== 0.4.2 (2008-02-29)
* Fixed one_to_many implicit key to work correctly for namespaced classes (#167).
* Fixed Model.db= to affect the underlying dataset (#183).
* Fixed Model.implicit_table_name to disregard namespaces.
=== 0.4.1 (2008-02-10)
* Implemented Model#inspect (#151).
* Changed Model#method_missing to short-circuit and bypass checking #columns if the values hash already contains the relevant column (#150).
* Updated to reflect changes in sequel_core (Dataset#clone_merge renamed to Dataset#clone).
=== 0.4 (2008-02-05)
* Fixed Model#set to work with string keys (#143).
* Fixed Model.create to correctly initialize instances marked as new (#135).
* Fixed Model#initialize to convert string keys into symbol keys. This also fixes problem with validating objects initialized with string keys (#136).
=== 0.3.3 (2008-01-25)
* Finalized support for virtual attributes.
=== 0.3.2.1 (2008-01-24)
* Fixed Model.dataset to correctly set the dataset if using implicit naming or inheriting the superclass dataset (thanks celldee).
=== 0.3.2 (2008-01-24)
* Added Model#update_with_params method with support for virtual attributes and auto-filtering of unrelated parameters, and changed Model.create_with_params to support virtual attributes (#128).
* Cleaned up gem spec (#132).
* Removed validations code. Now relying on validations in assistance gem.
=== 0.3.1 (2008-01-21)
* Changed Model.dataset to use inflector to pluralize the class name into the table name. Works in similar fashion to table names in AR or DM.
=== 0.3 (2008-01-18)
* Implemented Validatable::Errors class.
* Added Model#reload as alias to Model#refresh.
* Changed Model.create to accept a block (#126).
* Rewrote validations.
* Fixed Model#initialize to accept nil values (#115).
=== 0.2 (2008-01-02)
* Removed deprecated Model.recreate_table method.
* Removed deprecated :class and :on options from one_to_many macro.
* Removed deprecated :class option from one_to_one macro.
* Removed deprecated Model#pkey method.
* Changed dependency to sequel_core.
* Removed examples from sequel core.
* Additional specs. We're now at 100% coverage.
* Refactored hooks code. Hooks are now inheritable, and can be defined by supplying a block or a method name, or by overriding the hook instance method. Hook chains can now be broken by returning false (#111, #112).
=== 0.1 (2007-12-30)
* Moved model code from sequel into separate model sub-project.