we_bridge_rails_engine_orgs 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 56d4b90dbd21685a0ed9835dd2d04b1a343fcf9b
4
- data.tar.gz: 7354e5f72ca0c1c2ef2bf06e31141e7389d33457
3
+ metadata.gz: 1e985cea2955b94b2e16aa73f72f65574ad26b09
4
+ data.tar.gz: 8e1691d52ba938472ad6c8686f8a237e8af52cd5
5
5
  SHA512:
6
- metadata.gz: 328e502c7ca42ff1ae3f27b2df5059ddebb3ceae7f0ad5b9ebfc6994678d0825fae6cc2e9c18403995104785727b9d9f969bc486ee0a4ee6763cade7315327ed
7
- data.tar.gz: cccc72c5002815ed2b99d67bb1f8e45136279bbb2901752251faad523c4b9f8dc1ec464c7a44fa124d91541a5509c01ceb165151b41f4f8d4028fe0715bd959a
6
+ metadata.gz: 86bfd633a0a335878a4f2b3441e56d9b7646e7ed6def982db3391b5487e965ed5456d749e3544e2b9f1b4eee1b070a13bbe948be4e7db94e5e52b33ebdb24a72
7
+ data.tar.gz: 3b23a207085e01da274b47dba912083eaa583b1be27e58260f99539391fc5214fc1db17f5bedf774f2436d06cd434be2df78b82d8377bbc893ff860456647fce
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.4)
4
+ we_bridge_rails_engine_orgs (0.1.5)
5
5
  actionview-helpers-auto_tag_helper
6
6
  activerecord-mlang
7
7
  we_bridge-auto_view_helper
@@ -5,7 +5,8 @@ class OrgBranch < ActiveRecord::Base
5
5
  belongs_to :org_branch_type
6
6
  include ActiveRecord::Mlang
7
7
  include ActionView::Helpers::AutoTagHelper::FormInfo
8
- set_accessible_attrs :org_branch_type_id
8
+ set_accessible_attrs :org_branch_type_id, :position
9
+ default_scope ->(){ order :position, :id }
9
10
 
10
11
  def __display__
11
12
  self.text.name + self.org_branch_type.__display__
@@ -6,6 +6,7 @@ class OrgBranchType < ActiveRecord::Base
6
6
  include ActionView::Helpers::AutoTagHelper::FormInfo
7
7
  set_accessible_attrs :position
8
8
  set_input_options :position, min: 0
9
+ default_scope ->(){ order :position, :id }
9
10
 
10
11
  def __display__
11
12
  self.text.label
@@ -0,0 +1,5 @@
1
+ class AddBranchPosition < ActiveRecord::Migration
2
+ def change
3
+ add_column :org_branches, :position, :integer, null: false, default: 0
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
1
  module WeBridgeRailsEngineOrgs
2
- VERSION = "0.1.4"
2
+ VERSION = "0.1.5"
3
3
  end
Binary file
@@ -11,7 +11,7 @@
11
11
  #
12
12
  # It's strongly recommended that you check this file into your version control system.
13
13
 
14
- ActiveRecord::Schema.define(version: 20151009112829) do
14
+ ActiveRecord::Schema.define(version: 20151203153522) do
15
15
 
16
16
  create_table "lang_texts", force: :cascade do |t|
17
17
  t.integer "parent_id", null: false
@@ -90,10 +90,11 @@ ActiveRecord::Schema.define(version: 20151009112829) do
90
90
  end
91
91
 
92
92
  create_table "org_branches", force: :cascade do |t|
93
- t.integer "org_branch_type_id", null: false
94
- t.integer "org_id", null: false
95
- t.datetime "created_at", null: false
96
- t.datetime "updated_at", null: false
93
+ t.integer "org_branch_type_id", null: false
94
+ t.integer "org_id", null: false
95
+ t.datetime "created_at", null: false
96
+ t.datetime "updated_at", null: false
97
+ t.integer "position", default: 0, null: false
97
98
  end
98
99
 
99
100
  create_table "org_director_type_texts", force: :cascade do |t|
@@ -26054,3 +26054,170 @@ Completed 200 OK in 157ms (Views: 148.4ms | ActiveRecord: 4.6ms)
26054
26054
  OrgMember Load (0.3ms) SELECT "org_members".* FROM "org_members" WHERE "org_members"."org_id" = ? [["org_id", 1]]
26055
26055
  Org Load (1.2ms) SELECT "orgs".* FROM "orgs" ORDER BY "orgs"."id" ASC LIMIT 1
26056
26056
  OrgMember Load (0.2ms) SELECT "org_members".* FROM "org_members" WHERE "org_members"."org_id" = ? [["org_id", 1]]
