cbaclig-ar-extensions 0.9.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (112) hide show
  1. data/ChangeLog +148 -0
  2. data/Manifest +111 -0
  3. data/README +167 -0
  4. data/Rakefile +65 -0
  5. data/ar-extensions.gemspec +19 -0
  6. data/benchmarks/README +32 -0
  7. data/benchmarks/benchmark.rb +61 -0
  8. data/benchmarks/boot.rb +21 -0
  9. data/benchmarks/lib/base.rb +121 -0
  10. data/benchmarks/lib/cli_parser.rb +103 -0
  11. data/benchmarks/lib/float.rb +15 -0
  12. data/benchmarks/lib/mysql_benchmark.rb +27 -0
  13. data/benchmarks/lib/output_to_csv.rb +18 -0
  14. data/benchmarks/lib/output_to_html.rb +69 -0
  15. data/cbaclig-ar-extensions.gemspec +30 -0
  16. data/config/database.yml +7 -0
  17. data/config/database.yml.template +7 -0
  18. data/config/mysql.schema +72 -0
  19. data/config/postgresql.schema +39 -0
  20. data/db/migrate/generic_schema.rb +97 -0
  21. data/db/migrate/mysql_schema.rb +32 -0
  22. data/db/migrate/oracle_schema.rb +5 -0
  23. data/db/migrate/version.rb +4 -0
  24. data/init.rb +31 -0
  25. data/lib/ar-extensions.rb +5 -0
  26. data/lib/ar-extensions/adapters/abstract_adapter.rb +139 -0
  27. data/lib/ar-extensions/adapters/mysql.rb +10 -0
  28. data/lib/ar-extensions/adapters/oracle.rb +14 -0
  29. data/lib/ar-extensions/adapters/postgresql.rb +9 -0
  30. data/lib/ar-extensions/adapters/sqlite.rb +7 -0
  31. data/lib/ar-extensions/create_and_update.rb +509 -0
  32. data/lib/ar-extensions/create_and_update/mysql.rb +7 -0
  33. data/lib/ar-extensions/csv.rb +309 -0
  34. data/lib/ar-extensions/delete.rb +143 -0
  35. data/lib/ar-extensions/delete/mysql.rb +3 -0
  36. data/lib/ar-extensions/extensions.rb +506 -0
  37. data/lib/ar-extensions/finder_options.rb +275 -0
  38. data/lib/ar-extensions/finder_options/mysql.rb +6 -0
  39. data/lib/ar-extensions/finders.rb +94 -0
  40. data/lib/ar-extensions/foreign_keys.rb +70 -0
  41. data/lib/ar-extensions/fulltext.rb +62 -0
  42. data/lib/ar-extensions/fulltext/mysql.rb +44 -0
  43. data/lib/ar-extensions/import.rb +362 -0
  44. data/lib/ar-extensions/import/mysql.rb +50 -0
  45. data/lib/ar-extensions/import/postgresql.rb +7 -0
  46. data/lib/ar-extensions/import/sqlite.rb +22 -0
  47. data/lib/ar-extensions/insert_select.rb +178 -0
  48. data/lib/ar-extensions/insert_select/mysql.rb +7 -0
  49. data/lib/ar-extensions/synchronize.rb +30 -0
  50. data/lib/ar-extensions/temporary_table.rb +131 -0
  51. data/lib/ar-extensions/temporary_table/mysql.rb +3 -0
  52. data/lib/ar-extensions/union.rb +204 -0
  53. data/lib/ar-extensions/union/mysql.rb +6 -0
  54. data/lib/ar-extensions/util/sql_generation.rb +27 -0
  55. data/lib/ar-extensions/util/support_methods.rb +32 -0
  56. data/lib/ar-extensions/version.rb +9 -0
  57. data/tests/README +68 -0
  58. data/tests/boot.rb +23 -0
  59. data/tests/database.yml +31 -0
  60. data/tests/database.yml.sample +28 -0
  61. data/tests/fixtures/addresses.yml +25 -0
  62. data/tests/fixtures/books.yml +46 -0
  63. data/tests/fixtures/developers.yml +20 -0
  64. data/tests/fixtures/unit/active_record_base_finders/addresses.yml +25 -0
  65. data/tests/fixtures/unit/active_record_base_finders/books.yml +64 -0
  66. data/tests/fixtures/unit/active_record_base_finders/developers.yml +20 -0
  67. data/tests/fixtures/unit/synchronize/books.yml +16 -0
  68. data/tests/fixtures/unit/to_csv_headers/addresses.yml +8 -0
  69. data/tests/fixtures/unit/to_csv_headers/developers.yml +6 -0
  70. data/tests/fixtures/unit/to_csv_with_common_options/addresses.yml +40 -0
  71. data/tests/fixtures/unit/to_csv_with_common_options/developers.yml +13 -0
  72. data/tests/fixtures/unit/to_csv_with_common_options/languages.yml +29 -0
  73. data/tests/fixtures/unit/to_csv_with_common_options/teams.yml +3 -0
  74. data/tests/fixtures/unit/to_csv_with_default_options/developers.yml +7 -0
  75. data/tests/models/address.rb +4 -0
  76. data/tests/models/animal.rb +2 -0
  77. data/tests/models/book.rb +3 -0
  78. data/tests/models/cart_item.rb +4 -0
  79. data/tests/models/developer.rb +8 -0
  80. data/tests/models/group.rb +3 -0
  81. data/tests/models/language.rb +5 -0
  82. data/tests/models/mysql/book.rb +3 -0
  83. data/tests/models/mysql/test_innodb.rb +3 -0
  84. data/tests/models/mysql/test_memory.rb +3 -0
  85. data/tests/models/mysql/test_myisam.rb +3 -0
  86. data/tests/models/project.rb +2 -0
  87. data/tests/models/shopping_cart.rb +4 -0
  88. data/tests/models/team.rb +4 -0
  89. data/tests/models/topic.rb +13 -0
  90. data/tests/mysql/test_create_and_update.rb +290 -0
  91. data/tests/mysql/test_delete.rb +142 -0
  92. data/tests/mysql/test_finder_options.rb +121 -0
  93. data/tests/mysql/test_finders.rb +29 -0
  94. data/tests/mysql/test_import.rb +354 -0
  95. data/tests/mysql/test_insert_select.rb +173 -0
  96. data/tests/mysql/test_mysql_adapter.rb +45 -0
  97. data/tests/mysql/test_union.rb +81 -0
  98. data/tests/oracle/test_adapter.rb +14 -0
  99. data/tests/postgresql/test_adapter.rb +14 -0
  100. data/tests/prepare.rb +9 -0
  101. data/tests/run.rb +13 -0
  102. data/tests/run_from_gem.rb +17 -0
  103. data/tests/test_activerecord_compatability.rb +71 -0
  104. data/tests/test_finders.rb +543 -0
  105. data/tests/test_helper.rb +70 -0
  106. data/tests/test_import.rb +339 -0
  107. data/tests/test_synchronize.rb +31 -0
  108. data/tests/test_temporary_tables.rb +93 -0
  109. data/tests/test_to_csv_headers.rb +204 -0
  110. data/tests/test_to_csv_with_common_options.rb +670 -0
  111. data/tests/test_to_csv_with_default_options.rb +34 -0
  112. metadata +211 -0
