forgeos_core 1.9.5.rc1 → 1.9.5.rc2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/Gemfile +6 -0
  2. data/README.textile +1 -0
  3. data/app/helpers/application_helper.rb +6 -5
  4. data/app/models/administrator.rb +1 -1
  5. data/app/models/attachment.rb +2 -1
  6. data/app/models/person.rb +18 -13
  7. data/app/views/layouts/admin.html.haml +2 -2
  8. data/config/forgeos_admin_menu.yml +51 -0
  9. data/config/initializers/forgeos_menu_hash.rb +10 -0
  10. data/db/migrate/20091103220541_migrate_from_restful_authentication_to_authlogic.rb +3 -25
  11. data/lib/forgeos.rb +2 -62
  12. data/lib/forgeos/core.rb +1 -6
  13. data/lib/forgeos/core/engine.rb +1 -0
  14. data/lib/forgeos/core/version.rb +1 -1
  15. data/test/before_travis.sh +9 -0
  16. data/test/dummy/config/application.rb +8 -1
  17. data/test/dummy/config/database.yml +1 -21
  18. data/test/dummy/config/initializers/in_memory_database.rb +8 -0
  19. data/test/dummy/config/initializers/session_store.rb +1 -1
  20. data/test/dummy/config/initializers/wrap_parameters.rb +1 -1
  21. data/test/dummy/db/schema.rb +256 -0
  22. data/test/dummy/db/test.sqlite3 +0 -0
  23. data/test/dummy/log/RAILS_ENV=test.log +0 -0
  24. data/test/dummy/log/development.log +546 -0
  25. data/test/dummy/log/test.log +20047 -0
  26. data/test/dummy/test/fixtures/geo_zones.yml +1582 -0
  27. data/test/dummy/test/fixtures/people.yml +11 -0
  28. data/test/dummy/test/fixtures/settings.yml +70 -0
  29. data/test/dummy/vendor/plugins/attachment_fu/CHANGELOG +35 -0
  30. data/test/dummy/vendor/plugins/attachment_fu/LICENSE +20 -0
  31. data/test/dummy/vendor/plugins/attachment_fu/README +193 -0
  32. data/test/dummy/vendor/plugins/attachment_fu/Rakefile +22 -0
  33. data/test/dummy/vendor/plugins/attachment_fu/amazon_s3.yml.tpl +17 -0
  34. data/test/dummy/vendor/plugins/attachment_fu/init.rb +17 -0
  35. data/test/dummy/vendor/plugins/attachment_fu/install.rb +7 -0
  36. data/test/dummy/vendor/plugins/attachment_fu/lib/geometry.rb +93 -0
  37. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb +538 -0
  38. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/cloud_file_backend.rb +211 -0
  39. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/db_file_backend.rb +39 -0
  40. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/file_system_backend.rb +126 -0
  41. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/ftp_backend.rb +255 -0
  42. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/backends/s3_backend.rb +394 -0
  43. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/core_image_processor.rb +59 -0
  44. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/gd2_processor.rb +54 -0
  45. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/image_science_processor.rb +61 -0
  46. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/mini_magick_processor.rb +132 -0
  47. data/test/dummy/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu/processors/rmagick_processor.rb +57 -0
  48. data/test/dummy/vendor/plugins/attachment_fu/rackspace_cloudfiles.yml.tpl +14 -0
  49. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/color.rb +27 -0
  50. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/effects.rb +31 -0
  51. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/perspective.rb +25 -0
  52. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/quality.rb +25 -0
  53. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/scale.rb +47 -0
  54. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/filters/watermark.rb +32 -0
  55. data/test/dummy/vendor/plugins/attachment_fu/vendor/red_artisan/core_image/processor.rb +123 -0
  56. data/test/dummy/vendor/plugins/open_flash_chart/MIT-LICENSE +20 -0
  57. data/test/dummy/vendor/plugins/open_flash_chart/README +54 -0
  58. data/test/dummy/vendor/plugins/open_flash_chart/Rakefile +22 -0
  59. data/test/dummy/vendor/plugins/open_flash_chart/assets/javascripts/swfobject.js +5 -0
  60. data/test/dummy/vendor/plugins/open_flash_chart/assets/open-flash-chart-bar-clicking.swf +0 -0
  61. data/test/dummy/vendor/plugins/open_flash_chart/assets/open-flash-chart.swf +0 -0
  62. data/test/dummy/vendor/plugins/open_flash_chart/init.rb +9 -0
  63. data/test/dummy/vendor/plugins/open_flash_chart/install.rb +17 -0
  64. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart.rb +54 -0
  65. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/area_base.rb +18 -0
  66. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/area_hollow.rb +10 -0
  67. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/area_line.rb +10 -0
  68. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/arrow.rb +13 -0
  69. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/background.rb +45 -0
  70. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar.rb +18 -0
  71. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_3d.rb +17 -0
  72. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_base.rb +7 -0
  73. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_filled.rb +18 -0
  74. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_glass.rb +67 -0
  75. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_sketch.rb +13 -0
  76. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/bar_stack.rb +29 -0
  77. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/base.rb +123 -0
  78. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/candle.rb +22 -0
  79. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/chart.rb +13 -0
  80. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/dot_base.rb +55 -0
  81. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/h_bar.rb +26 -0
  82. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/legend.rb +7 -0
  83. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/line.rb +23 -0
  84. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/line_base.rb +17 -0
  85. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/line_dot.rb +17 -0
  86. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/line_hollow.rb +10 -0
  87. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/line_style.rb +12 -0
  88. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/linear_regression.rb +39 -0
  89. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/menu.rb +26 -0
  90. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/ofc_ajax.rb +116 -0
  91. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/open_flash_chart_object.rb +53 -0
  92. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/pie.rb +75 -0
  93. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/radar_axis.rb +10 -0
  94. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/radar_axis_labels.rb +10 -0
  95. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/radar_spoke_labels.rb +10 -0
  96. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/scatter.rb +22 -0
  97. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/scatter_line.rb +20 -0
  98. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/shape.rb +20 -0
  99. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/sugar.rb +27 -0
  100. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/tags.rb +62 -0
  101. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/title.rb +10 -0
  102. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/tooltip.rb +25 -0
  103. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/upload_image.rb +1 -0
  104. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/x_axis.rb +18 -0
  105. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/x_axis_label.rb +21 -0
  106. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/x_axis_labels.rb +9 -0
  107. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/x_legend.rb +10 -0
  108. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_axis.rb +3 -0
  109. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_axis_base.rb +7 -0
  110. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_axis_label.rb +12 -0
  111. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_axis_labels.rb +7 -0
  112. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_axis_right.rb +4 -0
  113. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_legend.rb +10 -0
  114. data/test/dummy/vendor/plugins/open_flash_chart/lib/open_flash_chart/y_legend_right.rb +6 -0
  115. data/test/dummy/vendor/plugins/open_flash_chart/tasks/open_flash_chart_tasks.rake +4 -0
  116. data/test/dummy/vendor/plugins/open_flash_chart/uninstall.rb +1 -0
  117. data/test/files/admin_menu.yml +1 -0
  118. data/test/files/database.yml.mysql +5 -0
  119. data/test/files/database.yml.postgres +4 -0
  120. data/test/files/database.yml.sqlite +5 -0
  121. data/test/fixtures/geo_zones.yml +1582 -0
  122. data/test/fixtures/people.yml +43 -0
  123. data/test/fixtures/settings.yml +70 -0
  124. data/test/forgeos_core_test.rb +30 -2
  125. data/test/test_helper.rb +8 -0
  126. data/test/unit/administrator_test.rb +30 -0
  127. data/test/unit/person_test.rb +103 -0
  128. data/test/unit/user_test.rb +16 -0
  129. metadata +251 -37
  130. data/db/migrate/20110310144114_add_perishable_token_to_people.rb +0 -10
