merb-admin 0.6.8 → 0.6.9

Sign up to get free protection for your applications and to get access to all the features.
data/README.rdoc CHANGED
@@ -11,7 +11,7 @@ http://github.com/sferik/merb-admin/raw/master/screenshots/edit.png
11
11
  == Installation
12
12
  $ gem install merb-admin -s http://gemcutter.org
13
13
  In your app, add the following dependency to <tt>config/dependencies.rb</tt>:
14
- dependency "merb-admin", "0.6.8"
14
+ dependency "merb-admin", "0.6.9"
15
15
  Add the following route to <tt>config/router.rb</tt>:
16
16
  add_slice(:merb_admin, :path_prefix => "admin")
17
17
  Then, run the following rake task:
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.6.8
1
+ 0.6.9
@@ -170,9 +170,11 @@ class MerbAdmin::Main < MerbAdmin::Application
170
170
  end
171
171
 
172
172
  def update_associations(association, ids = [])
173
+ @object.send(association[:name]).clear
173
174
  ids.each do |id|
174
175
  update_association(association, id)
175
176
  end
177
+ @object.save
176
178
  end
177
179
 
178
180
  def redirect_on_success
data/lib/merb-admin.rb CHANGED
@@ -24,7 +24,7 @@ if defined?(Merb::Plugins)
24
24
 
25
25
  # Slice metadata
26
26
  self.description = "MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data."
27
- self.version = "0.6.8"
27
+ self.version = "0.6.9"
28
28
  self.author = "Erik Michaels-Ober"
29
29
 
30
30
  # Stub classes loaded hook - runs before LoadClasses BootLoader
data/merb-admin.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{merb-admin}
8
- s.version = "0.6.8"
8
+ s.version = "0.6.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Erik Michaels-Ober"]
12
- s.date = %q{2009-11-20}
12
+ s.date = %q{2009-11-23}
13
13
  s.description = %q{MerbAdmin is a Merb plugin that provides an easy-to-use interface for managing your data.}
14
14
  s.email = %q{sferik@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -613,7 +613,8 @@ describe "MerbAdmin" do
613
613
 
614
614
  describe "update with has-many association", :given => "a league exists and three teams exist" do
615
615
  before(:each) do
616
- @response = request(url(:merb_admin_update, :model_name => "league", :id => @league.id), :method => "put", :params => {:league => {:name => "National League"}, :associations => {:teams => [@teams[0].id, @teams[1].id]}})
616
+ @teams[0].update_attributes(:league_id => @league.id)
617
+ @response = request(url(:merb_admin_update, :model_name => "league", :id => @league.id), :method => "put", :params => {:league => {:name => "National League"}, :associations => {:teams => [@teams[1].id]}})
617
618
  end
618
619
 
619
620
  it "should update an object that already exists" do
@@ -621,13 +622,13 @@ describe "MerbAdmin" do
621
622
  end
622
623
 
623
624
  it "should be associated with the correct objects" do
624
- @teams[0].reload
625
- MerbAdmin::AbstractModel.new("League").first.teams.should include(@teams[0])
626
625
  @teams[1].reload
627
626
  MerbAdmin::AbstractModel.new("League").first.teams.should include(@teams[1])
628
627
  end
629
628
 
630
629
  it "should not be associated with an incorrect object" do
630
+ @teams[0].reload
631
+ MerbAdmin::AbstractModel.new("League").first.teams.should_not include(@teams[0])
631
632
  MerbAdmin::AbstractModel.new("League").first.teams.should_not include(@teams[2])
632
633
  end
633
634
  end
data/spec/spec_helper.rb CHANGED
@@ -83,7 +83,7 @@ module Merb
83
83
  end
84
84
 
85
85
  def set_orm(orm = nil)
86
- orm || ENV['MERB_ORM'] || (Merb.orm != :none ? Merb.orm : nil) || :datamapper
86
+ orm || ENV['MERB_ORM'] || (Merb.orm != :none ? Merb.orm : nil) || :activerecord
87
87
  end
88
88
 
89
89
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: merb-admin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.8
4
+ version: 0.6.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Michaels-Ober
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-11-20 00:00:00 -08:00
12
+ date: 2009-11-23 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency