iron-cms 0.2.0 → 0.2.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
  SHA256:
3
- metadata.gz: 83e3bff7dec1d8b8314905585a727fd217f74a98490b10df269073ead9552751
4
- data.tar.gz: fb88aabc41e2655a676b3fb69bc2b59b9fc9288ad6705fd179545726a39bd287
3
+ metadata.gz: 3dc16db2bf8c1ee5f0cca129113aed94f3064d405ae13b7a8a80cc2f601c4a4f
4
+ data.tar.gz: ff04983432ca9fce51945b29625144685b082047278f6afda51a057e70040b5a
5
5
  SHA512:
6
- metadata.gz: d89557492a11a6e822deec7b7243cc21da7cc118e5432d1dda791477b7d6160e941cdf853e691beda3782fda896454c2c0bb3fe9f0368913bb653c01918646fd
7
- data.tar.gz: 467047c34bd40ac2a56a4c472274bd6806561031ee35e98853d4c7fa3cc8a28fac2849643cd76591842e1a291595a8cb462a3c802e5630ad259910395ee9b7c2
6
+ metadata.gz: 8f1b195f43f04b198e29f18c8bae4dde22424dd869435db76c1e1ea644f8756e67ca0f0cd6f81b4b83410687c664e14952448b599125630c12a13dc547f744a8
7
+ data.tar.gz: c3c3fa9ae10cb698dac50abdac3f36fd6d0342f2ca7800e8d42445330fdb7863faab8a562b57d2d432a71e50ba7a12138d90592b77557a455e55a0899bfb5fba
@@ -58,7 +58,7 @@ module Iron
58
58
  Gem::Package::TarReader.new(tar_io) do |tar|
59
59
  tar.each do |entry|
60
60
  if entry.file?
61
- @files[entry.full_name] = entry.read
61
+ @files[entry.full_name] = entry.read.force_encoding("UTF-8")
62
62
  end
63
63
  end
64
64
  end
@@ -61,7 +61,10 @@ module Iron
61
61
  end
62
62
 
63
63
  existing_entry = @registry.find_entry(snapshot.gid)
64
- return existing_entry if existing_entry
64
+ # Only use the existing entry if it belongs to the correct content type
65
+ if existing_entry && existing_entry.content_type_id == @content_type.id
66
+ return existing_entry
67
+ end
65
68
 
66
69
  new_entry = create_entry
67
70
  @registry.register_entry(snapshot.gid, new_entry)
@@ -60,7 +60,7 @@ module Iron
60
60
  entry = @registry.find_entry(entry_gid)
61
61
  return unless entry
62
62
 
63
- update_entry_route(entry, snapshot.route) if snapshot.route.present?
63
+ update_entry_route(entry, snapshot.route) unless snapshot.route.nil?
64
64
  reconstruct_entry_fields(entry, snapshot)
65
65
  end
66
66
 
@@ -4,6 +4,8 @@ module Iron
4
4
 
5
5
  belongs_to :creator, class_name: "Iron::User", default: -> { Current.user }
6
6
  has_many :fields, inverse_of: :entry, dependent: :destroy
7
+ has_many :referencing_fields, class_name: "Iron::Field", foreign_key: :referenced_entry_id, dependent: :destroy
8
+ has_many :referencing_references, class_name: "Iron::Reference", dependent: :destroy
7
9
 
8
10
  accepts_nested_attributes_for :fields, allow_destroy: true
9
11
 
@@ -19,6 +19,8 @@ module Iron
19
19
  private
20
20
 
21
21
  def instance_matches?(gid)
22
+ return true if gid.params.nil?
23
+
22
24
  instance_token = gid.params[:instance]
23
25
  return true if instance_token.blank?
24
26
 
data/lib/iron/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Iron
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: iron-cms
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Massimo De Marchi