Skip to content

Commit

Permalink
Fix/silence Ruby warnings for Hanami::Repository
Browse files Browse the repository at this point in the history
  • Loading branch information
jodosha committed May 23, 2017
1 parent 159f570 commit ff2dae4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions lib/hanami/repository.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
require 'hanami/model/association'
require 'hanami/utils/class'
require 'hanami/utils/class_attribute'
require 'hanami/utils/io'

module Hanami
# Mediates between the entities and the persistence layer, by offering an API
Expand Down Expand Up @@ -281,12 +282,18 @@ def self.inherited(klass)
include Utils::ClassAttribute
auto_struct true

@associations = nil
@mapping = nil
@schema = nil

class_attribute :entity
class_attribute :entity_name
class_attribute :relation

def self.relation=(name)
@relation = name.to_sym
Hanami::Utils::IO.silence_warnings do
def self.relation=(name)
@relation = name.to_sym
end
end

self.entity_name = Model::EntityName.new(name)
Expand Down

0 comments on commit ff2dae4

Please sign in to comment.