lazy_record 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -1
- data/lazy_record.gemspec +1 -0
- data/lib/lazy_record/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: e5566cc3196326d3e3d61756aaedf098da67294e
|
4
|
+
data.tar.gz: d1c5d0beaee2366d2e443c40dca55fd2e9ced60c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ae86e253f89643ff48bcff171dc6d0f93778a757faa5e1b3b8f709a5c0669f3f8f5b32e6a70bf48f44a92c3d37c71587d8817f2387cfa0f4213786963d9acf4
|
7
|
+
data.tar.gz: '03871e46d61c8c4d21ec367a35a910752f936895fdda31972339c3b5ecc7501ec3bd5acb5b3a0c16b06fc29c2c42d240f24958bbec5c9f44709d0d974f444830'
|
data/README.md
CHANGED
@@ -121,6 +121,9 @@ thing.whatevers.big_party.low_sleepy
|
|
121
121
|
|
122
122
|
Whatever.low_sleepy
|
123
123
|
# => #<WhateverRelation [#<Whatever id: 2, party_value: 13, sleepy_value: 3>, #<Whatever id: 4, party_value: 3, sleepy_value: 5>]>
|
124
|
+
|
125
|
+
Whatever.where('id == 1')
|
126
|
+
# => #<WhateverRelation [#<Whatever id: 1, party_value: 12, sleepy_value: 12>
|
124
127
|
```
|
125
128
|
|
126
129
|
Use `lr_method` for an alternative API for defining short instance methods. Can use lambda syntax or string syntax. Only good for quick one-liners. If the method references `self` of the instance, either explicitly or implicitly, it needs to use the string syntax, since any variables not passed into the lambda will be evaluated in the context of the Class level scope.
|
@@ -137,7 +140,7 @@ class Thing < LazyRecord::Base
|
|
137
140
|
lr_validates :stuff, presence: true
|
138
141
|
lr_has_many :whatevers
|
139
142
|
lr_method :speak, -> (string) { puts string }
|
140
|
-
lr_method :add_whatever, '
|
143
|
+
lr_method :add_whatever, 'right', 'whatevers << Whatever.new(right: right)'
|
141
144
|
end
|
142
145
|
|
143
146
|
thing = Thing.new stuff: 'stuff'
|
data/lazy_record.gemspec
CHANGED
@@ -17,6 +17,7 @@ Gem::Specification.new do |spec|
|
|
17
17
|
spec.add_dependency 'activesupport'
|
18
18
|
spec.add_development_dependency 'pry'
|
19
19
|
spec.add_development_dependency 'rspec'
|
20
|
+
spec.required_ruby_version = '>= 2.1.0'
|
20
21
|
|
21
22
|
# Prevent pushing this gem to RubyGems.org. To allow pushes either set the 'allowed_push_host'
|
22
23
|
# to allow pushing to a single host or delete this section to allow pushing to any host.
|
data/lib/lazy_record/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lazy_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- M. Simon Borg
|
@@ -1458,7 +1458,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
1458
1458
|
requirements:
|
1459
1459
|
- - ">="
|
1460
1460
|
- !ruby/object:Gem::Version
|
1461
|
-
version:
|
1461
|
+
version: 2.1.0
|
1462
1462
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
1463
1463
|
requirements:
|
1464
1464
|
- - ">="
|