lib/intercom-rails/import.rb in intercom-rails-0.1.1 vs lib/intercom-rails/import.rb in intercom-rails-0.2.0
- old
+ new
@@ -67,11 +67,11 @@
private
MAX_BATCH_SIZE = 100
def batches
user_klass.find_in_batches(:batch_size => MAX_BATCH_SIZE) do |users|
users_for_wire = users.map do |u|
- user_proxy = UserProxy.new(u)
+ user_proxy = Proxy::User.new(u)
user_proxy.valid? ? user_proxy.to_hash : nil
end.compact
yield(prepare_batch(users_for_wire), users_for_wire.count) unless users_for_wire.count.zero?
end
@@ -80,11 +80,11 @@
def prepare_batch(batch)
{:users => batch}.to_json
end
def user_klass
- if IntercomRails.config.user_model.present?
- IntercomRails.config.user_model.call
+ if IntercomRails.config.user.model.present?
+ IntercomRails.config.user.model.call
else
User
end
rescue NameError
# Rails lazy loads constants, so this is how we check