active_delegate 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_delegate.rb +3 -1
- data/lib/active_delegate/attributes.rb +1 -1
- data/lib/active_delegate/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6e17b460409a616aa13bb2a37fedc9bc4fb136d0
|
4
|
+
data.tar.gz: b7b928163141d0c4f4acb49eab1b4c5deaf07738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6dd676d93994f9d99f12b20e6b5454a6423af734a89c4f2b5350e733eb75cf759d49c5c540f8c169bbc44596f5cf7786664cf5dd47cc8ea2aa46c546a6211e06
|
7
|
+
data.tar.gz: 7648081d154bd45b0ba836d9a2777a9e44ee0e73952f838555ba62c5557f87a58feb7918e55901e66857c1e46e1e2883487bd86b8b5eb5b6ff3c2d32855a9664
|
data/lib/active_delegate.rb
CHANGED
@@ -17,7 +17,9 @@ module ActiveDelegate
|
|
17
17
|
|
18
18
|
# Delegate attributes
|
19
19
|
def delegate_attributes(*args)
|
20
|
-
options = args.extract_options
|
20
|
+
options = args.extract_options!
|
21
|
+
options = options.except(:single, :cast_type, :alias)
|
22
|
+
|
21
23
|
Attributes.new(self, options)
|
22
24
|
end
|
23
25
|
|
@@ -131,7 +131,7 @@ module ActiveDelegate
|
|
131
131
|
|
132
132
|
# Define attribute names and types
|
133
133
|
def define_attribute_names_and_types(attributes)
|
134
|
-
existing =
|
134
|
+
existing = @model.attribute_names.map(&:to_sym)
|
135
135
|
undefined = attributes.reject { |a| a.in? existing }
|
136
136
|
|
137
137
|
undefined.each do |attrib|
|