goedel 0.1.0 → 0.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 442af6e216ec968f6de6a0ca74615103531c2921
4
- data.tar.gz: 81b3dfac290745b79d663dbf540fa23ecbb5f1a1
3
+ metadata.gz: 1917bed016988ddd73c404116468ffbc71f3a002
4
+ data.tar.gz: b3a856ace7905a64dd633a7a314afca073e59eac
5
5
  SHA512:
6
- metadata.gz: 365931a0b27d15fc80126b98e2ae423d50661baf852258a3e85b800fb818f40671494679011b6e9ed9b8d742321bf22fa74bd775e678b80de5201a095060c0da
7
- data.tar.gz: 7aba8147b4dbf9f6a682ebed2c5ea3356f15116938348396806d943624093fa7595369eefb00b1ed0008f2c2eb1545bc3272d0fe2071ead3a2eb8f4ff9a4ba1b
6
+ metadata.gz: 74786485413661350d823c36f20d51905cc1a0ce6d5589d34997022e714c4efdad51fa526b899157ad44ab4bbf1c24dbc58ff6328a76e26faaf2a88016a189e6
7
+ data.tar.gz: ebcbc501f73eb19ee864b30310f53aa4b85b66cdef5adad3633ac0b189ea7012eb8b10509a74bf94a3d2bc157cd04becc02d6bf857c24a634a7731945b3d624e
data/README.md CHANGED
@@ -63,17 +63,20 @@ User.create(
63
63
  name: "Goedel",
64
64
  address: "123 Incomplete St. Princeton, New Jersey"
65
65
  )
66
- ```
67
66
 
68
- #### Compatability
67
+ # You can also override attribute values
69
68
 
70
- Tested with ActiveRecord 4.2.1
69
+ Goedel.goedel(
70
+ last_user,
71
+ force_attributes: [:address],
72
+ override_attributes: {"email" => "hide_email@fake.com, }
73
+ )
71
74
 
72
- ## Development
75
+ ```
73
76
 
74
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
77
+ #### Compatability
75
78
 
76
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
79
+ Tested with ActiveRecord 4.2.1
77
80
 
78
81
  ## Contributing
79
82
 
@@ -1,10 +1,11 @@
1
1
  module Goedel
2
2
  class Statement
3
- attr_reader :object, :indent, :force_attributes
3
+ attr_reader :object, :indent, :force_attributes, :override_attributes
4
4
 
5
5
  def initialize(object, options={})
6
6
  @object = object
7
7
  @force_attributes = options[:force_attributes] || []
8
+ @override_attributes = options[:override_attributes] || {}
8
9
  @indent = 2
9
10
  end
10
11
 
@@ -30,7 +31,7 @@ module Goedel
30
31
  val = object.send(attr)
31
32
  obj_attr[prop] = val
32
33
  end
33
- obj_attr
34
+ obj_attr.merge(override_attributes)
34
35
  end
35
36
 
36
37
  def model_create
@@ -1,4 +1,4 @@
1
1
  module Goedel
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: goedel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Steven Li
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-01-28 00:00:00.000000000 Z
11
+ date: 2016-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport