From fb763dc9c7616566f3ef4b1c94d79619bd382902 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 1 Feb 2015 15:50:38 +0100 Subject: Add Railtie for rails integration. --- lib/norwegian-postcodes.rb | 2 ++ lib/norwegian-postcodes/railtie.rb | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 lib/norwegian-postcodes/railtie.rb (limited to 'lib') diff --git a/lib/norwegian-postcodes.rb b/lib/norwegian-postcodes.rb index 22d67d5..cc3cd31 100644 --- a/lib/norwegian-postcodes.rb +++ b/lib/norwegian-postcodes.rb @@ -1,5 +1,7 @@ module PostCodes + require 'norwegian-postcodes/railtie' if defined?(Rails) + Counties = [ "ØSTFOLD", "AKERSHUS", diff --git a/lib/norwegian-postcodes/railtie.rb b/lib/norwegian-postcodes/railtie.rb new file mode 100644 index 0000000..19cd3e7 --- /dev/null +++ b/lib/norwegian-postcodes/railtie.rb @@ -0,0 +1,11 @@ +require 'norwegian-postcodes' +require 'rails' + +module PostCodes + class Railtie < Rails::Railtie + railtie_name :norwegian_postcodes + rake_tasks do + load 'tasks/norwegian-postcodes.rake' + end + end +end \ No newline at end of file -- cgit v1.2.3