classy-inheritance 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/History.txt CHANGED
@@ -1,3 +1,5 @@
1
+ == 0.4.0 2008-06-23
2
+ * Add: support for other options such as :dependent and :class_name
1
3
  == 0.3.0 2008-06-12
2
4
  * Add: :prefix parameter to depends_on call. So if you have User.depends_on(:profile, :attrs => [:first_name], :prefix => true), your user model will have @user.profile_first_name. This is to avoid name collisions with requisite classes.
3
5
  == 0.2.1 2008-06-09
@@ -64,10 +64,14 @@ module Stonean
64
64
  private
65
65
 
66
66
  def define_relationship(model_sym, options)
67
- if options[:as]
68
- has_one model_sym, polymorphic_constraints(options[:as])
67
+ opts = options.dup
68
+ opts.delete(:attrs)
69
+ if opts[:as]
70
+ as_opt = opts.delete(:as)
71
+ opts = polymorphic_constraints(as_opt).merge(opts)
72
+ has_one model_sym, opts
69
73
  else
70
- belongs_to model_sym
74
+ belongs_to model_sym, opts
71
75
  end
72
76
  end
73
77
 
@@ -1,7 +1,7 @@
1
1
  module ClassyInheritance #:nodoc:
2
2
  module VERSION #:nodoc:
3
3
  MAJOR = 0
4
- MINOR = 3
4
+ MINOR = 4
5
5
  TINY = 0
6
6
 
7
7
  STRING = [MAJOR, MINOR, TINY].join('.')
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: classy-inheritance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Stone
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2008-06-13 00:00:00 -04:00
12
+ date: 2008-06-23 00:00:00 -04:00
13
13
  default_executable:
14
14
  dependencies: []
15
15