26057
+ OrgBranch Load (1.9ms) SELECT "org_branches".* FROM "org_branches" ORDER BY "org_branches"."position" ASC
26058
+ ActiveRecord::SchemaMigration Load (0.5ms) SELECT "schema_migrations".* FROM "schema_migrations"
26059
+ Migrating to AddBranchPosition (20151203153522)
26060
+  (0.2ms) begin transaction
26061
+  (0.6ms) ALTER TABLE "org_branches" ADD "position" integer NOT NULL
26062
+  (0.1ms) rollback transaction
26063
+ ActiveRecord::SchemaMigration Load (0.6ms) SELECT "schema_migrations".* FROM "schema_migrations"
26064
+ Migrating to AddBranchPosition (20151203153522)
26065
+  (0.2ms) begin transaction
26066
+  (0.6ms) ALTER TABLE "org_branches" ADD "position" integer DEFAULT 0 NOT NULL
26067
+ SQL (0.6ms) INSERT INTO "schema_migrations" ("version") VALUES (?) [["version", "20151203153522"]]
26068
+  (1.1ms) commit transaction
26069
+ ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema_migrations".* FROM "schema_migrations"
26070
+  (0.1ms)  SELECT sql
26071
+ FROM sqlite_master
26072
+ WHERE name='index_lang_texts_on_parent_id_and_lang_id' AND type='index'
26073
+ UNION ALL
26074
+ SELECT sql
26075
+ FROM sqlite_temp_master
26076
+ WHERE name='index_lang_texts_on_parent_id_and_lang_id' AND type='index'
26077
+ 
26078
+  (0.1ms) SELECT sql
26079
+ FROM sqlite_master
26080
+ WHERE name='index_langs_on_code' AND type='index'
26081
+ UNION ALL
26082
+ SELECT sql
26083
+ FROM sqlite_temp_master
26084
+ WHERE name='index_langs_on_code' AND type='index'
26085
+
26086
+  (0.1ms)  SELECT sql
26087
+ FROM sqlite_master
26088
+ WHERE name='index_org_activity_texts_on_lang_id_and_parent_id' AND type='index'
26089
+ UNION ALL
26090
+ SELECT sql
26091
+ FROM sqlite_temp_master
26092
+ WHERE name='index_org_activity_texts_on_lang_id_and_parent_id' AND type='index'
26093
+ 
26094
+  (0.1ms) SELECT sql
26095
+ FROM sqlite_master
26096
+ WHERE name='index_org_branch_member_mappings' AND type='index'
26097
+ UNION ALL
26098
+ SELECT sql
26099
+ FROM sqlite_temp_master
26100
+ WHERE name='index_org_branch_member_mappings' AND type='index'
26101
+
26102
+  (0.1ms)  SELECT sql
26103
+ FROM sqlite_master
26104
+ WHERE name='index_org_branch_texts' AND type='index'
26105
+ UNION ALL
26106
+ SELECT sql
26107
+ FROM sqlite_temp_master
26108
+ WHERE name='index_org_branch_texts' AND type='index'
26109
+ 
26110
+  (0.1ms) SELECT sql
26111
+ FROM sqlite_master
26112
+ WHERE name='index_org_branch_type_texts' AND type='index'
26113
+ UNION ALL
26114
+ SELECT sql
26115
+ FROM sqlite_temp_master
26116
+ WHERE name='index_org_branch_type_texts' AND type='index'
26117
+
26118
+  (0.1ms)  SELECT sql
26119
+ FROM sqlite_master
26120
+ WHERE name='index_org_director_type_texts_on_parent_id_and_lang_id' AND type='index'
26121
+ UNION ALL
26122
+ SELECT sql
26123
+ FROM sqlite_temp_master
26124
+ WHERE name='index_org_director_type_texts_on_parent_id_and_lang_id' AND type='index'
26125
+ 
26126
+  (0.1ms) SELECT sql
26127
+ FROM sqlite_master
26128
+ WHERE name='index_org_member_tag_mappings' AND type='index'
26129
+ UNION ALL
26130
+ SELECT sql
26131
+ FROM sqlite_temp_master
26132
+ WHERE name='index_org_member_tag_mappings' AND type='index'
26133
+
26134
+  (0.1ms)  SELECT sql
26135
+ FROM sqlite_master
26136
+ WHERE name='index_org_member_tag_texts_on_lang_id_and_parent_id' AND type='index'
26137
+ UNION ALL
26138
+ SELECT sql
26139
+ FROM sqlite_temp_master
26140
+ WHERE name='index_org_member_tag_texts_on_lang_id_and_parent_id' AND type='index'
26141
+ 
26142
+  (0.1ms) SELECT sql
26143
+ FROM sqlite_master
26144
+ WHERE name='index_org_member_texts_on_lang_id_and_parent_id' AND type='index'
26145
+ UNION ALL
26146
+ SELECT sql
26147
+ FROM sqlite_temp_master
26148
+ WHERE name='index_org_member_texts_on_lang_id_and_parent_id' AND type='index'
26149
+
26150
+  (0.2ms)  SELECT sql
26151
+ FROM sqlite_master
26152
+ WHERE name='index_org_member_type_texts_on_lang_id_and_parent_id' AND type='index'
26153
+ UNION ALL
26154
+ SELECT sql
26155
+ FROM sqlite_temp_master
26156
+ WHERE name='index_org_member_type_texts_on_lang_id_and_parent_id' AND type='index'
26157
+ 
26158
+  (0.1ms) SELECT sql
26159
+ FROM sqlite_master
26160
+ WHERE name='index_org_texts' AND type='index'
26161
+ UNION ALL
26162
+ SELECT sql
26163
+ FROM sqlite_temp_master
26164
+ WHERE name='index_org_texts' AND type='index'
26165
+
26166
+  (0.1ms)  SELECT sql
26167
+ FROM sqlite_master
26168
+ WHERE name='idx_person_name_texts' AND type='index'
26169
+ UNION ALL
26170
+ SELECT sql
26171
+ FROM sqlite_temp_master
26172
+ WHERE name='idx_person_name_texts' AND type='index'
26173
+ 
26174
+  (0.1ms) SELECT sql
26175
+ FROM sqlite_master
26176
+ WHERE name='index_person_names_on_person_id_and_revision' AND type='index'
26177
+ UNION ALL
26178
+ SELECT sql
26179
+ FROM sqlite_temp_master
26180
+ WHERE name='index_person_names_on_person_id_and_revision' AND type='index'
26181
+
26182
+  (0.1ms)  SELECT sql
26183
+ FROM sqlite_master
26184
+ WHERE name='index_person_texts_on_parent_id_and_lang_id' AND type='index'
26185
+ UNION ALL
26186
+ SELECT sql
26187
+ FROM sqlite_temp_master
26188
+ WHERE name='index_person_texts_on_parent_id_and_lang_id' AND type='index'
26189
+ 
26190
+  (0.1ms) SELECT sql
26191
+ FROM sqlite_master
26192
+ WHERE name='index_sessions_on_updated_at' AND type='index'
26193
+ UNION ALL
26194
+ SELECT sql
26195
+ FROM sqlite_temp_master
26196
+ WHERE name='index_sessions_on_updated_at' AND type='index'
26197
+
26198
+  (0.1ms)  SELECT sql
26199
+ FROM sqlite_master
26200
+ WHERE name='index_sessions_on_session_id' AND type='index'
26201
+ UNION ALL
26202
+ SELECT sql
26203
+ FROM sqlite_temp_master
26204
+ WHERE name='index_sessions_on_session_id' AND type='index'
26205
+ 
26206
+  (0.1ms) SELECT sql
26207
+ FROM sqlite_master
26208
+ WHERE name='index_user_accounts_on_uid' AND type='index'
26209
+ UNION ALL
26210
+ SELECT sql
26211
+ FROM sqlite_temp_master
26212
+ WHERE name='index_user_accounts_on_uid' AND type='index'
26213
+
26214
+  (0.1ms)  SELECT sql
26215
+ FROM sqlite_master
26216
+ WHERE name='index_user_texts_on_lang_id_and_parent_id' AND type='index'
26217
+ UNION ALL
26218
+ SELECT sql
26219
+ FROM sqlite_temp_master
26220
+ WHERE name='index_user_texts_on_lang_id_and_parent_id' AND type='index'
26221
+ 
26222
+ OrgBranch Load (2.5ms) SELECT "org_branches".* FROM "org_branches" ORDER BY "org_branches"."position" ASC
26223
+ OrgBranch Load (1.1ms) SELECT "org_branches".* FROM "org_branches" ORDER BY "org_branches"."position" ASC, "org_branches"."id" ASC
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: we_bridge_rails_engine_orgs
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shinjiro Itagaki
@@ -300,6 +300,7 @@ files:
300
300
  - db/migrate/20150812025526_create_orgs.rb
301
301
  - db/migrate/20150814183339_create_org_branches_table.rb
302
302
  - db/migrate/20151009112829_delete_names.rb
303
+ - db/migrate/20151203153522_add_branch_position.rb
303
304
  - lib/tasks/we_bridge_rails_engine_orgs_tasks.rake
304
305
  - lib/we_bridge_rails_engine_orgs.rb
305
306
  - lib/we_bridge_rails_engine_orgs/engine.rb