data/Gemfile CHANGED
@@ -1,2 +1,8 @@
1
1
  source "http://rubygems.org"
2
2
  gemspec
3
+
4
+ group(:test) do
5
+ gem 'sqlite3', '1.3.4'
6
+ gem 'mysql2'
7
+ gem 'pg'
8
+ end
data/README.textile CHANGED
@@ -1,4 +1,5 @@
1
1
  h1. Introduction
2
+ "!https://secure.travis-ci.org/webpulser/forgeos_core.png!":http://travis-ci.org/webpulser/forgeos_core
2
3
 
3
4
  ForgeosCore is the core of Forgeos project "http://www.forgeos.com":http://www.forgeos.com
4
5
 
@@ -4,10 +4,11 @@ module ApplicationHelper
4
4
  current_user
5
5
  end
6
6
 
7
- def build_menu(menu = Forgeos::Menu,options = { :menu => :menu}, html_options = {})
7
+ def build_menu(menu = {}, options = { :menu => :menu}, html_options = {})
8
8
  menu_name = options.delete(:menu)
9
- menu.each do |tab|
10
- content_for menu_name, menu_item(tab.dup)
9
+ menu.each do |k, v|
10
+ v[:title] ||= k
11
+ content_for menu_name, menu_item(v.dup)
11
12
  end
