archive_2s 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -17,11 +17,22 @@ fetch by id only (as all that is saved is the id and a value of a method)
17
17
 
18
18
  All objects returned are readonly.
19
19
 
20
+ == Migration
21
+ See the last todo, this needs to me a generator/rake task but I am tired and want to goto sleep
22
+ create_table :archived_to_s do |t|
23
+ t.datetime :archived_at
24
+ t.string :model_type
25
+ t.integer :model_id
26
+ t.string :archived_value
27
+ end
28
+ add_index :archived_to_s, [:model_type,:model_id,:archived_at], :name => 'model_and_archive_date_idx', :unique => true
29
+
20
30
  ==Todo
21
31
  * make some proxy magic so if one calls a relationship if can search the archive too
22
32
  * use wants rather then returning based on length
23
33
  * drop the id column and use the index for the model
24
34
  * make the doco usefull
35
+ * make a generator for rails 2 and 3
25
36
 
26
37
  == Copyright
27
38
 
@@ -1,3 +1,3 @@
1
1
  module Archive2s
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
data/lib/archive_2s.rb CHANGED
@@ -5,7 +5,7 @@ module Archive2s
5
5
  :include_by_default => false
6
6
  }
7
7
  module ClassMethods
8
- def archive_2s(args)
8
+ def archive_2s(args = nil)
9
9
  # don't allow multiple calls
10
10
  return if self.included_modules.include?(Archive2s::InstanceMethods)
11
11
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: archive_2s
3
3
  version: !ruby/object:Gem::Version
4
- hash: 29
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 1
10
- version: 0.0.1
9
+ - 2
10
+ version: 0.0.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - SmashTank Apps, LLC
@@ -153,8 +153,6 @@ files:
153
153
  - bin/thor
154
154
  - bin/tilt
155
155
  - bin/tt
156
- - generators/archive_2s_model/archive_2s_model_generator.rb
157
- - generators/archive_2s_model/templates/create_archive_2s_model.rb
158
156
  - init.rb
159
157
  - lib/archive_2s.rb
160
158
  - lib/archive_2s/model.rb
@@ -1,5 +0,0 @@
1
- class Archive2sModelGenerator < Rails::Generator::Base
2
- def manifest
3
- m.migration_template 'templates/create_archive_2s_model.rb', "db/migrate"
4
- end
5
- end
@@ -1,16 +0,0 @@
1
- class CreateArchive2sModel < ActiveRecord::Migration
2
- def self.up
3
- create_table :archived_to_s do |t|
4
- t.datetime :archived_at
5
- t.string :model_type
6
- t.integer :model_id
7
- t.string :archived_value
8
- end
9
- add_index :archived_to_s, [:model_type,:model_id,:archived_at], :name => 'model_and_archive_date_idx', :unique => true
10
- end
11
-
12
- def self.down
13
- drop_table :archived_to_s
14
- end
15
- end
16
-