memento 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  ---
2
2
  :major: 0
3
3
  :minor: 3
4
- :patch: 1
4
+ :patch: 2
5
5
  :build:
@@ -1,7 +1,7 @@
1
1
  class Memento::Session < ActiveRecord::Base
2
2
  set_table_name "memento_sessions"
3
3
 
4
- has_many :states, :class_name => "Memento::State", :dependent => :delete_all
4
+ has_many :states, :class_name => "Memento::State", :dependent => :delete_all, :order => "id DESC"
5
5
  belongs_to :user
6
6
  validates_presence_of :user
7
7
 
@@ -1,70 +1,56 @@
1
1
  # Generated by jeweler
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
3
+ # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{memento}
8
- s.version = "0.3.1"
8
+ s.version = "0.3.2"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Yolk Sebastian Munz & Julia Soergel GbR"]
12
- s.date = %q{2010-11-14}
12
+ s.date = %q{2011-07-12}
13
13
  s.email = %q{sebastian@yo.lk}
14
14
  s.extra_rdoc_files = [
15
15
  "LICENSE",
16
- "README.rdoc",
17
- "TODO"
16
+ "README.rdoc",
17
+ "TODO"
18
18
  ]
19
19
  s.files = [
20
- ".gitignore",
21
- "LICENSE",
22
- "README.rdoc",
23
- "Rakefile",
24
- "TODO",
25
- "VERSION.yml",
26
- "generators/memento_migration/memento_migration_generator.rb",
27
- "generators/memento_migration/templates/migration.rb",
28
- "init.rb",
29
- "lib/memento.rb",
30
- "lib/memento/action.rb",
31
- "lib/memento/action/create.rb",
32
- "lib/memento/action/destroy.rb",
33
- "lib/memento/action/update.rb",
34
- "lib/memento/action_controller_methods.rb",
35
- "lib/memento/active_record_methods.rb",
36
- "lib/memento/result.rb",
37
- "lib/memento/session.rb",
38
- "lib/memento/state.rb",
39
- "memento.gemspec",
40
- "spec/memento/action/create_spec.rb",
41
- "spec/memento/action/destroy_spec.rb",
42
- "spec/memento/action/update_spec.rb",
43
- "spec/memento/action_controller_methods_spec.rb",
44
- "spec/memento/active_record_methods_spec.rb",
45
- "spec/memento/result_spec.rb",
46
- "spec/memento/session_spec.rb",
47
- "spec/memento/state_spec.rb",
48
- "spec/memento_spec.rb",
49
- "spec/spec_helper.rb"
20
+ "LICENSE",
21
+ "README.rdoc",
22
+ "Rakefile",
23
+ "TODO",
24
+ "VERSION.yml",
25
+ "generators/memento_migration/memento_migration_generator.rb",
26
+ "generators/memento_migration/templates/migration.rb",
27
+ "init.rb",
28
+ "lib/memento.rb",
29
+ "lib/memento/action.rb",
30
+ "lib/memento/action/create.rb",
31
+ "lib/memento/action/destroy.rb",
32
+ "lib/memento/action/update.rb",
33
+ "lib/memento/action_controller_methods.rb",
34
+ "lib/memento/active_record_methods.rb",
35
+ "lib/memento/result.rb",
36
+ "lib/memento/session.rb",
37
+ "lib/memento/state.rb",
38
+ "memento.gemspec",
39
+ "spec/memento/action/create_spec.rb",
40
+ "spec/memento/action/destroy_spec.rb",
41
+ "spec/memento/action/update_spec.rb",
42
+ "spec/memento/action_controller_methods_spec.rb",
43
+ "spec/memento/active_record_methods_spec.rb",
44
+ "spec/memento/result_spec.rb",
45
+ "spec/memento/session_spec.rb",
46
+ "spec/memento/state_spec.rb",
47
+ "spec/memento_spec.rb",
48
+ "spec/spec_helper.rb"
50
49
  ]
51
50
  s.homepage = %q{http://github.com/yolk/memento}
52
- s.rdoc_options = ["--charset=UTF-8"]
53
51
  s.require_paths = ["lib"]
54
52
  s.rubygems_version = %q{1.3.7}
55
53
  s.summary = %q{Undo for Rails/ActiveRecord - covers destroy, update and create}
56
- s.test_files = [
57
- "spec/memento/action/create_spec.rb",
58
- "spec/memento/action/destroy_spec.rb",
59
- "spec/memento/action/update_spec.rb",
60
- "spec/memento/action_controller_methods_spec.rb",
61
- "spec/memento/active_record_methods_spec.rb",
62
- "spec/memento/result_spec.rb",
63
- "spec/memento/session_spec.rb",
64
- "spec/memento/state_spec.rb",
65
- "spec/memento_spec.rb",
66
- "spec/spec_helper.rb"
67
- ]
68
54
 
69
55
  if s.respond_to? :specification_version then
70
56
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
@@ -93,6 +93,10 @@ describe Memento::Session do
93
93
  lambda{ @session.undo! }.should raise_error(Memento::ErrorOnRewind)
94
94
  end
95
95
  end
96
+
97
+ it "should undo states in order of creation (newest first)" do
98
+ @session.undo.map(&:state).map(&:id).should eql([@state2.id, @state1.id])
99
+ end
96
100
  end
97
101
 
98
102
  describe "with states" do
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 3
8
- - 1
9
- version: 0.3.1
8
+ - 2
9
+ version: 0.3.2
10
10
  platform: ruby
11
11
  authors:
12
12
  - Yolk Sebastian Munz & Julia Soergel GbR
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-11-14 00:00:00 +01:00
17
+ date: 2011-07-12 00:00:00 +02:00
18
18
  default_executable:
19
19
  dependencies: []
20
20
 
@@ -29,7 +29,6 @@ extra_rdoc_files:
29
29
  - README.rdoc
30
30
  - TODO
31
31
  files:
32
- - .gitignore
33
32
  - LICENSE
34
33
  - README.rdoc
35
34
  - Rakefile
@@ -64,8 +63,8 @@ homepage: http://github.com/yolk/memento
64
63
  licenses: []
65
64
 
66
65
  post_install_message:
67
- rdoc_options:
68
- - --charset=UTF-8
66
+ rdoc_options: []
67
+
69
68
  require_paths:
70
69
  - lib
71
70
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -91,14 +90,5 @@ rubygems_version: 1.3.7
91
90
  signing_key:
92
91
  specification_version: 3
93
92
  summary: Undo for Rails/ActiveRecord - covers destroy, update and create
94
- test_files:
95
- - spec/memento/action/create_spec.rb
96
- - spec/memento/action/destroy_spec.rb
97
- - spec/memento/action/update_spec.rb
98
- - spec/memento/action_controller_methods_spec.rb
99
- - spec/memento/active_record_methods_spec.rb
100
- - spec/memento/result_spec.rb
101
- - spec/memento/session_spec.rb
102
- - spec/memento/state_spec.rb
103
- - spec/memento_spec.rb
104
- - spec/spec_helper.rb
93
+ test_files: []
94
+
data/.gitignore DELETED
@@ -1,6 +0,0 @@
1
- *.sw?
2
- .DS_Store
3
- coverage
4
- rdoc
5
- pkg
6
- .rvmrc