12
13
  end
13
14
 
@@ -16,8 +17,8 @@ module ApplicationHelper
16
17
  end
17
18
 
18
19
  def menu_item(tab)
19
- html_options = tab[:html] ? tab[:html].dup : {}
20
- tab_name = (tab.delete(:i18n) ? I18n.t(*tab[:title]) : tab[:title])
20
+ html_options = tab[:html] || {}
21
+ tab_name = I18n.t(tab[:title], :scope => [:back_office, :menu])
21
22
  html_options[:class] = '' unless html_options[:class]
22
23
  urls = tab.delete(:url)
23
24
 
@@ -10,6 +10,6 @@ class Administrator < Person
10
10
  :association_foreign_key => 'category_id'
11
11
 
12
12
  def access_path?(controller,action)
13
- rights.find_by_controller_name_and_action_name(controller,action)
13
+ rights.find_by_controller_name_and_action_name(controller,action).present?
14
14
  end
15
15
  end
@@ -31,7 +31,8 @@ class Attachment < ActiveRecord::Base
31
31
  end
32
32
 
33
33
  def self.options_for(target = class_name)
34
- (Setting.current.attachments[target] || {}).symbolize_keys
34
+ return {}# unless ActiveRecord::Base.connection.tables.include?(Setting.table_name) or Setting.current
35
+ #(Setting.current.attachments[target] || {}).symbolize_keys
35
36
  end
36
37
 
37
38
  define_index do
data/app/models/person.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  class Person < ActiveRecord::Base
2
2
  acts_as_authentic do |c|
3
- c.merge_validates_uniqueness_of_email_field_options( :if => :skip_uniquess_of_email? )
3
+ c.merge_validates_uniqueness_of_email_field_options( :unless => :skip_uniqueness_of_email? )
4
4
  c.crypto_provider = Authlogic::CryptoProviders::BCrypt
5
5
  end
6
6
  acts_as_tagger
@@ -13,8 +13,8 @@ class Person < ActiveRecord::Base
13
13
  accepts_nested_attributes_for :address
14
14
  accepts_nested_attributes_for :avatar, :reject_if => proc { |attributes| attributes['uploaded_data'].blank? }
15
15
 
16
- validates_presence_of :lastname, :if => :skip_presence_of_lastname?
17
- validates_presence_of :firstname, :if => :skip_presence_of_firstname?
16
+ validates_presence_of :lastname, :unless => :skip_presence_of_lastname?
17
+ validates_presence_of :firstname, :unless => :skip_presence_of_firstname?
18
18
 
19
19
  # prevents a user from submitting a crafted form that bypasses activation
20
20
  # anything else you want your user to change should be added here.
@@ -22,17 +22,22 @@ class Person < ActiveRecord::Base
22
22
  :civility, :country_id, :birthday, :phone, :other_phone, :email_confirmation,
23
23
  :avatar_attributes, :lang, :time_zone, :address_attributes
24
24
 
