we_bridge_rails_engine_orgs 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (77) hide show
  1. checksums.yaml +4 -4
  2. data/Gemfile.lock +1 -1
  3. data/app/controllers/concerns/org_common.rb +17 -0
  4. data/app/controllers/org_activities_controller.rb +1 -4
  5. data/app/controllers/org_branch_types_controller.rb +1 -5
  6. data/app/controllers/org_branches_controller.rb +1 -5
  7. data/app/controllers/org_director_types_controller.rb +1 -4
  8. data/app/controllers/org_directors_controller.rb +1 -4
  9. data/app/controllers/org_member_tags_controller.rb +1 -4
  10. data/app/controllers/org_member_types_controller.rb +1 -4
  11. data/app/controllers/org_members_controller.rb +1 -4
  12. data/app/controllers/orgs_controller.rb +0 -1
  13. data/app/models/org_activity.rb +8 -1
  14. data/app/models/org_activity_text.rb +1 -1
  15. data/app/models/org_branch.rb +4 -0
  16. data/app/models/org_branch_text.rb +1 -1
  17. data/app/models/org_branch_type.rb +3 -1
  18. data/app/models/org_branch_type_text.rb +1 -1
  19. data/app/models/org_director_type.rb +11 -1
  20. data/app/models/org_director_type_text.rb +1 -1
  21. data/app/models/org_member.rb +17 -2
  22. data/app/models/org_member_tag.rb +7 -1
  23. data/app/models/org_member_tag_text.rb +1 -1
  24. data/app/models/org_member_type.rb +6 -1
  25. data/app/models/org_member_type_text.rb +1 -1
  26. data/app/views/common/_show.html.builder +9 -1
  27. data/app/views/org_activities/show.html.builder +1 -9
  28. data/app/views/org_branch_types/show.html.builder +1 -9
  29. data/app/views/org_branches/show.html.builder +1 -9
  30. data/app/views/org_director_types/show.html.builder +1 -9
  31. data/app/views/org_directors/show.html.builder +1 -9
  32. data/app/views/org_member_tags/show.html.builder +1 -9
  33. data/app/views/org_member_types/show.html.builder +1 -9
  34. data/app/views/org_members/show.html.builder +1 -9
  35. data/db/migrate/20150812025526_create_orgs.rb +2 -1
  36. data/db/migrate/20150814183339_create_org_branches_table.rb +8 -0
  37. data/lib/we_bridge_rails_engine_orgs/engine.rb +1 -0
  38. data/lib/we_bridge_rails_engine_orgs/version.rb +1 -1
  39. data/spec/dummy/db/development.sqlite3 +0 -0
  40. data/spec/dummy/db/schema.rb +24 -11
  41. data/spec/dummy/db/test.sqlite3 +0 -0
  42. data/spec/dummy/log/development.log +12129 -0
  43. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3Gnkt_WJKoZJxixiYdm_FIRiS44X26Fu9fJJm7IHDG4.cache +1 -0
  44. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/57fly2mMC5ZRdxrJ0HMn68Dl8x8iWwoS1Wl0LthDHD8.cache +0 -0
  45. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  46. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/6y2OXokkg_bBTgy9MnXOUhmmNC_dKCmJyKi_HMlQcSg.cache +0 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9eeDXBwks5hHIZjdTNgcuNP2q1NieK4zl689cIWcVLo.cache +1 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9wUrLTpniuw3vFR8aaAAw3_KGA_MSofFcrT9TXvxZTY.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BCCvFrpyQECuSQFKRT6jwzLiPCHOaeWWrY81UH4GgXM.cache +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Bt3QK9WXyQB08iE6IHK467jLG-93g4iaaaUBvfdzW9Q.cache +1 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/D5gJ473aeV5oBcADjXr33ksUZTtZFdqbCA4rBWjMk6w.cache +1 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EGxE11Csn4xINTN_ugWXEpqOWr5pnwCfQuE17O8HnVc.cache +2 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ELy3x34dthmYWMX3OgukmfqAiHx64bR_CMBF3NMGYnk.cache +1 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EbrKuAOW1QpjGt2Iv2jeTaOGLBJc2Egi9shVVmdeERs.cache +0 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Hxow6764dYGwoCc-uvAIYuGN4HOylgF2on4fI_5yAPw.cache +0 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/JigkThideDLksj6ZrufTx6bLVyJBmNDbaouRbMbZdIA.cache +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KkUWVglyAhTcj7j_Z_ALDsTxv1yg01qQ37vKUKW6NGY.cache +1 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ku_V2tcnT_d-kZlCfXQgbhcG1MeKgDHX5K11qHXyY_A.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/LDJY3T1TzDJaQmbrrDKq2b8Q8abMypZcHLZByDlpTrY.cache +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/LjWpbU6EpEYPafClHpZwV-CSBuUAKtw2VUTN__8BcqU.cache +0 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MYpL_S8fFtwDaIQlZS0tzHLCSvNoN2X2CHM3y5UI2vc.cache +1 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NpnEH-utlsgBAxVhT3-R4bCCqJ9_yisNYylIosRd0WY.cache +1 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/P6jJYd5nnvfCh5qCaOgKN4dYlJ92L2Rh4WjjdoZNJYg.cache +1 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/QofpelZU6FjjxNs1Hu0JXtH7tRd7AyZJRxC1Uh8Sw-E.cache +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/S7S5i_gDuGZ_zzm8DiNcIGt5ZkPEbslqYN6TFhCerzU.cache +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UOZrHC0gWtaDCl5XyhKdGr6kRZnDjrS5p1GmuTpGc_M.cache +0 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/fBngxGbUQ45W5xkhfLE01MuMcBlhhkBNApm0dyuI5EE.cache +1 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/g0Tk0OFLRI6eoF9xJOzK6ylrZ1rXj7elN7aIn2bEca4.cache +1 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gL0gVZhLKEJhjgrNRxdoynZiPTZg6VQR0MdYz32GdDM.cache +0 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/gjVFqYSxl63XPv_1FOOAQ64RfaAtkLHv1n9LiMBIpvw.cache +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/iLYNAzvIFMiMfLolPyhu--fVUT7WuJbsT4TcOMR7qKs.cache +0 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rAssroOSxTjJ76HXZeMXD-7MijqdtSMrB7BWdOt7Z_M.cache +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/s7AiRxV9LdOVAylAE38RiKCstOIGXxlkhZ15nV8_GfY.cache +0 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/uYE73cVE-RVipcx1xUC186KW80krIF-TVc_eQHE5BGU.cache +1 -0
  76. data/spec/dummy/tmp/pids/server.pid +1 -1
  77. metadata +61 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 90d86a527e42296ac2627cda31dfbbef062a20f9
