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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6f5ad82781d6334b11179ab0981b622e4d47494a
4
- data.tar.gz: d82b3d440be2c90ff4354d557dc3f1ac8fa53ab5
3
+ metadata.gz: e5566cc3196326d3e3d61756aaedf098da67294e
4
+ data.tar.gz: d1c5d0beaee2366d2e443c40dca55fd2e9ced60c
5
5
  SHA512:
6
- metadata.gz: 419b37034fd69cc6c115ede5ee8b663f589bd432ea7f25f6942378d7ced2b319e53eabf4ab056a9b063792804a6d5929934a3e23b448246302df275e6b68726b
7
- data.tar.gz: 5750864f0f361b69d54e3c063b2c8b48444d903c933c957224592fb8261d363bc12f1ec175ec3fab87850d6312db525ba82bbe000907785db3ff8f8dec317785
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, 'hmm', 'whatevers << Whatever.new(right: hmm)'
143
+ lr_method :add_whatever, 'right', 'whatevers << Whatever.new(right: right)'
141
144
  end
142
145
 
143
146
  thing = Thing.new stuff: 'stuff'
@@ -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.
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module LazyRecord
3
- VERSION = '0.1.2'
3
+ VERSION = '0.1.3'
4
4
  end
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.2
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: '0'
1461
+ version: 2.1.0
1462
1462
  required_rubygems_version: !ruby/object:Gem::Requirement
1463
1463
  requirements:
1464
1464
  - - ">="