dragonfly 0.5.5 → 0.5.6

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of dragonfly might be problematic. Click here for more details.

@@ -1,3 +1,10 @@
1
+ 0.5.6 (2010-04-13)
2
+ ==================
3
+
4
+ Fixes
5
+ --------
6
+ - Wasn't working properly with Single-Table Inheritance
7
+
1
8
  0.5.5 (2010-04-13)
2
9
  ==================
3
10
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.5
1
+ 0.5.6
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{dragonfly}
8
- s.version = "0.5.5"
8
+ s.version = "0.5.6"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Mark Evans"]
@@ -35,7 +35,10 @@ module Dragonfly
35
35
  end
36
36
 
37
37
  def dragonfly_apps_for_attributes
38
- @dragonfly_apps_for_attributes ||= {}
38
+ @dragonfly_apps_for_attributes ||= begin
39
+ parent_class = ancestors[1]
40
+ parent_class.respond_to?(:dragonfly_apps_for_attributes) ? parent_class.dragonfly_apps_for_attributes.dup : {}
41
+ end
39
42
  end
40
43
 
41
44
  end
@@ -14,6 +14,13 @@ class MigrationForTest < ActiveRecord::Migration
14
14
  t.string :trailer_video_uid
15
15
  t.timestamps
16
16
  end
17
+
18
+ create_table :cars do |t|
19
+ t.string :image_uid
20
+ t.string :reliant_image_uid
21
+ t.string :type
22
+ end
23
+
17
24
  end
18
25
 
19
26
  def self.down
@@ -545,5 +545,31 @@ describe Item do
545
545
  end
546
546
  end
547
547
  end
548
+
549
+ describe "inheritance" do
550
+ before(:all) do
551
+ @app = Dragonfly::App[:images]
552
+ ActiveRecord::Base.register_dragonfly_app(:image, @app)
553
+ Car.class_eval do
554
+ image_accessor :image
555
+ end
556
+ ReliantRobin.class_eval do
557
+ image_accessor :reliant_image
558
+ end
559
+ end
560
+ it "should allow assigning base class accessors" do
561
+ Car.create! :image => 'blah'
562
+ end
563
+ it "should not allow assigning subclass accessors in the base class" do
564
+ Car.new.should_not respond_to(:reliant_image=)
565
+ end
566
+ it "should allow assigning base class accessors in the subclass" do
567
+ ReliantRobin.create! :image => 'blah'
568
+ end
569
+ it "should allow assigning subclass accessors in the subclass" do
570
+ ReliantRobin.create! :reliant_image => 'blah'
571
+ end
572
+
573
+ end
548
574
 
549
575
  end
@@ -1,2 +1,6 @@
1
1
  class Item < ActiveRecord::Base
2
- end
2
+ end
3
+ class Car < ActiveRecord::Base
4
+ end
5
+ class ReliantRobin < Car
6
+ end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 5
8
- - 5
9
- version: 0.5.5
8
+ - 6
9
+ version: 0.5.6
10
10
  platform: ruby
11
11
  authors:
12
12
  - Mark Evans