4
- data.tar.gz: 8e9378ed2c4fe872247ae834270469e7b3b0a14c
3
+ metadata.gz: 3ed538429408a472c71a28894c57902ecb32edf7
4
+ data.tar.gz: f40da9c37dbd11b0bf39a8d5e153cdbcc8edaefb
5
5
  SHA512:
6
- metadata.gz: 03886baf24544957a4e3af5c965be77e35b8cedb620bed187842727ceb07d60207ebc829b31aa758e9160b73299c133beaf3f605b9c24ce1bb2476f49a28a2ef
7
- data.tar.gz: 4443c8d932e085e4b5e8220088704626c82cf4c39a7749d6f2f68ccd325b9918780c3223f435e5f8dcf5c78e262f9b9740f95bec99573dd20d1bab2edfb1b69a
6
+ metadata.gz: 6c0fb690cb3ef788cb9668fb14fcaa8293266f0ee5aa7cdc7e0a1abfaafb535f3a2285f545036f68e911ee3f1f0e1f3b55a45f6cfd53dfead5bac2af4dd2abfa
7
+ data.tar.gz: 4d57d9219c54401e170a4823b07585375c31b9c462ff38f48c8fc10eb96afb71eda22641dd11faaf3bf7f47993346ef2cbd26dc18eddd57504a18aaf49f89eb1
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- we_bridge_rails_engine_orgs (0.1.0)
4
+ we_bridge_rails_engine_orgs (0.1.1)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
@@ -0,0 +1,17 @@
1
+ module OrgCommon
2
+ extend ActiveSupport::Concern
3
+ included do
4
+ # class_attribute :org_id_key
5
+ class << self; attr_accessor :org_id_key; end
6
+ before_action { @org = Org.find(params[self.class.org_id_key || :org_id]) }
7
+ before_action only: [:edit,:update,:destroy] do
8
+ login_required
9
+ # check_current_user(@record)
10
+ end
11
+ end
12
+
13
+ def record_params
14
+ super.tap{|rtn| rtn[:org_id] ||= @org.id }
15
+ end
16
+
17
+ end
@@ -1,8 +1,5 @@
1
1
  class OrgActivitiesController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgActivity
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -1,9 +1,5 @@
1
1
  class OrgBranchTypesController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgBranchType
