introspective_admin 0.0.4 → 0.0.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: 34189bc924cbba881f0a7657ab2baff9ee7b3b78
4
- data.tar.gz: 480171232780e51a4849ebd4c9b8bd238f022659
3
+ metadata.gz: 4c0a321b6b65fb2a88e2107426a09cffa67721d7
4
+ data.tar.gz: 9f4a594b3282bd55e7cff9a9be5a003d3f3856b5
5
5
  SHA512:
6
- metadata.gz: cc3cc21f355374e2913030de42303428afebc7f2d22e70685fb5628df57e73175b3381de4ba271ee34fade1e7bced2811091e6e277359a80eb4b610ef252f2df
7
- data.tar.gz: 1f4457130ca6007821d290aaa7ce4a21d9fe710d957cbb8acd476b90020815982ef9efa471e3da463c424f2dbd82b37292cc9831e12d4599d2ba96115d78d695
6
+ metadata.gz: fc27dae02966d55f49c99c7ceb9fa845cb9cfb165ec55be736d20f301c748dbd11706864007512c007ca07cb4654a61745844e4f18502ba3a624d10d41c02bbc
7
+ data.tar.gz: 53b50812f0d5075b8ae1198763fb02b1e098fe3ebe4392353ffa624bc0148844209eef73d04bd760c9c6e202fbb1c5e39ecb9eb1924407b486cbbfb818e3c9d0
data/Gemfile CHANGED
@@ -3,4 +3,3 @@ source "https://rubygems.org"
3
3
 
4
4
  gemspec
5
5
  gem 'activeadmin', github: 'activeadmin'
6
- gem 'devise'
@@ -34,7 +34,8 @@ module IntrospectiveAdmin
34
34
 
35
35
  def column_list(model)
36
36
  model.columns.map {|c|
37
- c.name.sub(/(_type|_id)$/,'')
37
+ ref_name = c.name.sub(/(_type|_id)$/,'')
38
+ model.reflections[ref_name] ? ref_name : c.name
38
39
  }.uniq-['created_at','updated_at']-exclude_params+include_virtual_attributes
39
40
  end
40
41
 
@@ -1,3 +1,3 @@
1
1
  module IntrospectiveAdmin
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -30,6 +30,7 @@ RSpec.describe Admin::LocationsController, :type => :controller do
30
30
  # will fail until https://github.com/activeadmin/activeadmin/pull/4010 is merged
31
31
  it "renders the form for a new record" do
32
32
  get :new
33
+ response.body.should =~ /location\[unreflected_id\]/
33
34
  response.status.should == 200
34
35
  end
35
36
  end
@@ -4,6 +4,7 @@ class CreateLocations < ActiveRecord::Migration
4
4
  t.string :name, null: false
5
5
  t.string :kind
6
6
  t.integer :parent_location_id, index: true, foreign_key: false
7
+ t.integer :unreflected_id, index: true, foreign_key: false
7
8
 
8
9
  t.timestamps null: false
9
10
  end
@@ -112,14 +112,14 @@ ActiveRecord::Schema.define(version: 20150909225019) do
112
112
 
113
113
  create_table "location_beacons", force: :cascade do |t|
114
114
  t.integer "location_id"
115
- t.integer "company_id", null: false
116
- t.string "mac_address", limit: 12
117
- t.string "uuid", limit: 32, null: false
118
- t.integer "major", null: false
119
- t.integer "minor", null: false
115
+ t.integer "company_id", null: false
116
+ t.string "mac_address", limit: 12
117
+ t.string "uuid", limit: 32, null: false
118
+ t.integer "major", null: false
119
+ t.integer "minor", null: false
120
120
  t.integer "last_known_battery_level"
121
- t.datetime "created_at", null: false
122
- t.datetime "updated_at", null: false
121
+ t.datetime "created_at", null: false
122
+ t.datetime "updated_at", null: false
123
123
  end
124
124
 
125
125
  add_index "location_beacons", ["company_id", "uuid", "major", "minor"], name: "index_location_beacons_unique_company_identifier", unique: true
@@ -139,12 +139,14 @@ ActiveRecord::Schema.define(version: 20150909225019) do
139
139
  t.string "name", null: false
140
140
  t.string "kind"
141
141
  t.integer "parent_location_id"
142
+ t.integer "unreflected_id"
142
143
  t.datetime "created_at", null: false
143
144
  t.datetime "updated_at", null: false
144
145
  end
145
146
 
146
147
  add_index "locations", ["parent_location_id", "kind", "name"], name: "index_locations_on_parent_location_id_and_kind_and_name", unique: true
147
148
  add_index "locations", ["parent_location_id"], name: "index_locations_on_parent_location_id"
149
+ add_index "locations", ["unreflected_id"], name: "index_locations_on_unreflected_id"
148
150
 
149
151
  create_table "project_jobs", force: :cascade do |t|
150
152
  t.integer "project_id", null: false
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: introspective_admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Buermann
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-22 00:00:00.000000000 Z
11
+ date: 2016-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sass-rails