data/ChangeLog ADDED
@@ -0,0 +1,148 @@
1
+ v0.9.2.1 First commit
2
+
3
+
4
+ 2009-07-22 zdennis <zach.dennis@gmail.com>
5
+
6
+ * Forgot to push past commit of fixing #sanitize_sql method signatures to supported passing in a table_name. This satisfies the change to the ActiveRecord API in Rails commit 489abfd3b23f3c4b3de86aeb3bde3970771c001b on April 20th.
7
+
8
+ 2009-04-17 blythedunham <blythedunham@gmail.com>
9
+
10
+ * Added MySQL support for save, create, replace options - :ignore, :on_duplicate_key_update, :keywords, :reload, :keywords, :pre_sql, :post_sql
11
+ * Added MySQL support for find options: :keywords, :pre_sql, :post_sql, :index_hint
12
+ * Added MySQL support for find_union and count_union
13
+ * Added MySQL support for insert_select
14
+ * Added MySQL support for delete_duplicates and delete_all :batch_size => X
15
+ * Updated :on_duplicate_update_key to accept a string in addition to array
16
+ * Fixed Find Extension Range bug to exclude end when ... used instead of ..
17
+
18
+ 2009-03-16 zdennis <zach.dennis@gmail.com>
19
+
20
+ * fixed Rails 2.3.1 and 2.3.2 compatibility issue (Stephen Heuer)
21
+
22
+ 2009-02-09 zdennis <zach.dennis@gmail.com>
23
+
24
+ * fixed issue in http://zdennis.lighthouseapp.com/projects/14379/tickets/14-join-table-conditions-broken
25
+ * Updated usage of Inflector to point to ActiveSupport::Inflector
26
+ * Fixed bug where finder conditions which use arext-suffixed keys and normal field keys would fail when using a conditions hash. (Gabe da Silveira)
27
+ * added timestamps options to not automatically add timestamps even if record timestamps is disabled in ActiveRecord::Base (Thibaud Guillaume-Gentil)
28
+ * Updated to use alias_method_chain so that multiple aliased finders remain intact (Marcus Crafter)
29
+
30
+ 2007-07-20 zdennis <zdennis@dhcp-22.atomicobject.localnet>
31
+
32
+ * Added patch from Michael Flester to fix bug with created_at/updated_at fields to use proper timezone.
33
+
34
+ 2007-07-18 zdennis <zdennis@dhcp-22.atomicobject.localnet>
35
+
36
+ * Added patch for Oracle support from Michael Flester.
37
+
38
+ 2007-05-05 zdennis <zdennis@elijah.local>
39
+
40
+ * Added ActiveRecord::Base::AbstractAdapter#synchronize method which allows a mass re-synchronization of ActiveRecord instances. This is similar to ActiveRecord::Base#reload except that it works on multiple instances at a time rather then one. This sends one query for all instances rather then 1 per instance reloaded.
41
+
42
+ * Fixed bug with URI encoded strings with a workaround in the Comparison extension. ActiveRecord needs to be fixed to not use the String#% method so strings that do contains percentage signs will not fail
43
+
44
+ * Applied patch from Grant Goodale to allow the Like extension to support arrays when using the '_contains' suffix
45
+
46
+ 2007-03-14 zdennis <zdennis@elijah.xrite.com>
47
+
48
+ * Fixed a bug by renaming the alias for the ActiveRecord::Base#quote method in finders.rb. See rubyforge bug #8996
49
+
50
+ * Made a .gemspec for ar-extensions
51
+
52
+ 2007-03-13 zdennis <zdennis@elijah>
53
+
54
+ * Added :datetime searching support for better finder support.
55
+
56
+ 2007-02-11 zdennis <zdennis@admin.aries>
57
+
58
+ * Updated to_csv and import functionality to work with Sqlite, Sqlite3, PostgreSQL and MySQL
59
+
60
+ * Updated RDOC for import, to_csv, better finders, temporary tables and foreign key support
61
+
62
+ 2007-01-29 zdennis <zdennis@mktec.com>
63
+
64
+ * Added initial support for temporary tables and permanent like tables.
65
+
66
+ 2007-01-24 zdennis <zdennis@mktec.com>
67
+
68
+ * Added dependency for Mocha 0.4.0 or higher for testing
69
+
70
+ * Fixed bug for import functionality where it was never actually splitting up values correctly (thx to Mark Van Holstyn!!)
71
+
72
+ 2007-01-09 zdennis <zdennis@aries>
73
+
74
+ * Added support for embedded to_csv includes
75
+
76
+ 2007-01-07 zdennis <zdennis@aries>
77
+
78
+ * Added fix to init.rb to only load CSV functionality if FasterCSV
79
+ is available, otherwise print a message to STDERR and continue.
80
+
81
+ * Added fix to tests/boot.rb which solves fixture_path issues in
82
+ ActiveRecord 1.14.4 and earlier. The fix is included Rails trunk
83
+ and will be available in Rails 1.2.
84
+
85
+ 2007-01-05 zdennis <zdennis@aries>
86
+
87
+ * Added ActiveRecord::Extensions::VERSION module which has the following constants: MAJOR, MINOR, REVISION
88
+
89
+ * Running rake tests are now smart enough to rebuild the database if they are required based on schema_info table.
90
+
91
+ * Added schema_info table for test database schemas.
92
+
93
+ 2006-12-29 zdennis <zdennis@aries>
94
+
95
+ * Updated the Rakefile to run an external ruby process when running test files rather then in the same ruby process that runs the Rakefile
96
+
97
+ * Updated the directory structure of lib/ to solve namespace issues.
98
+
99
+ 2006-12-22 Zach Dennis <zdennis@silver.dennis.network>
100
+
101
+ * Added rake tasks for sqlite and sqlite3 databases
102
+
103
+ * Added "does_not_match" as a suffix to better finders when working with Regular Expressions
104
+
105
+ * Added "not_between" suffix to better finders when working with Ranges
106
+
107
+ 2006-12-17 zdennis <zdennis@aries>
108
+
109
+ * Added :only and :except options to to_csv method. Forcing
110
+ compatibility with http://blog.integralimpressions.com/articles/2006/09/01/tocsv-plugin
111
+
112
+ * Changed to_csv option :headers take a boolean rather then an
113
+ array of column names.
114
+
115
+ * Added rake task db:prepare_<adapter_name> to build test
116
+ database.
117
+
118
+ 2006-12-16 Zach Dennis <zdennis@silver.dennis.network>
119
+
120
+ * Added more tests for better finder support
121
+
122
+ * Added to_csv support for Arrays returned by ActiveRecord::Base.find
123
+
124
+ * Refactored ActiveRecord::Extensions::Registry to use an Array instead of hash
125
+
126
+ 2006-12-06 Zach Dennis <zdennis@silver.dennis.network>
127
+
128
+ * PostgreSQL has tested support for everything MySQL has except for Full Text Searching. This is not implemented.
129
+
130
+ * Refactored how import and full text searching implementation is handled, this is largely handled by duck typing certain method calls.
131
+
132
+ * Added generic import support for any adapter that doesn't support multi-value insert statements. This provides generic support which is guaranteed to be no slower then ActiveRecord#create.
133
+
134
+ 2006-11-23 Zach Dennis <zdennis@silver.dennis.network>
135
+
136
+ * Added finder support for PostgreSQL including Regexp Searching. (No full text searching though)
137
+
138
+ * Fixed bug in finders.rb where NULL searches were not correctly being translated into IS NULL when doing { :column => nil }
139
+
140
+ 2006-11-20 Zach Dennis <zach.dennis@gmail.com>
141
+
142
+ * Refactored core finder components out into ActiveRecord extensions
143
+
144
+ * Duck typing support for any object that is passed in to a conditions hash. ie: MyModel.find( :all, :conditions=>{ :name=>NameSearchObject.new } )
145
+
146
+ * Duck typing support for any object that is passed in as a condition. ie: MyModel.find( :all, :conditions=>SearchObject.new )
147
+
148
+
data/Manifest ADDED
@@ -0,0 +1,111 @@
1
+ ChangeLog
2
+ README
3
+ Rakefile
4
+ ar-extensions.gemspec
5
+ benchmarks/README
6
+ benchmarks/benchmark.rb
7
+ benchmarks/boot.rb
8
+ benchmarks/lib/base.rb
9
+ benchmarks/lib/cli_parser.rb
10
+ benchmarks/lib/float.rb
11
+ benchmarks/lib/mysql_benchmark.rb
12
+ benchmarks/lib/output_to_csv.rb
13
+ benchmarks/lib/output_to_html.rb
14
+ cbaclig-ar-extensions.gemspec
15
+ config/database.yml
16
+ config/database.yml.template
17
+ config/mysql.schema
18
+ config/postgresql.schema
19
+ db/migrate/generic_schema.rb
20
+ db/migrate/mysql_schema.rb
21
+ db/migrate/oracle_schema.rb
22
+ db/migrate/version.rb
23
+ init.rb
24
+ lib/ar-extensions.rb
25
+ lib/ar-extensions/adapters/abstract_adapter.rb
26
+ lib/ar-extensions/adapters/mysql.rb
27
+ lib/ar-extensions/adapters/oracle.rb
28
+ lib/ar-extensions/adapters/postgresql.rb
29
+ lib/ar-extensions/adapters/sqlite.rb
30
+ lib/ar-extensions/create_and_update.rb
31
+ lib/ar-extensions/create_and_update/mysql.rb
32
+ lib/ar-extensions/csv.rb
33
+ lib/ar-extensions/delete.rb
34
+ lib/ar-extensions/delete/mysql.rb
35
+ lib/ar-extensions/extensions.rb
36
+ lib/ar-extensions/finder_options.rb
37
+ lib/ar-extensions/finder_options/mysql.rb
38
+ lib/ar-extensions/finders.rb
39
+ lib/ar-extensions/foreign_keys.rb
40
+ lib/ar-extensions/fulltext.rb
41
+ lib/ar-extensions/fulltext/mysql.rb
42
+ lib/ar-extensions/import.rb
43
+ lib/ar-extensions/import/mysql.rb
44
+ lib/ar-extensions/import/postgresql.rb
45
+ lib/ar-extensions/import/sqlite.rb
46
+ lib/ar-extensions/insert_select.rb
47
+ lib/ar-extensions/insert_select/mysql.rb
48
+ lib/ar-extensions/synchronize.rb
49
+ lib/ar-extensions/temporary_table.rb
50
+ lib/ar-extensions/temporary_table/mysql.rb
51
+ lib/ar-extensions/union.rb
52
+ lib/ar-extensions/union/mysql.rb
53
+ lib/ar-extensions/util/sql_generation.rb
54
+ lib/ar-extensions/util/support_methods.rb
55
+ lib/ar-extensions/version.rb
56
+ tests/README
57
+ tests/boot.rb
58
+ tests/database.yml
59
+ tests/database.yml.sample
60
+ tests/fixtures/addresses.yml
61
+ tests/fixtures/books.yml
62
+ tests/fixtures/developers.yml
63
+ tests/fixtures/unit/active_record_base_finders/addresses.yml
64
+ tests/fixtures/unit/active_record_base_finders/books.yml
65
+ tests/fixtures/unit/active_record_base_finders/developers.yml
66
+ tests/fixtures/unit/synchronize/books.yml
67
+ tests/fixtures/unit/to_csv_headers/addresses.yml
68
+ tests/fixtures/unit/to_csv_headers/developers.yml
69
+ tests/fixtures/unit/to_csv_with_common_options/addresses.yml
70
+ tests/fixtures/unit/to_csv_with_common_options/developers.yml
71
+ tests/fixtures/unit/to_csv_with_common_options/languages.yml
72
+ tests/fixtures/unit/to_csv_with_common_options/teams.yml
73
+ tests/fixtures/unit/to_csv_with_default_options/developers.yml
74
+ tests/models/address.rb
75
+ tests/models/animal.rb
76
+ tests/models/book.rb
77
+ tests/models/cart_item.rb
78
+ tests/models/developer.rb
79
+ tests/models/group.rb
80
+ tests/models/language.rb
81
+ tests/models/mysql/book.rb
82
+ tests/models/mysql/test_innodb.rb
83
+ tests/models/mysql/test_memory.rb
84
+ tests/models/mysql/test_myisam.rb
85
+ tests/models/project.rb
86
+ tests/models/shopping_cart.rb
87
+ tests/models/team.rb
88
+ tests/models/topic.rb
89
+ tests/mysql/test_create_and_update.rb
90
+ tests/mysql/test_delete.rb
91
+ tests/mysql/test_finder_options.rb
92
+ tests/mysql/test_finders.rb
93
+ tests/mysql/test_import.rb
94
+ tests/mysql/test_insert_select.rb
95
+ tests/mysql/test_mysql_adapter.rb
96
+ tests/mysql/test_union.rb
97
+ tests/oracle/test_adapter.rb
98
+ tests/postgresql/test_adapter.rb
99
+ tests/prepare.rb
100
+ tests/run.rb
101
+ tests/run_from_gem.rb
102
+ tests/test_activerecord_compatability.rb
103
+ tests/test_finders.rb
104
+ tests/test_helper.rb
105
+ tests/test_import.rb
106
+ tests/test_synchronize.rb
107
+ tests/test_temporary_tables.rb
108
+ tests/test_to_csv_headers.rb
109
+ tests/test_to_csv_with_common_options.rb
110
+ tests/test_to_csv_with_default_options.rb
111
+ Manifest
data/README ADDED
@@ -0,0 +1,167 @@
1
+ LICENSE
2
+ ----------
3
+ This is licensed under the ruby license.
4
+
5
+ Author: Zach Dennis
6
+ Web Site: http://www.continuousthinking.com/tags/arext
7
+ Email: zach.dennis@gmail.com
8
+
9
+ - For How-To information see http://www.continuousthinking.com/tags/arext
10
+ - For project information and feedback please consult http://rubyforge.org/projects/arext/
11
+ - For release information please see below
12
+
13
+ ActiveRecord::Extensions 0.9.0, 0.9.1
14
+ ------------------------------
15
+ April 17, 2009
16
+ - Added MySQL support for save, create, replace options - :ignore, :on_duplicate_key_update, :keywords, :reload, :keywords, :pre_sql, :post_sql
17
+ - Added MySQL support for find options: :keywords, :pre_sql, :post_sql, :index_hint
18
+ - Added MySQL support for find_union and count_union
19
+ - Added MySQL support for insert_select
20
+ - Added MySQL support for delete_duplicates and delete_all :batch_size => X
21
+ - Updated :on_duplicate_update_key to accept a string in addition to array
22
+ - Fixed Find Extension Range bug to exclude end when ... used instead of ..
23
+
24
+ ActiveRecord::Extensions 0.8.2
25
+ ------------------------------
26
+ March 16th, 2009
27
+ - Rails 2.3.1 and 2.3.2 compatibility added
28
+ - Rails 2.1.2 and 2.2.2 compatibility preserved
29
+
30
+ AciveRecord::Extensions 0.7.0
31
+ -----------------------------
32
+ July 20th, 2007
33
+ - Fixes timezone issue (thanks Michael Flester)
34
+ - Adds better finder and import support for Oracle (thanks Michael Flester)
35
+ - Committed patch to fix MySQL query padding, thanks to Gabe da Silveira
36
+ - Added functionality for MySQL to work with created_on, created_at, updated_on or updated_at fields
37
+ - Added more test coverage for import functionality
38
+
39
+ ActiveRecord::Extensions 0.6.0
40
+ ------------------------------
41
+ May 5th, 2007
42
+ - Fixed bug with URI escaped strings and the Comparison better finder extension
43
+ - Added support for arrays with the Like better finder extension when using the '_contains' suffix
44
+ - Added 'synchronize' support for ActiveRecord::Base instances when using Import functionality
45
+
46
+ ActiveRecord::Extensions 0.5.2
47
+ ------------------------------
48
+ March 14th, 2007
49
+ - Fixed Rubyforge bug #8996 by renaming alias in finders.rb to the ActiveRecord::Base#quote method
50
+
51
+ ActiveRecord::Extensions 0.5.1
52
+ ------------------------------
53
+ March 14th, 2007
54
+ - Released as a rubygem
55
+ - Added a .gemspec file
56
+
57
+ ActiveRecord::Extensions 0.5.0
58
+ ------------------------------
59
+ March 13th, 2007
60
+ - Added Time based query support which works on ActiveRecord columns which match a type supported by :datetime
61
+
62
+ ActiveRecord::Extensions 0.4.0
63
+ ------------------------------
64
+ February 11th, 2007
65
+ - Added to_csv functionality
66
+ - Added temporary table support (MySQL)
67
+ - Added foreign key support (MySQL)
68
+ - Updated tests to keep schema information. Test database will automatically rebuild themselves if they are out of sync
69
+ - Added dependency for Mocha 0.4.0 or higher for tests
70
+
71
+ ActiveRecord::Extensions 0.3.0
72
+ ------------------------------
73
+ December 29th, 2006
74
+ - Updates to the lib/ directory structure to avoid namespace issues.
75
+ - Updates to the Rakefile to run an external ruby process for tests rather then the same
76
+ ruby process that runs the rake tasks
77
+
78
+ ActiveRecord::Extensions 0.2.0
79
+ ------------------------------
80
+ December 22nd, 2006
81
+ - Updates to_csv method for arrays returned by ActiveRecord::Base.find
82
+ - Adds does_not_match suffix for regular expression based conditions, ie: :field_does_not_match => /regex/
83
+ - Adds not_between suffix for ange based conditions, ie: :id_not_between => ( 0 .. 1 )
84
+ - Adds SQLite and SQLite3 support for better finders.
85
+ - Updates rake tasks for sqlite and sqlite3.
86
+ - Added rake tasks to use database migrations rather then raw SQL schema files.
87
+
88
+ ActiveRecord::Extensions 0.1.0
89
+ -------------------------------
90
+ December 16th, 2006
91
+ - Adds to_csv method to arrays returned by ActiveRecord::Base.find.
92
+ - Fixes bug in ActiveRecord::Extensions::Registry when processing key/value pairs where
93
+ the order of certain Extensions was not handled correctly due to Hash usage.
94
+ - Refactoring of ActiveRecord::Extensions::Registry
95
+ - Added more tests for better finder support
96
+
97
+ ActiveRecord::Extensions 0.0.6
98
+ ------------------------------
99
+ December 5th, 2006
100
+ - Added generic support for import functionality for all adapters
101
+ - Includes rake testing tasks for postgresql
102
+ - Includes postgresql support for all extensions except for full text searching (which is only mysql)
103
+ - Refactored directory structure of tests, import functionality and fulltext functionality
104
+
105
+
106
+ ActiveRecord::Extensions 0.0.5
107
+ ------------------------------
108
+ October 20th, 2006.
109
+ - Fixes two bugs which broke normal ActiveRecord behavior
110
+ - Fully complaint with Rails 1.1.0 thru 1.1.6 (and all ActiveRecord versions released with those)
111
+ - Inlcudes new Rakefile
112
+ - Includes rake task "test:mysql" which allows ActiveRecord::Extensions to be tested with mysql
113
+ - Includes rake test "test:activerecord:mysql" which allows ActiveRecord's tests to be tested with the
114
+ ActiveRecord::Extensions library
115
+
116
+
117
+ ActiveRecord::Extensions 0.0.4
118
+ -------------------------------
119
+ August 26th, 2006. Released at RubyConf*MI.
120
+ September 24th, 2006, Rubyforge release.
121
+ - Inlcudes "Better Finder" support for ActiveRecord
122
+ http://blogs.mktec.com/zdennis/pages/ARE_finders
123
+
124
+
125
+ ActiveRecord::Extensions 0.0.3
126
+ -------------------------------
127
+ Released.... ????
128
+ - the project has been named ActiveRecord::Extensions.
129
+
130
+
131
+ ActiveRecord::Optimizations 0.0.2
132
+ ---------------------------------
133
+ July 20th, 11:27pm, Zach Dennis
134
+
135
+ This includes some of the optimizations for the ActiveRecord::Base. This release only supports the MysqlAdapter, although other adapters will be supported in upcoming releases.
136
+
137
+ HOW-TO USAGE
138
+ ------------
139
+ Require the two files in the lib/ directory and then create records using:
140
+ Model.create array_of_hashes
141
+
142
+ Example:
143
+ class LogEntry < ActiveRecord::Base ; end
144
+ LogEntry.import [ { :log_entry_name=>"Name" }, {:log_entry_name=>"Name2"}, ... ], :optimize=>true
145
+
146
+ Using the optimized create method will return the number of inserts performed, rather then an array of LogEntry objects. This currently skips model validation.
147
+
148
+
149
+ CHANGELOG
150
+ ----------
151
+ 0.0.2
152
+ - add some documentation to the updated methods for ActiveRecord and MysqlAdapter
153
+ - renamed the create optimizatin to import. Multi-value inserts can be obtained using ActiveRecord::Base.import
154
+ 0.0.1
155
+ - introduced updates to ActiveRecord::Base.create to support multi-value inserts
156
+
157
+
158
+ UPCOMING
159
+ ----------
160
+ - model validation on imports
161
+ - postgresql support for imports
162
+ - ability to use regular expressions for db searches
163
+ - ability to use db functions
164
+ - temporary table support
165
+ - memory table support
166
+ - complex update with on duplicate key update support
167
+
data/Rakefile ADDED
@@ -0,0 +1,65 @@
1
+ require "pathname"
2
+ require "rubygems"
3
+ require "rake"
4
+ require "rake/testtask"
5
+
6
+ require 'echoe'
7
+ Echoe.new('cbaclig-ar-extensions')
8
+
9
+
10
+ DIR = Pathname.new(File.dirname(__FILE__))
11
+ ADAPTERS = %w(mysql postgresql sqlite sqlite3 oracle)
12
+
13
+ task :default => ["test:mysql"]
14
+
15
+ task :boot do
16
+ require DIR.join("lib", "ar-extensions").expand_path
17
+ require DIR.join("db", "migrate", "version").expand_path
18
+ end
19
+
20
+ ADAPTERS.each do |adapter|
21
+ namespace :db do
22
+ namespace :test do
23
+ desc "Builds test database for #{adapter}"
24
+ task "prepare_#{adapter}" do
25
+ ruby "#{DIR.join('tests', 'prepare.rb')} #{adapter}"
26
+ end
27
+ end
28
+ end
29
+
30
+ namespace :test do
31
+ desc "Test base extensions for #{adapter}"
32
+ task(adapter) do
33
+ ENV["ARE_DB"] = adapter
34
+ Rake::Task["db:test:prepare_#{adapter}"].invoke
35
+ ruby "#{DIR.join('tests', 'run.rb')} #{adapter}"
36
+ end
37
+ end
38
+
39
+ namespace :activerecord do
40
+ desc "Runs ActiveRecord unit tests for #{adapter} with ActiveRecord::Extensions"
41
+ task(adapter) do
42
+ activerecord_dir = ARGV[1]
43
+ if activerecord_dir.nil? || !File.directory?(activerecord_dir)
44
+ puts "ERROR: Pass in the path to ActiveRecord. Eg: /home/zdennis/rails_trunk/activerecord"
45
+ exit
46
+ end
47
+
48
+ old_dir, old_env = Dir.pwd, ENV["RUBYOPT"]
49
+ Dir.chdir(activerecord_dir)
50
+ ENV["RUBYOPT"] = "-r#{File.join(old_dir,'init.rb')}"
51
+
52
+ load "Rakefile"
53
+
54
+ Rake::Task["test_#{adapter}"].invoke
55
+ Dir.chdir(old_dir)
56
+ ENV["RUBYOPT"] = old_env
57
+ end
58
+
59
+ desc "Runs ActiveRecord unit tests for #{adapter} with ActiveRecord::Extensions with ALL available #{adapter} functionality"
60
+ task "#{adapter}_all" do
61
+ ENV["LOAD_ADAPTER_EXTENSIONS"] = adapter
62
+ Rake::Task["test:activerecord:#{adapter}"].invoke
63
+ end
64
+ end
65
+ end