Sha256: 2bca1f9eb392de844fb7e275ea597f0ad81a40b004944d9aa9b38c7f6e031f3a

Contents?: true

Size: 427 Bytes

Versions: 17

Compression:

Stored size: 427 Bytes

Contents

module Mtwarden
	class BraintreePlanFetcher
		def self.store_locally
			Braintree::Plan.all.each do |plan|
				if local_plan = Mtwarden::Plan.find_by(braintree_id: plan.id)
					local_plan.update_attributes({
					:name => plan.name,
					:price => plan.price
				})
				else
					Mtwarden::Plan.create({
						:name => plan.name,
						:price => plan.price,
						:braintree_id => plan.id
					})
				end
			end
		end
	end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
mtwarden-3.3.4 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.3.3 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.3.2 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.3.1 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.3.0 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.2.0 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.1.2 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.1.1 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.1.0 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.0.3 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.0.2 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-3.0.1 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-2.2.7 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-2.2.6 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-2.2.5 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-2.2.0 lib/mtwarden/braintree_plan_fetcher.rb
mtwarden-2.1.0 lib/mtwarden/braintree_plan_fetcher.rb