public
Fork of technoweenie/model_stubbing
Description: Rails 1.2.x compatible version - Replacement for ActiveRecord fixtures using an extremely flexible ruby-based approach.
Clone URL: git://github.com/jacqui/model_stubbing.git
Search Repo:
rails 1.2 compatible versions of insert methods in Model & Stub 
classes of the plugin
Jacqui Maher (author)
Fri Apr 18 13:54:40 -0700 2008
commit  7370f16fd7d3de626ba47538fa51999f54acfd0a
tree    7fc898f9a29e05bd92999b5c061156cd232c7d3f
parent  b5a8554bab7cbac87fd557dbc7eb6e4fdf7ca63b
...
93
94
95
96
97
98
99
...
93
94
95
 
96
97
98
0
@@ -93,7 +93,6 @@ module ModelStubbing
0
     end
0
     
0
     def insert
0
- Fixtures.cache_for_connection(connection).delete(@model_class.table_name) if defined?(Fixtures)
0
       purge
0
       @stubs.values.each &:insert
0
     end
...
51
52
53
54
 
55
56
57
...
51
52
53
 
54
55
56
57
0
@@ -51,7 +51,7 @@ module ModelStubbing
0
     
0
     def insert(attributes = {})
0
       object = record(attributes)
0
- connection.insert_fixture(object.stubbed_attributes, model.model_class.table_name)
0
+ connection.execute "INSERT INTO #{model.model_class.table_name} (#{object.stubbed_attributes.key_list}) VALUES (#{object.stubbed_attributes.value_list})", 'Fixture Insert'
0
     end
0
     
0
     def with(attributes)

Comments

    No one has commented yet.