4
- before_action { @org = Org.find params[:org_id] }
5
- before_action only: [:edit,:update,:destroy] do
6
- login_required
7
- # check_current_user(@record)
8
- end
4
+ include OrgCommon
9
5
  end
@@ -1,9 +1,5 @@
1
1
  class OrgBranchesController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgBranch
4
- before_action { @org = Org.find params[:org_id] }
5
- before_action only: [:edit,:update,:destroy] do
6
- login_required
7
- # check_current_user(@record)
8
- end
4
+ include OrgCommon
9
5
  end
@@ -1,8 +1,5 @@
1
1
  class OrgDirectorTypesController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgDirectorType
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -1,8 +1,5 @@
1
1
  class OrgDirectorsController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgDirector
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -1,8 +1,5 @@
1
1
  class OrgMemberTagsController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgMemberTag
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -1,8 +1,5 @@
1
1
  class OrgMemberTypesController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgMemberType
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -1,8 +1,5 @@
1
1
  class OrgMembersController < ApplicationController
2
2
  include WeBridge::AutoViewHelper::Controller
3
3
  set_model OrgMember
4
- before_action only: [:edit,:update,:destroy] do
5
- login_required
6
- # check_current_user(@record)
7
- end
4
+ include OrgCommon
8
5
  end
@@ -3,6 +3,5 @@ class OrgsController < ApplicationController
3
3
  set_model Org
4
4
  before_action only: [:edit,:update,:destroy] do
5
5
  login_required
6
- # check_current_user(@record)
7
6
  end
8
7
  end
@@ -4,5 +4,12 @@ class OrgActivity < ActiveRecord::Base
4
4
  belongs_to :org
5
5
  include ActiveRecord::Mlang
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
- # set_accessible_attrs :email,:user_img_url,:lang_id
7
+ set_accessible_attrs :position
8
+ def <=>(other)
9
+ self.position <=> (other.try(:position) || self.position + 1)
10
+ end
11
+
12
+ def __display__
13
+ self.text.label
14
+ end
8
15
  end
@@ -3,5 +3,5 @@ require 'activerecord/mlang'
3
3
  class OrgActivityText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :label,:description
7
7
  end
@@ -6,4 +6,8 @@ class OrgBranch < ActiveRecord::Base
6
6
  include ActiveRecord::Mlang
7
7
  include ActionView::Helpers::AutoTagHelper::FormInfo
8
8
  set_accessible_attrs :org_branch_type_id
9
+
10
+ def __display__
11
+ self.text.name + self.org_branch_type.__display__
12
+ end
9
13
  end
@@ -3,6 +3,6 @@ require 'activerecord/mlang'
3
3
  class OrgBranchText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :name
7
7
  end
8
8
 
@@ -4,7 +4,9 @@ class OrgBranchType < ActiveRecord::Base
4
4
  belongs_to :org
5
5
  include ActiveRecord::Mlang
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
- # set_accessible_attrs :email,:user_img_url,:lang_id
7
+ set_accessible_attrs :position
8
+ set_input_options :position, min: 0
9
+
8
10
  def __display__
9
11
  self.text.label
10
12
  end
@@ -3,7 +3,7 @@ require 'activerecord/mlang'
3
3
  class OrgBranchTypeText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :label, :desc
7
7
  end
8
8
 
9
9
 
@@ -4,8 +4,18 @@ class OrgDirectorType < ActiveRecord::Base
4
4
  belongs_to :org
5
5
  include ActiveRecord::Mlang
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
- # set_accessible_attrs :email,:user_img_url,:lang_id
7
+ set_accessible_attrs :position, :limit
8
+ validates :limit, length: {minimum: 1}
9
+ set_input_options :limit, min: 0
10
+
11
+ validates :position, length: {minimum: 0}
12
+ set_input_options :position, min: 0
13
+
8
14
  def <=>(other)
9
15
  self.position <=> (other.try(:position) || self.position + 1)
10
16
  end
17
+
18
+ def __display__
19
+ self.text.try(:label).to_s
20
+ end
11
21
  end
@@ -3,6 +3,6 @@ require 'activerecord/mlang'
3
3
  class OrgDirectorTypeText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :label, :desc
7
7
  end
8
8
 
@@ -8,12 +8,27 @@ class OrgMember < ActiveRecord::Base
8
8
 
9
9
  include ActiveRecord::Mlang
10
10
  include ActionView::Helpers::AutoTagHelper::FormInfo
