pipeline_dealers 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,4 +3,6 @@ require_relative "config"
3
3
 
4
4
  client = PipelineDealers::Client.new(api_key: YOUR_API_KEY)
5
5
  company = client.companies.create(name: "Awesome Company")
6
+ company.name = "blah"
7
+ company.save
6
8
  company.destroy
@@ -85,7 +85,9 @@ module PipelineDealers
85
85
  IGNORE_ATTRIBUTES_WHEN_SAVING = [:updated_at, :created_at]
86
86
  def save_attrs
87
87
  # Ignore some attributes
88
- save_attrs = @attributes.reject { |k, v| IGNORE_ATTRIBUTES_WHEN_SAVING.member?(k) }
88
+ save_attrs = @attributes.reject do |name, value|
89
+ IGNORE_ATTRIBUTES_WHEN_SAVING.member?(name) || self.class.attributes[name.to_sym][:read_only] == true
90
+ end
89
91
 
90
92
  # And allow a model class to modify / edit attributes even further
91
93
  if respond_to?(:attributes_for_saving)
@@ -1,3 +1,3 @@
1
1
  module PipelineDealers
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pipeline_dealers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: