softwear-lib 1.6.2 → 1.7.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.
- checksums.yaml +4 -4
- data/lib/softwear/auth/belongs_to_user.rb +7 -1
- data/lib/softwear/auth/model.rb +4 -0
- data/lib/softwear/lib/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3e9245f4938f0485bf4003d9ddaa38b8d81c2bc3
|
4
|
+
data.tar.gz: bd3b86ff184a2ecc9c5e3de2f0f42e483387ee6d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e6c38fe0ee80ca9c9d507020d24f580b4f9748bd88241cf557059529d0ed3933ecb5e94de57be7a6a3f33007110a0a477b3991b7e2dae0d20561041b894a3ebc
|
7
|
+
data.tar.gz: 89600a8a7de982f5d195574ab38563b20d233d43c26cfd07c34dd45ee0fa56bdb936297e67dda6e3c9aeb528f390b2a554bb842617114ae9543be3f69ab57faf
|
@@ -7,7 +7,11 @@ module Softwear
|
|
7
7
|
def belongs_to_user_called(name, options = {})
|
8
8
|
foreign_key = "#{name}_id"
|
9
9
|
|
10
|
-
|
10
|
+
# Create an anonymous module and include it, so that we can
|
11
|
+
# override the generated association methods and call `super`
|
12
|
+
# in the method body.
|
13
|
+
association_methods = Module.new
|
14
|
+
association_methods.module_eval <<-RUBY, __FILE__, __LINE__ + 1
|
11
15
|
def #{name}
|
12
16
|
@#{name} ||= User.find(#{name}_id)
|
13
17
|
end
|
@@ -17,6 +21,8 @@ module Softwear
|
|
17
21
|
@#{name} = new
|
18
22
|
end
|
19
23
|
RUBY
|
24
|
+
|
25
|
+
send(:include, association_methods)
|
20
26
|
end
|
21
27
|
|
22
28
|
def belongs_to_user
|
data/lib/softwear/auth/model.rb
CHANGED
data/lib/softwear/lib/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: softwear-lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.7.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Nigel Baillie
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|