Redmine 3.4.4
This commit is contained in:
commit
64924a6376
2112 changed files with 259028 additions and 0 deletions
6
lib/plugins/acts_as_versioned/test/fixtures/authors.yml
vendored
Normal file
6
lib/plugins/acts_as_versioned/test/fixtures/authors.yml
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
caged:
|
||||
id: 1
|
||||
name: caged
|
||||
mly:
|
||||
id: 2
|
||||
name: mly
|
3
lib/plugins/acts_as_versioned/test/fixtures/landmark.rb
vendored
Normal file
3
lib/plugins/acts_as_versioned/test/fixtures/landmark.rb
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
class Landmark < ActiveRecord::Base
|
||||
acts_as_versioned :if_changed => [ :name, :longitude, :latitude ]
|
||||
end
|
7
lib/plugins/acts_as_versioned/test/fixtures/landmark_versions.yml
vendored
Normal file
7
lib/plugins/acts_as_versioned/test/fixtures/landmark_versions.yml
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
washington:
|
||||
id: 1
|
||||
landmark_id: 1
|
||||
version: 1
|
||||
name: Washington, D.C.
|
||||
latitude: 38.895
|
||||
longitude: -77.036667
|
6
lib/plugins/acts_as_versioned/test/fixtures/landmarks.yml
vendored
Normal file
6
lib/plugins/acts_as_versioned/test/fixtures/landmarks.yml
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
washington:
|
||||
id: 1
|
||||
name: Washington, D.C.
|
||||
latitude: 38.895
|
||||
longitude: -77.036667
|
||||
version: 1
|
10
lib/plugins/acts_as_versioned/test/fixtures/locked_pages.yml
vendored
Normal file
10
lib/plugins/acts_as_versioned/test/fixtures/locked_pages.yml
vendored
Normal file
|
@ -0,0 +1,10 @@
|
|||
welcome:
|
||||
id: 1
|
||||
title: Welcome to the weblog
|
||||
lock_version: 24
|
||||
type: LockedPage
|
||||
thinking:
|
||||
id: 2
|
||||
title: So I was thinking
|
||||
lock_version: 24
|
||||
type: SpecialLockedPage
|
27
lib/plugins/acts_as_versioned/test/fixtures/locked_pages_revisions.yml
vendored
Normal file
27
lib/plugins/acts_as_versioned/test/fixtures/locked_pages_revisions.yml
vendored
Normal file
|
@ -0,0 +1,27 @@
|
|||
welcome_1:
|
||||
id: 1
|
||||
page_id: 1
|
||||
title: Welcome to the weblg
|
||||
version: 23
|
||||
version_type: LockedPage
|
||||
|
||||
welcome_2:
|
||||
id: 2
|
||||
page_id: 1
|
||||
title: Welcome to the weblog
|
||||
version: 24
|
||||
version_type: LockedPage
|
||||
|
||||
thinking_1:
|
||||
id: 3
|
||||
page_id: 2
|
||||
title: So I was thinking!!!
|
||||
version: 23
|
||||
version_type: SpecialLockedPage
|
||||
|
||||
thinking_2:
|
||||
id: 4
|
||||
page_id: 2
|
||||
title: So I was thinking
|
||||
version: 24
|
||||
version_type: SpecialLockedPage
|
13
lib/plugins/acts_as_versioned/test/fixtures/migrations/1_add_versioned_tables.rb
vendored
Normal file
13
lib/plugins/acts_as_versioned/test/fixtures/migrations/1_add_versioned_tables.rb
vendored
Normal file
|
@ -0,0 +1,13 @@
|
|||
class AddVersionedTables < ActiveRecord::Migration
|
||||
def self.up
|
||||
create_table("things") do |t|
|
||||
t.column :title, :text
|
||||
end
|
||||
Thing.create_versioned_table
|
||||
end
|
||||
|
||||
def self.down
|
||||
Thing.drop_versioned_table
|
||||
drop_table "things" rescue nil
|
||||
end
|
||||
end
|
43
lib/plugins/acts_as_versioned/test/fixtures/page.rb
vendored
Normal file
43
lib/plugins/acts_as_versioned/test/fixtures/page.rb
vendored
Normal file
|
@ -0,0 +1,43 @@
|
|||
class Page < ActiveRecord::Base
|
||||
belongs_to :author
|
||||
has_many :authors, :through => :versions, :order => 'name'
|
||||
belongs_to :revisor, :class_name => 'Author'
|
||||
has_many :revisors, :class_name => 'Author', :through => :versions, :order => 'name'
|
||||
acts_as_versioned :if => :feeling_good? do
|
||||
def self.included(base)
|
||||
base.cattr_accessor :feeling_good
|
||||
base.feeling_good = true
|
||||
base.belongs_to :author
|
||||
base.belongs_to :revisor, :class_name => 'Author'
|
||||
end
|
||||
|
||||
def feeling_good?
|
||||
@@feeling_good == true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
module LockedPageExtension
|
||||
def hello_world
|
||||
'hello_world'
|
||||
end
|
||||
end
|
||||
|
||||
class LockedPage < ActiveRecord::Base
|
||||
acts_as_versioned \
|
||||
:inheritance_column => :version_type,
|
||||
:foreign_key => :page_id,
|
||||
:table_name => :locked_pages_revisions,
|
||||
:class_name => 'LockedPageRevision',
|
||||
:version_column => :lock_version,
|
||||
:limit => 2,
|
||||
:if_changed => :title,
|
||||
:extend => LockedPageExtension
|
||||
end
|
||||
|
||||
class SpecialLockedPage < LockedPage
|
||||
end
|
||||
|
||||
class Author < ActiveRecord::Base
|
||||
has_many :pages
|
||||
end
|
16
lib/plugins/acts_as_versioned/test/fixtures/page_versions.yml
vendored
Normal file
16
lib/plugins/acts_as_versioned/test/fixtures/page_versions.yml
vendored
Normal file
|
@ -0,0 +1,16 @@
|
|||
welcome_2:
|
||||
id: 1
|
||||
page_id: 1
|
||||
title: Welcome to the weblog
|
||||
body: Such a lovely day
|
||||
version: 24
|
||||
author_id: 1
|
||||
revisor_id: 1
|
||||
welcome_1:
|
||||
id: 2
|
||||
page_id: 1
|
||||
title: Welcome to the weblg
|
||||
body: Such a lovely day
|
||||
version: 23
|
||||
author_id: 2
|
||||
revisor_id: 2
|
7
lib/plugins/acts_as_versioned/test/fixtures/pages.yml
vendored
Normal file
7
lib/plugins/acts_as_versioned/test/fixtures/pages.yml
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
welcome:
|
||||
id: 1
|
||||
title: Welcome to the weblog
|
||||
body: Such a lovely day
|
||||
version: 24
|
||||
author_id: 1
|
||||
revisor_id: 1
|
6
lib/plugins/acts_as_versioned/test/fixtures/widget.rb
vendored
Normal file
6
lib/plugins/acts_as_versioned/test/fixtures/widget.rb
vendored
Normal file
|
@ -0,0 +1,6 @@
|
|||
class Widget < ActiveRecord::Base
|
||||
acts_as_versioned :sequence_name => 'widgets_seq', :association_options => {
|
||||
:dependent => :nullify, :order => 'version desc'
|
||||
}
|
||||
non_versioned_columns << 'foo'
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue