staticmodel 1.0.2 → 1.0.3
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/README.md +3 -3
- data/lib/static_model/shortcut.rb +2 -2
- data/lib/static_model/version.rb +9 -6
- 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: 4fd41ebd94ca26928e5c260cd484ae1a12ed115e
|
4
|
+
data.tar.gz: 5e65f9ff068a9295fb5dc94cc72e03e07ec39a85
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f52f6f8ca7d608080419b4822dca78d8e0cd5bf599680e8f8ca06216e441f2389dac6a0153769ad5f3eb74e3f6cfdd7a7a08234d4afb2a961c365f922283ca13
|
7
|
+
data.tar.gz: b1dd800dae7eae19e0791c83f77ddddd7bfb1efdaf44444bca3eee5b60b0b044ee90034ddb79edca2dedc4bbbf8ae48df33ab81152b169cd0470e278b10d9b37
|
data/README.md
CHANGED
@@ -24,9 +24,9 @@ StaticModel usage is pretty similar to ActiveRecord. Although the gem was design
|
|
24
24
|
|
25
25
|
To start using StaticModel you need to:
|
26
26
|
|
27
|
-
* Inherit from `StaticModel::Base
|
28
|
-
* Define the source of your data.
|
29
|
-
* Define your attributes and/or your default values.
|
27
|
+
* [Inherit from `StaticModel::Base`](https://github.com/fertapric/staticmodel#inherit-from-staticmodelbase).
|
28
|
+
* [Define the source of your data](https://github.com/fertapric/staticmodel#define-the-source-of-your-data).
|
29
|
+
* [Define your attributes and/or your default values](https://github.com/fertapric/staticmodel#define-your-attributes-andor-your-default-values).
|
30
30
|
|
31
31
|
|
32
32
|
### Inherit from `StaticModel::Base`
|
@@ -6,7 +6,7 @@ module StaticModel
|
|
6
6
|
|
7
7
|
module ClassMethods
|
8
8
|
def method_missing(method_sym, *arguments, &block)
|
9
|
-
if
|
9
|
+
if exists?(method_sym.to_s)
|
10
10
|
find(method_sym.to_s)
|
11
11
|
else
|
12
12
|
super
|
@@ -14,7 +14,7 @@ module StaticModel
|
|
14
14
|
end
|
15
15
|
|
16
16
|
def respond_to?(method_sym, include_private = false)
|
17
|
-
|
17
|
+
exists?(method_sym.to_s) || super
|
18
18
|
end
|
19
19
|
end
|
20
20
|
end
|
data/lib/static_model/version.rb
CHANGED
@@ -1,8 +1,11 @@
|
|
1
1
|
module StaticModel
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
# We use SemVer (http://semver.org)
|
3
|
+
# MAJOR version when you make incompatible API changes
|
4
|
+
MAJOR_VERSION = 1
|
5
|
+
# MINOR version when you add functionality in a backwards-compatible manner
|
6
|
+
MINOR_VERSION = 0
|
7
|
+
# PATCH version when you make backwards-compatible bug fixes
|
8
|
+
PATCH_VERSION = 3
|
9
|
+
|
10
|
+
VERSION = [MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION].join(".")
|
8
11
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: staticmodel
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Fernando Tapia Rico
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: virtus
|