11
- set_accessible_attrs :lang_id, :handle_name, :byear, :bmonth, :bday, :entried_on, :sex, :expire_at, :retired_on
11
+ set_accessible_attrs :lang_id, :org_director_type_id, :org_member_type_id, :handle_name, :byear, :bmonth, :bday, :entried_on, :sex, :expire_at, :retired_on
12
12
  set_input_options :byear, min: Time.now.year - 120, max: Time.now.year
13
13
  set_input_options :bmonth, min: 1, max: 12
14
14
  set_input_options :bday, min: 1, max: 31
15
15
  set_input_options :sex, min: -1, max: 1
16
16
 
17
+ def others
18
+ self.class.where(org_id: self.org_id).where.not(id: self.id)
19
+ end
20
+
21
+ before_save do
22
+ if changed_attributes[:org_director_type_id]
23
+ limit = OrgDirectorType.select(:limit).where(id: self.org_director_type_id).first.limit
24
+ if limit < 1 || others.where(org_director_type_id: self.org_director_type_id).count < limit
25
+ # no problem
26
+ else
27
+ raise WeBridge::Exceptions::ForbiddenError
28
+ end
29
+ end
30
+ end
31
+
17
32
  def <=>(other)
18
33
  [:director_type, :member_type, :entried_on, :created_at].inspect(nil){|rtn,m| rtn || (self.try(m) <=> other.try(m)).to_i.nonzero? }
19
34
  end
@@ -23,6 +38,6 @@ class OrgMember < ActiveRecord::Base
23
38
  end
24
39
 
25
40
  def real_name
26
- self.text(self.lang_id || I18n.locale).try(:name).to_s
41
+ self.text(self.lang_id).try(:name).to_s
27
42
  end
28
43
  end
@@ -4,5 +4,11 @@ class OrgMemberTag < ActiveRecord::Base
4
4
  belongs_to :org
5
5
  include ActiveRecord::Mlang
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
- # set_accessible_attrs :email,:user_img_url,:lang_id
7
+
8
+ def self.editable_columns(); [] ; end
9
+
10
+ def __display__
11
+ self.text.label
12
+ end
13
+
8
14
  end
@@ -3,5 +3,5 @@ require 'activerecord/mlang'
3
3
  class OrgMemberTagText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :label
7
7
  end
@@ -4,8 +4,13 @@ class OrgMemberType < ActiveRecord::Base
4
4
  belongs_to :org
5
5
  include ActiveRecord::Mlang
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
- # set_accessible_attrs :email,:user_img_url,:lang_id
7
+ set_accessible_attrs :position
8
8
  def <=>(other)
9
9
  self.position <=> (other.try(:position) || self.position + 1)
10
10
  end
11
+
12
+ def __display__
13
+ self.text.label
14
+ end
15
+
11
16
  end
@@ -3,6 +3,6 @@ require 'activerecord/mlang'
3
3
  class OrgMemberTypeText < ActiveRecord::Base
4
4
  include ActiveRecord::Mlang::Text
5
5
  include ActionView::Helpers::AutoTagHelper::FormInfo
6
- # set_accessible_attrs :email,:user_img_url,:lang_id
6
+ set_accessible_attrs :label, :desc
7
7
  end
8
8
 
@@ -1 +1,9 @@
1
- show_common @record, show_path: url_for(action: :show, id: @record.id), back_path: url_for(action: :index), edit_path: url_for(action: :edit, id: @record.id)
1
+ markup do |m|
2
+ m.div do
3
+ m.ul do
4
+ m.li do
5
+ m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: (@org || @record).id)
6
+ end
7
+ end
8
+ end
9
+ end + show_common(@record, show_path: url_for(action: :show, id: @record.id), back_path: url_for(action: :index), edit_path: url_for(action: :edit, id: @record.id))
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -1,9 +1 @@
1
- markup do |m|
2
- m.div do
3
- m.ul do
4
- m.li do
5
- m.a "Show members", href: url_for(controller: :org_members, action: :index, org_id: @record.id)
6
- end
7
- end
8
- end
9
- end + render('common/show')
1
+ render('common/show')
@@ -25,13 +25,14 @@ class CreateOrgs < ActiveRecord::Migration
25
25
 
26
26
  create_table :org_activities do |t|
27
27
  t.integer :org_id , null: false
28
+ t.integer :position, null: false, default: 0
28
29
  t.timestamps null: false
29
30
  end
30
31
 
31
32
  create_table :org_activity_texts do |t|
32
33
  t.integer :parent_id, null: false
33
34
  t.integer :lang_id, null: false
34
- t.string :label, null: false
35
+ t.string :label
35
36
  t.text :description
36
37
  t.timestamps null: false
37
38
  end