25
- define_index do
26
- indexes firstname, :sortable => true
27
- indexes lastname, :sortable => true
28
- indexes email, :sortable => true
29
- set_property :delta => true
30
- end
25
+ #define_index do
26
+ # indexes firstname, :sortable => true
27
+ # indexes lastname, :sortable => true
28
+ # indexes email, :sortable => true
29
+ # set_property :delta => true
30
+ #end
31
31
 
32
32
  def fullname
33
33
  "#{lastname} #{firstname}"
34
34
  end
35
35
 
36
+ def name
37
+ "#{firstname} #{lastname}"
38
+ end
39
+
40
+
36
41
  # Disactivates the user in the database.
37
42
  def disactivate
38
43
  update_attribute(:active, false)
@@ -45,15 +50,15 @@ class Person < ActiveRecord::Base
45
50
 
46
51
  protected
47
52
 
48
- def skip_uniquess_of_email?
49
- true
53
+ def skip_uniqueness_of_email?
54
+ false
50
55
  end
51
56
 
52
57
  def skip_presence_of_lastname?
53
- true
58
+ false
54
59
  end
55
60
 
56
61
  def skip_presence_of_firstname?
57
- true
62
+ false
58
63
  end
59
64
  end
@@ -12,10 +12,10 @@
12
12
  #container.container_16
13
13
  .grid_16
14
14
  %ul#submenu.backgrounds
15
- - build_menu(Forgeos::AdminSubMenu, :menu => :submenu)
15
+ - build_menu(Forgeos::MENU_HASH[:forgeos][:admin][:submenu], :menu => :submenu)
16
16
  = yield :submenu
17
17
  %ul#menu.backgrounds
18
- - build_menu(Forgeos::AdminMenu)
18
+ - build_menu(Forgeos::MENU_HASH[:forgeos][:admin][:menu])
19
19
  = yield :menu
20
20
  .backgrounds.menu-bottom
21
21
  #notifications.grid_16
@@ -0,0 +1,51 @@
1
+ forgeos:
2
+ admin:
3
+ menu:
4
+ dashboard:
5
+ url: /admin/dashboard
6
+ html:
7
+ class: left first
8
+ users:
9
+ url: /admin/users
10
+ html:
11
+ class: left
12
+ statistics:
13
+ url: /admin/statistics
14
+ html:
15
+ class: right
16
+
17
+ submenu:
18
+ administration:
19
+ url:
20
+ - /admin/administrators
21
+ - /admin/roles
22
+ - /admin/rights
23
+ html:
24
+ class: left first
25
+ settings:
26
+ url: /admin/setting
27
+ html:
28
+ class: left
29
+ library:
30
+ url:
31
+ - /admin/library
32
+ - /admin/images/attachments
33
+ - /admin/pdf/attachments
34
+ - /admin/audio/attachments
35
+ - /admin/video/attachments
36
+ - /admin/media/attachments
37
+ - /admin/doc/attachments
38
+ html:
39
+ class: left
40
+ accounts:
41
+ url: /admin/account
42
+ html:
43
+ class: left
44
+ logout:
45
+ url: /admin/logout
46
+ html:
47
+ class: right
48
+ support:
49
+ url: http://www.webpulser.com
50
+ html:
51
+ class: right first
@@ -0,0 +1,10 @@
1
+ @menu ||= {}
2
+ Rails.application.railties.engines.each do |engine|
3
+ if path = engine.paths['forgeos_admin_menu']
4
+ path.expanded.each do |file|
5
+ @menu.deep_merge! YAML.load_file(file)
6
+ end
7
+ end
8
+ end
9
+
10
+ Forgeos::MENU_HASH = HashWithIndifferentAccess.new(@menu)
@@ -1,10 +1,11 @@
1
1
  class MigrateFromRestfulAuthenticationToAuthlogic < ActiveRecord::Migration
2
- def self.up
2
+ def change
3
3
  change_table :people do |t|
4
4
  t.rename :salt, :password_salt
5
5
  t.change :password_salt, :string, :limit => 128
6
6
  t.change :crypted_password, :string, :limit => 128
