Skip to content

Commit 3af9536

Browse files
committed
Adding more customer-centric transformations
1 parent 89275d2 commit 3af9536

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

lib/netsuite_rails/transformations.rb

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,14 @@ def transform(type, value, direction)
66
self.send(type, value, direction)
77
end
88

9+
def memo(memo, direction = :push)
10+
if direction == :push
11+
memo[0..999]
12+
else
13+
memo
14+
end
15+
end
16+
917
# gift certificate codes have a maximum of 9 characters
1018
def gift_card_code(code, direction = :push)
1119
if direction == :push
@@ -15,6 +23,15 @@ def gift_card_code(code, direction = :push)
1523
end
1624
end
1725

26+
# company_name field has a 83 character limit
27+
def company_name(company_name, direction = :push)
28+
if direction == :push
29+
company_name[0..82]
30+
else
31+
company_name
32+
end
33+
end
34+
1835
# NS limits firstname fields to 33 characters
1936
def firstname(firstname, direction = :push)
2037
if direction == :push
@@ -24,6 +41,11 @@ def firstname(firstname, direction = :push)
2441
end
2542
end
2643

44+
# same limitations as firstname
45+
def lastname(lastname, direction = :push)
46+
firstname(lastname, direction)
47+
end
48+
2749
def integer(number, direction = :push)
2850
number.to_i
2951
end

0 commit comments

Comments
 (0)