Initial commit of foodsoft 2
This commit is contained in:
commit
5b9a7e05df
657 changed files with 70444 additions and 0 deletions
27
vendor/plugins/acts_as_ordered/test/fixtures/cartoon.rb
vendored
Normal file
27
vendor/plugins/acts_as_ordered/test/fixtures/cartoon.rb
vendored
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
class Cartoon < ActiveRecord::Base
|
||||
acts_as_ordered :order => 'first_name'
|
||||
end
|
||||
|
||||
class ReversedCartoon < ActiveRecord::Base
|
||||
set_table_name :cartoons
|
||||
acts_as_ordered :order => 'last_name desc'
|
||||
end
|
||||
|
||||
class WrappedCartoon < ActiveRecord::Base
|
||||
set_table_name :cartoons
|
||||
acts_as_ordered :order => 'last_name', :wrap => true
|
||||
end
|
||||
|
||||
class SillyCartoon < ActiveRecord::Base
|
||||
set_table_name :cartoons
|
||||
acts_as_ordered :condition => Proc.new { |c| c.first_name =~ /e/i }
|
||||
end
|
||||
|
||||
class FunnyCartoon < ActiveRecord::Base
|
||||
set_table_name :cartoons
|
||||
acts_as_ordered :condition => Proc.new { |r| r.last_name_contains_u? }, :wrap => true
|
||||
|
||||
def last_name_contains_u?
|
||||
last_name =~ /u/
|
||||
end
|
||||
end
|
||||
19
vendor/plugins/acts_as_ordered/test/fixtures/cartoons.yml
vendored
Normal file
19
vendor/plugins/acts_as_ordered/test/fixtures/cartoons.yml
vendored
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
bugs:
|
||||
id: 1
|
||||
first_name: Bugs
|
||||
last_name: Bunny
|
||||
|
||||
daffy:
|
||||
id: 2
|
||||
first_name: Daffy
|
||||
last_name: Duck
|
||||
|
||||
elmer:
|
||||
id: 3
|
||||
first_name: Elmer
|
||||
last_name: Fudd
|
||||
|
||||
roger:
|
||||
id: 4
|
||||
first_name: Roger
|
||||
last_name: Rabbit
|
||||
7
vendor/plugins/acts_as_ordered/test/fixtures/categories.yml
vendored
Normal file
7
vendor/plugins/acts_as_ordered/test/fixtures/categories.yml
vendored
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
programming:
|
||||
id: 1
|
||||
name: Programming
|
||||
|
||||
design:
|
||||
id: 2
|
||||
name: Design
|
||||
3
vendor/plugins/acts_as_ordered/test/fixtures/category.rb
vendored
Normal file
3
vendor/plugins/acts_as_ordered/test/fixtures/category.rb
vendored
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
class Category < ActiveRecord::Base
|
||||
has_many :projects
|
||||
end
|
||||
9
vendor/plugins/acts_as_ordered/test/fixtures/document.rb
vendored
Normal file
9
vendor/plugins/acts_as_ordered/test/fixtures/document.rb
vendored
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
class Document < ActiveRecord::Base
|
||||
acts_as_ordered
|
||||
end
|
||||
|
||||
class Entry < Document
|
||||
end
|
||||
|
||||
class Page < Document
|
||||
end
|
||||
35
vendor/plugins/acts_as_ordered/test/fixtures/documents.yml
vendored
Normal file
35
vendor/plugins/acts_as_ordered/test/fixtures/documents.yml
vendored
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
entry_1:
|
||||
id: 1
|
||||
title: Entry 1
|
||||
type: Entry
|
||||
|
||||
entry_2:
|
||||
id: 2
|
||||
title: Entry 2
|
||||
type: Entry
|
||||
|
||||
page_1:
|
||||
id: 3
|
||||
title: Page 1
|
||||
type: Page
|
||||
|
||||
entry_3:
|
||||
id: 4
|
||||
title: Entry 3
|
||||
type: Entry
|
||||
|
||||
document_1:
|
||||
id: 5
|
||||
title: Document 1
|
||||
type:
|
||||
|
||||
page_2:
|
||||
id: 6
|
||||
title: Page 2
|
||||
type: Page
|
||||
|
||||
document_2:
|
||||
id: 7
|
||||
title: Document 2
|
||||
type:
|
||||
|
||||
20
vendor/plugins/acts_as_ordered/test/fixtures/project.rb
vendored
Normal file
20
vendor/plugins/acts_as_ordered/test/fixtures/project.rb
vendored
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
class Project < ActiveRecord::Base
|
||||
belongs_to :category
|
||||
acts_as_ordered :order => 'name', :scope => :category
|
||||
end
|
||||
|
||||
class WrappedProject < ActiveRecord::Base
|
||||
belongs_to :category
|
||||
set_table_name :projects
|
||||
acts_as_ordered :order => 'name', :scope => :category, :wrap => true
|
||||
end
|
||||
|
||||
class SQLScopedProject < ActiveRecord::Base
|
||||
set_table_name :projects
|
||||
acts_as_ordered :order => 'name', :scope => 'category_id = #{category_id}'
|
||||
end
|
||||
|
||||
class WrappedSQLScopedProject < ActiveRecord::Base
|
||||
set_table_name :projects
|
||||
acts_as_ordered :order => 'name', :scope => 'category_id = #{category_id}', :wrap => true
|
||||
end
|
||||
41
vendor/plugins/acts_as_ordered/test/fixtures/projects.yml
vendored
Normal file
41
vendor/plugins/acts_as_ordered/test/fixtures/projects.yml
vendored
Normal file
|
|
@ -0,0 +1,41 @@
|
|||
one:
|
||||
id: 1
|
||||
category_id: 1
|
||||
name: A - First Project
|
||||
description: This is the first one
|
||||
|
||||
two:
|
||||
id: 2
|
||||
category_id: 1
|
||||
name: B - Second Project
|
||||
description: This is the second one
|
||||
|
||||
three:
|
||||
id: 3
|
||||
category_id: 1
|
||||
name: C - Third Project
|
||||
description: This is the third one
|
||||
|
||||
four:
|
||||
id: 4
|
||||
category_id: 2
|
||||
name: D - Fourth
|
||||
description: This is the fourth one
|
||||
|
||||
five:
|
||||
id: 5
|
||||
category_id: 2
|
||||
name: E - Fifth
|
||||
description: This is the fifth one
|
||||
|
||||
six:
|
||||
id: 6
|
||||
category_id: 2
|
||||
name: F - Sixth
|
||||
description: This is the sixth one
|
||||
|
||||
seven:
|
||||
id: 7
|
||||
category_id: 2
|
||||
name: G - Seventh
|
||||
description: This is the seventh one
|
||||
Loading…
Add table
Add a link
Reference in a new issue