7
- t.string :persistence_token, :null => false
7
+ t.string :persistence_token, :null => false, :default => ''
8
+ t.string :people, :perishable_token, :string, :null => :false, :default => ''
8
9
  t.integer :login_count,
9
10
  :failed_login_count,
10
11
  :null => false,
@@ -21,27 +22,4 @@ class MigrateFromRestfulAuthenticationToAuthlogic < ActiveRecord::Migration
21
22
  :activated_at
22
23
  end
23
24
  end
24
-
25
- def self.down
26
- change_table :people do |t|
27
- t.rename :password_salt,:salt
28
- t.change :salt, :string, :limit => 40
29
- t.change :crypted_password, :string, :limit => 40
30
- t.remove :persistence_token,
31
- :login_count,
32
- :failed_login_count,
33
- :last_request_at,
34
- :current_login_at,
35
- :last_login_at,
36
- :current_login_ip,
37
- :last_login_ip,
38
- :active
39
- t.string :remember_token,
40
- :activation_code,
41
- :limit => 40
42
- t.datetime :remember_token_expires_at,
43
- :activated_at
44
- end
45
-
46
- end
47
25
  end
data/lib/forgeos.rb CHANGED
@@ -24,66 +24,6 @@ module Forgeos
24
24
  url.squeeze(sep).gsub(/(^#{sep}+|#{sep}+$)/,'').downcase
25
25
  end
26
26
 
27
- AdminMenu = [
28
- { :title => 'back_office.menu.dashboard',
29
- :url => '/admin/dashboard',
30
- :i18n => true,
31
- :html => { :class => 'left first'}
32
- },
33
- { :title => 'back_office.menu.users',
34
- :url => '/admin/users',
35
- :i18n => true,
36
- :html => { :class => 'left'}
37
- },
38
- { :title => 'back_office.menu.statistics',
39
- :url => '/admin/statistics',
40
- :i18n => true,
41
- :html => { :class => 'right' }
42
- }
43
- ]
44
-
45
- AdminSubMenu = [
46
- { :title => 'back_office.menu.administration',
47
- :i18n => true,
48
- :url => [
49
- '/admin/administrators',
50
- '/admin/roles',
51
- '/admin/rights'
52
- ],
53
- :html => { :class => 'left first'}
54
- },
55
- { :title => 'back_office.menu.settings',
56
- :i18n => true,
57
- :url => '/admin/setting',
58
- :html => { :class => 'left' }
59
- },
60
- { :title => 'back_office.menu.library',
61
- :i18n => true,
62
- :url => [
63
- '/admin/library',
64
- '/admin/images/attachments',
65
- '/admin/pdf/attachments',
66
- '/admin/audio/attachments',
67
- '/admin/video/attachments',
68
- '/admin/media/attachments',
69
- '/admin/doc/attachments'
70
- ],
71
- :html => { :class => 'left' }
72
- },
73
- { :title => 'back_office.menu.accounts',
74
- :i18n => true,
75
- :url => '/admin/account',
76
- :html => { :class => 'left' }
77
- },
78
- { :title => 'back_office.menu.logout',
79
- :i18n => true,
80
- :url => '/admin/logout',
81
- :html => { :class => 'right' }
82
- },
83
- { :title => 'back_office.menu.support',
84
- :i18n => true,
85
- :url => 'http://www.webpulser.com',
86
- :html => { :class => 'right first' }
87
- }
88
- ]
27
+ AdminMenu = []
28
+ AdminSubMenu = []
89
29
  end
data/lib/forgeos/core.rb CHANGED
@@ -1,10 +1,5 @@
1
- require 'forgeos'
2
1
  require 'forgeos/core/engine'
3
-
4
- module Forgeos
5
- module Core
6
- end
7
- end
2
+ require 'forgeos'
8
3
 
9
4
  require File.join(File.dirname(__FILE__), '..', 'sphinx_globalize')
10
5
  require File.join(File.dirname(__FILE__), '..', 'sortable_attachments')
@@ -18,6 +18,7 @@ module Forgeos
18
18
  class Engine < Rails::Engine
19
19
  paths["config/locales"] << 'config/locales/**'
20
20
  paths["app/assets"] << 'vendor/assets'
21
+ paths["forgeos_admin_menu"] = 'config/forgeos_admin_menu.yml'
21
22
  end
22
23
  end
23
24
  end
@@ -1,5 +1,5 @@
1
1
  module Forgeos
2
2
  module Core
3
- VERSION = "1.9.5.rc1"
3
+ VERSION = "1.9.5.rc2"
4
4
  end
5
5
  end
@@ -0,0 +1,9 @@
1
+ # Create a database.yml for the right database
2
+ echo "Setting up database.yml for $DB"
3
+ cp "test/files/database.yml.$DB" "test/dummy/config/database.yml"
4
+
5
+ # Set up database
6
+ echo "Creating databases for $DB and loading schema"
7
+ cd "test/dummy"
8
+ bundle exec rake db:create
9
+ bundle exec rake db:schema:load
@@ -2,7 +2,14 @@ require File.expand_path('../boot', __FILE__)
2
2
 
3
3
  require 'rails/all'
4
4
 
5
- Bundler.require
5
+ if defined?(Bundler)
6
+ # If you precompile assets before deploying to production, use this line
7
+ Bundler.require *Rails.groups(:assets => %w(development test))
8
+ # If you want your assets lazily compiled in production, use this line
9
+ Bundler.require(:default, :assets, Rails.env)
10
+ end
11
+
12
+ require 'sass-rails'
6
13
  require "forgeos_core"
7
14
 
8
15
  module Dummy
@@ -1,25 +1,5 @@
1
- # SQLite version 3.x
2
- # gem install sqlite3
3
- #
4
- # Ensure the SQLite 3 gem is defined in your Gemfile
5
- # gem 'sqlite3'
6
- development:
7
- adapter: sqlite3
8
- database: db/development.sqlite3
9
- pool: 5
10
- timeout: 5000
11
-
12
- # Warning: The database defined as "test" will be erased and
13
- # re-generated from your development database when you run "rake".
14
- # Do not set this db to the same as development or production.
15
1
  test:
16
2
  adapter: sqlite3
17
- database: db/test.sqlite3
18
- pool: 5
19
- timeout: 5000
20
-
21
- production:
22
- adapter: sqlite3
23
- database: db/production.sqlite3
3
+ database: 'db/test.sqlite3'
24
4
  pool: 5
25
5
  timeout: 5000
@@ -0,0 +1,8 @@
1
+ def in_memory_database?
2
+ Rails.env == "test" and Rails.configuration.database_configuration['test']['database'] == ':memory:'
3
+ end
4
+
5
+ if in_memory_database?
6
+ puts "creating sqlite in memory database"
7
+ load "#{Rails.root}/db/schema.rb"
8
+ end
@@ -1,6 +1,6 @@
1
1
  # Be sure to restart your server when you modify this file.
2
2
 
3
- Dummy::Application.config.session_store :cookie_store, key: '_dummy_session'
3
+ Dummy::Application.config.session_store :cookie_store, :key => '_dummy_session'
4
4
 
5
5
  # Use the database for sessions instead of the cookie-based default,
6
6
  # which shouldn't be used to store highly confidential information
@@ -5,7 +5,7 @@
5
5
 
6
6
  # Enable parameter wrapping for JSON. You can disable this by setting :format to an empty array.
7
7
  ActiveSupport.on_load(:action_controller) do
8
- wrap_parameters format: [:json]
8
+ wrap_parameters :format => [:json]
9
9
  end
10
10
 
11
11
  # Disable root element in JSON by default.
@@ -0,0 +1,256 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20111024101878) do
15
+
16
+ create_table "addresses", :force => true do |t|
17
+ t.string "address"
18
+ t.string "address_2"
19
+ t.string "zip_code"
20
+ t.string "city"
21
+ t.string "type"
22
+ t.integer "country_id"
23
+ t.integer "person_id"
24
+ t.datetime "created_at"
25
+ t.datetime "updated_at"
26
+ end
27
+
28
+ create_table "attachment_links", :force => true do |t|
29
+ t.integer "attachment_id"
30
+ t.integer "element_id"
31
+ t.integer "position"
32
+ t.string "element_type"
33
+ t.string "attachment_type"
34
+ end
35
+
36
+ create_table "attachments", :force => true do |t|
37
+ t.string "content_type"
38
+ t.string "name"
39
+ t.string "filename"
40
+ t.string "alternative"
41
+ t.string "thumbnail"
42
+ t.string "type"
43
+ t.integer "height"
44
+ t.integer "width"
45
+ t.integer "size"
46
+ t.integer "parent_id"
47
+ t.integer "person_id"
48
+ t.datetime "created_at"
49
+ t.datetime "updated_at"
50
+ t.text "description"
51
+ t.string "alt"
52
+ end
53
+
54
+ create_table "categories", :force => true do |t|
55
+ t.string "type", :limit => 45
56
+ t.integer "parent_id"
57
+ t.datetime "created_at"
58
+ t.datetime "updated_at"
59
+ t.integer "position", :default => 0
60
+ end
61
+
62
+ add_index "categories", ["id", "type"], :name => "index_categories_on_id_and_type", :unique => true
63
+
64
+ create_table "categories_elements", :id => false, :force => true do |t|
65
+ t.integer "category_id"
66
+ t.integer "element_id"
67
+ t.integer "position", :default => 0, :null => false
68
+ end
69
+
70
+ add_index "categories_elements", ["category_id", "element_id"], :name => "index_categories_elements_on_category_id_and_element_id", :unique => true
71
+
72
+ create_table "category_translations", :force => true do |t|
73
+ t.integer "category_id"
74
+ t.string "locale"
75
+ t.string "url"
76
+ t.string "name"
77
+ t.text "description"
78
+ t.datetime "created_at"
79
+ t.datetime "updated_at"
80
+ end
81
+
82
+ add_index "category_translations", ["category_id"], :name => "index_category_translations_on_category_id"
83
+
84
+ create_table "comments", :force => true do |t|
85
+ t.string "title", :limit => 50, :default => ""
86
+ t.text "comment"
87
+ t.integer "commentable_id"
88
+ t.string "commentable_type"
89
+ t.integer "person_id"
90
+ t.datetime "created_at"
91
+ t.datetime "updated_at"
92
+ end
93
+
94
+ add_index "comments", ["person_id"], :name => "fk_comments_person"
95
+
96
+ create_table "delayed_jobs", :force => true do |t|
97
+ t.integer "priority", :default => 0
98
+ t.integer "attempts", :default => 0
99
+ t.text "handler"
100
+ t.text "last_error"
101
+ t.datetime "run_at"
102
+ t.datetime "locked_at"
103
+ t.datetime "failed_at"
104
+ t.string "locked_by"
105
+ t.datetime "created_at"
106
+ t.datetime "updated_at"
107
+ end
108
+
109
+ add_index "delayed_jobs", ["priority", "run_at"], :name => "delayed_jobs_priority"
110
+
111
+ create_table "geo_zones", :force => true do |t|
112
+ t.string "iso"
113
+ t.string "iso3"
114
+ t.string "name"
115
+ t.string "printable_name"
116
+ t.string "type"
117
+ t.integer "numcode"
118
+ t.integer "parent_id"
119
+ end
120
+
121
+ create_table "import_sets", :force => true do |t|
122
+ t.text "fields"
123
+ t.text "parser_options"
124
+ t.boolean "ignore_first_row", :default => true, :null => false
125
+ t.string "name"
126
+ t.datetime "created_at"
127
+ t.datetime "updated_at"
128
+ end
129
+
130
+ create_table "meta_info_translations", :force => true do |t|
131
+ t.integer "meta_info_id"
132
+ t.string "locale"
133
+ t.string "title"
134
+ t.text "description"
135
+ t.text "keywords"
136
+ t.datetime "created_at"
137
+ t.datetime "updated_at"
138
+ end
139
+
140
+ add_index "meta_info_translations", ["meta_info_id"], :name => "index_meta_info_translations_on_meta_info_id"
141
+
142
+ create_table "meta_infos", :force => true do |t|
143
+ t.integer "target_id"
144
+ t.string "target_type"
145
+ end
146
+
147
+ create_table "people", :force => true do |t|
148
+ t.string "email"
149
+ t.string "firstname"
150
+ t.string "lastname"
151
+ t.string "type"
152
+ t.string "phone"
153
+ t.string "other_phone"
154
+ t.string "lang"
155
+ t.string "time_zone"
156
+ t.string "crypted_password", :limit => 128
157
+ t.string "password_salt", :limit => 128
158
+ t.integer "avatar_id"
159
+ t.integer "country_id"
160
+ t.integer "role_id"
161
+ t.date "birthday"
162
+ t.datetime "created_at"
163
+ t.datetime "updated_at"
164
+ t.integer "civility"
165
+ t.string "persistence_token", :default => "", :null => false
166
+ t.string "people", :default => ""
167
+ t.string "perishable_token", :default => ""
168
+ t.string "string", :default => ""
169
+ t.integer "login_count", :default => 0, :null => false
170
+ t.integer "failed_login_count", :default => 0, :null => false
171
+ t.datetime "last_request_at"
172
+ t.datetime "current_login_at"
173
+ t.datetime "last_login_at"
174
+ t.string "current_login_ip"
175
+ t.string "last_login_ip"
176
+ t.boolean "active", :default => false, :null => false
177
+ t.boolean "delta", :default => true, :null => false
178
+ end
179
+
180
+ create_table "rights", :force => true do |t|
181
+ t.string "name"
182
+ t.string "controller_name"
183
+ t.string "action_name"
184
+ end
185
+
186
+ create_table "rights_roles", :id => false, :force => true do |t|
187
+ t.integer "right_id"
188
+ t.integer "role_id"
189
+ end
190
+
191
+ create_table "roles", :force => true do |t|
192
+ t.string "name"
193
+ t.boolean "active", :default => true, :null => false
194
+ t.datetime "created_at"
195
+ t.datetime "updated_at"
196
+ end
197
+
198
+ create_table "rules", :force => true do |t|
199
+ t.text "conditions"
200
+ t.text "description"
201
+ t.text "variables"
202
+ t.integer "use", :default => 0, :null => false
203
+ t.integer "max_use", :default => 0, :null => false
204
+ t.string "name"
205
+ t.string "type"
206
+ t.string "code"
207
+ t.boolean "active", :default => true, :null => false
208
+ t.integer "parent_id"
209
+ end
210
+
211
+ create_table "search_keywords", :force => true do |t|
212
+ t.string "keyword"
213
+ t.datetime "created_at"
214
+ t.datetime "updated_at"
215
+ end
216
+
217
+ create_table "settings", :force => true do |t|
218
+ t.string "name"
219
+ t.string "lang"
220
+ t.string "time_zone"
221
+ t.string "phone_number"
222
+ t.string "fax_number"
223
+ t.string "email"
224
+ t.text "mailer", :null => false
225
+ t.text "smtp_settings", :null => false
226
+ t.text "sendmail_settings", :null => false
227
+ t.integer "address_id"
228
+ t.text "attachments"
229
+ end
230
+
231
+ create_table "statistic_counters", :force => true do |t|
232
+ t.string "type"
233
+ t.date "date"
234
+ t.integer "counter", :default => 1
235
+ t.integer "element_id"
236
+ t.string "element_type"
237
+ end
238
+
239
+ create_table "taggings", :force => true do |t|
240
+ t.integer "tag_id"
241
+ t.integer "taggable_id"
242
+ t.string "taggable_type"
243
+ t.integer "tagger_id"
244
+ t.string "tagger_type"
245
+ t.string "context"
246
+ t.datetime "created_at"
247
+ end
248
+
249
+ add_index "taggings", ["tag_id"], :name => "index_taggings_on_tag_id"
250
+ add_index "taggings", ["taggable_id", "taggable_type", "context"], :name => "index_taggings_on_taggable_id_and_taggable_type_and_context"
251
+
252
+ create_table "tags", :force => true do |t|
253
+ t.string "name"
254
+ end
255
+
256
+ end