rails_admin 0.4.7 → 0.4.8
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of rails_admin might be problematic. Click here for more details.
- data.tar.gz.sig +2 -1
- data/README.md +1 -1
- data/lib/generators/rails_admin/install_generator.rb +3 -0
- data/lib/rails_admin/adapters/mongoid/abstract_object.rb +6 -7
- data/lib/rails_admin/config/fields/types/text.rb +1 -1
- data/lib/rails_admin/version.rb +1 -1
- data/spec/dummy_app/db/test.sqlite3 +0 -0
- data/spec/dummy_app/log/test.log +15285 -0
- data/spec/rails_admin/adapters/mongoid/abstract_object_spec.rb +47 -0
- data/spec/rails_admin/config/fields/types/text_spec.rb +21 -0
- metadata +6 -6
- metadata.gz.sig +0 -0
@@ -4,6 +4,7 @@ require 'rails_admin/adapters/mongoid/abstract_object'
|
|
4
4
|
describe "RailsAdmin::Adapters::Mongoid::AbstractObject", :mongoid => true do
|
5
5
|
before(:each) do
|
6
6
|
@players = FactoryGirl.create_list :player, 3
|
7
|
+
@draft = FactoryGirl.create :draft
|
7
8
|
@team = RailsAdmin::Adapters::Mongoid::AbstractObject.new FactoryGirl.create :team
|
8
9
|
end
|
9
10
|
|
@@ -27,5 +28,51 @@ describe "RailsAdmin::Adapters::Mongoid::AbstractObject", :mongoid => true do
|
|
27
28
|
@players.each &:reload
|
28
29
|
expect(@team.players.map(&:id)).to match_array @players.map(&:id)
|
29
30
|
end
|
31
|
+
|
32
|
+
describe "model's custom setter" do
|
33
|
+
before do
|
34
|
+
Team.class_eval do
|
35
|
+
def player_ids= players_ids
|
36
|
+
self.custom_field = players_ids * ', '
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
|
41
|
+
after do
|
42
|
+
Team.class_eval do
|
43
|
+
undef player_ids=
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
it "have been called" do
|
48
|
+
expect(@team.custom_field).to eq(nil)
|
49
|
+
@team.player_ids = @players.map(&:id)
|
50
|
+
expect(@team.custom_field).to eq(@players.map(&:id) * ', ')
|
51
|
+
end
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
describe "references_one association" do
|
56
|
+
describe "model's custom setter" do
|
57
|
+
before do
|
58
|
+
Team.class_eval do
|
59
|
+
def draft_id= draft_id
|
60
|
+
self.custom_field = draft_id.to_s
|
61
|
+
end
|
62
|
+
end
|
63
|
+
end
|
64
|
+
|
65
|
+
after do
|
66
|
+
Team.class_eval do
|
67
|
+
undef draft_id=
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
71
|
+
it "have been called" do
|
72
|
+
expect(@team.custom_field).to eq(nil)
|
73
|
+
@team.draft_id = @draft.id
|
74
|
+
expect(@team.custom_field).to eq(@draft.id.to_s)
|
75
|
+
end
|
76
|
+
end
|
30
77
|
end
|
31
78
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe RailsAdmin::Config::Fields::Types::Text do
|
4
|
+
describe 'ckeditor_base_location' do
|
5
|
+
before do
|
6
|
+
@custom_prefix = '/foo'
|
7
|
+
@default_prefix = Rails.application.config.assets.prefix
|
8
|
+
Rails.application.config.assets.prefix = @custom_prefix
|
9
|
+
end
|
10
|
+
|
11
|
+
after do
|
12
|
+
Rails.application.config.assets.prefix = @default_prefix
|
13
|
+
end
|
14
|
+
|
15
|
+
it 'allows custom assets prefix' do
|
16
|
+
expect(
|
17
|
+
RailsAdmin.config(FieldTest).fields.find{|f| f.name == :text_field}.with(object: FieldTest.new).ckeditor_base_location[0..(@custom_prefix.length-1)]
|
18
|
+
).to eq @custom_prefix
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_admin
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -39,7 +39,7 @@ cert_chain:
|
|
39
39
|
U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
|
40
40
|
cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
|
41
41
|
cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
|
42
|
-
date: 2013-
|
42
|
+
date: 2013-05-12 00:00:00.000000000 Z
|
43
43
|
dependencies:
|
44
44
|
- !ruby/object:Gem::Dependency
|
45
45
|
name: bootstrap-sass
|
@@ -705,6 +705,7 @@ files:
|
|
705
705
|
- spec/rails_admin/config/fields/time_spec.rb
|
706
706
|
- spec/rails_admin/config/fields/timestamp_spec.rb
|
707
707
|
- spec/rails_admin/config/fields/types/datetime_spec.rb
|
708
|
+
- spec/rails_admin/config/fields/types/text_spec.rb
|
708
709
|
- spec/rails_admin/config/fields_spec.rb
|
709
710
|
- spec/rails_admin/config/has_fields_spec.rb
|
710
711
|
- spec/rails_admin/config/lazy_model_spec.rb
|
@@ -726,15 +727,12 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
726
727
|
- - ! '>='
|
727
728
|
- !ruby/object:Gem::Version
|
728
729
|
version: '0'
|
729
|
-
segments:
|
730
|
-
- 0
|
731
|
-
hash: -2375057804005378306
|
732
730
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
733
731
|
none: false
|
734
732
|
requirements:
|
735
733
|
- - ! '>='
|
736
734
|
- !ruby/object:Gem::Version
|
737
|
-
version: 1.3.
|
735
|
+
version: 1.3.5
|
738
736
|
requirements: []
|
739
737
|
rubyforge_project:
|
740
738
|
rubygems_version: 1.8.23
|
@@ -923,6 +921,7 @@ test_files:
|
|
923
921
|
- spec/rails_admin/config/fields/time_spec.rb
|
924
922
|
- spec/rails_admin/config/fields/timestamp_spec.rb
|
925
923
|
- spec/rails_admin/config/fields/types/datetime_spec.rb
|
924
|
+
- spec/rails_admin/config/fields/types/text_spec.rb
|
926
925
|
- spec/rails_admin/config/fields_spec.rb
|
927
926
|
- spec/rails_admin/config/has_fields_spec.rb
|
928
927
|
- spec/rails_admin/config/lazy_model_spec.rb
|
@@ -931,3 +930,4 @@ test_files:
|
|
931
930
|
- spec/rails_admin/config_spec.rb
|
932
931
|
- spec/rails_admin/support/csv_converter_spec.rb
|
933
932
|
- spec/spec_helper.rb
|
933
|
+
has_rdoc:
|
metadata.gz.sig
CHANGED
Binary file
|